Explorar el Código

登录页增加粤政易登录链接

libushang hace 8 meses
padre
commit
389c2a0f27
Se han modificado 2 ficheros con 17 adiciones y 2 borrados
  1. 4 0
      .env.development
  2. 13 2
      src/views/login.vue

+ 4 - 0
.env.development

@@ -19,6 +19,10 @@ VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
 # SnailJob 控制台地址
 VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job'
 
+# 粤政易回调页面
+YZY_REDIRECT_URI = 'http://19.155.220.206:8086/tyrz/login'
+YZY_TYRZ_URL = 'https://xtbg.digitalgd.com.cn/zwrz/rz/sso/oauth/authorize?response_type=code&scope=all&client_id=zwrz_mmzhyj&redirect_uri='
+
 VITE_APP_PORT = 8086
 
 # 接口加密功能开关(如需关闭 后端也必须对应关闭)

+ 13 - 2
src/views/login.vue

@@ -5,7 +5,7 @@
       <div class="title2">智慧应急工作台</div>
       <div class="login-box">
         <div class="login-tabs">
-          <div v-for="(item, index) in tabs" :key="index" :class="tabActive === index ? 'login-tab tab-active' : 'login-tab'">{{ item }}</div>
+          <div v-for="(item, index) in tabs" :key="index" :class="tabActive === index ? 'login-tab tab-active' : 'login-tab'" @click="handleTab(index)">{{ item }}</div>
         </div>
         <el-form-item prop="username">
           <el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
@@ -75,7 +75,7 @@ const userStore = useUserStore();
 const router = useRouter();
 const tabActive = ref(0);
 // '粤政易扫码登录',
-const tabs = reactive(['账号密码登录']);
+const tabs = reactive(['账号密码登录', '粤政易登录']);
 const loginForm = ref<LoginData>({
   tenantId: '000000',
   username: 'admin',
@@ -205,6 +205,16 @@ const doSocialLogin = (type: string) => {
   });
 };
 
+const handleTab = (tab) => {
+  if(tab == 1) {
+    // const redirect_uri = encodeURIComponent(import.meta.env.YZY_REDIRECT_URI);
+    // const tyrz_url = import.meta.env.YZY_TYRZ_URL + redirect_uri;
+    const redirect_uri = encodeURIComponent("http://19.155.220.206:8086/tyrz/login");
+    const tyrz_url = "https://xtbg.digitalgd.com.cn/zwrz/rz/sso/oauth/authorize?response_type=code&scope=all&client_id=zwrz_mmzhyj&redirect_uri="+redirect_uri;
+    window.location.href = tyrz_url;
+  }
+}
+
 onMounted(() => {
   getCode();
   initTenantList();
@@ -303,6 +313,7 @@ onMounted(() => {
   border-bottom: 1px solid #eeeeee;
   margin-bottom: 15px;
   .login-tab {
+    padding: 0 10px;
   }
   .tab-active {
     color: #5695eb;