xiaohaizhao 3 месяцев назад
Родитель
Сommit
f1f1c97904
5 измененных файлов с 416 добавлено и 175 удалено
  1. 3 0
      src/api/api.js
  2. 9 3
      src/components/layout/modules/header.vue
  3. 74 70
      src/router/index.js
  4. 215 0
      src/views/connectionPage/index.vue
  5. 115 102
      src/views/login/login.vue

+ 3 - 0
src/api/api.js

@@ -15,6 +15,9 @@ export default {
     loginout(params) {
     loginout(params) {
         return http.post(`/yos/rest/index/logout`, params,'post')
         return http.post(`/yos/rest/index/logout`, params,'post')
     },
     },
+    ssologin(params) {
+        return http.post(`/yos/rest/sso/eorder`, params,'post')
+    },
     loginbyaccount (params) {
     loginbyaccount (params) {
         return http.post(`/yos/rest/index/loginbyaccount`, params,'post')
         return http.post(`/yos/rest/index/loginbyaccount`, params,'post')
     },
     },

+ 9 - 3
src/components/layout/modules/header.vue

@@ -122,9 +122,15 @@ const loginOut = ()=>{
     okText: '确认',
     okText: '确认',
     cancelText: '取消',
     cancelText: '取消',
     onOk () {
     onOk () {
-      router.push({path:'/'})
-      // Api.loginout({})
-      historyRoutes.value = []
+      if (sessionStorage.getItem('sourceUrl')) {
+          window.location.href = sessionStorage.getItem('sourceUrl') + '/dmsClient/#/'
+          sessionStorage.removeItem('sourceUrl')
+        } else {
+          router.push({path:'/'})
+        }
+        sessionStorage.removeItem('batchShipLastResult')
+        sessionStorage.removeItem('auth')
+        historyRoutes.value = []
     }
     }
   });
   });
 }
 }

+ 74 - 70
src/router/index.js

@@ -2,7 +2,7 @@
 import { useAuthStore } from '@/stores/modules/auth'
 import { useAuthStore } from '@/stores/modules/auth'
 import { useRouteTabsStore } from '@/stores/modules/routeTabs'
 import { useRouteTabsStore } from '@/stores/modules/routeTabs'
 
 
-import { createRouter, createWebHashHistory} from 'vue-router'
+import { createRouter, createWebHashHistory } from 'vue-router'
 import HDrpManagement from './HDrpManagement.js'
 import HDrpManagement from './HDrpManagement.js'
 import SDrpManagement from './SDrpManagement.js'
 import SDrpManagement from './SDrpManagement.js'
 import ARDrpManagement from './ARDrpManagement.js'
 import ARDrpManagement from './ARDrpManagement.js'
@@ -17,115 +17,119 @@ const routes = [
   {
   {
     path: '/',
     path: '/',
     name: 'login',
     name: 'login',
-    component: ()=>import(/* webpackChunkName: "about" */ '@/views/login/login.vue')
+    component: () => import(/* webpackChunkName: "about" */ '@/views/login/login.vue')
   },
   },
   {
   {
     path: '/home',
     path: '/home',
     name: 'home',
     name: 'home',
-    component: ()=>import(/* webpackChunkName: "about" */ '@/components/layout/index.vue'),
+    component: () => import(/* webpackChunkName: "about" */ '@/components/layout/index.vue'),
     redirect: '/dataDashboard',
     redirect: '/dataDashboard',
-    children:[{
-        path: '/landing',
-        name: 'landing',
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/homePage/index.vue')
-      },
-      {
-        path: '/dataDashboard',
+    children: [{
+      path: '/landing',
+      name: 'landing',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/homePage/index.vue')
+    },
+    {
+      path: '/dataDashboard',
+      name: 'dataDashboard',
+      meta: {
+        title: '数据看板',
         name: 'dataDashboard',
         name: 'dataDashboard',
-        meta: {
-          title: '数据看板',
-          name: 'dataDashboard',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/dataDashboard/index.vue'),
+        keepAlive: true
       },
       },
-      {
-        path: '/reportcenter',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/dataDashboard/index.vue'),
+    },
+    {
+      path: '/reportcenter',
+      name: 'reportcenter',
+      meta: {
+        title: '报表中心',
         name: 'reportcenter',
         name: 'reportcenter',
-        meta: {
-          title: '报表中心',
-          name: 'reportcenter',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/reportcenter/index.vue'),
+        keepAlive: true
       },
       },
-      {
-        path: '/reportsManage',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/reportcenter/index.vue'),
+    },
+    {
+      path: '/reportsManage',
+      name: 'reportsManage',
+      meta: {
+        title: '报表管理',
         name: 'reportsManage',
         name: 'reportsManage',
-        meta: {
-          title: '报表管理',
-          name: 'reportsManage',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/reportsManage/index.vue'),
+        keepAlive: true
       },
       },
-      {
-        path: '/custom_option',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/reportsManage/index.vue'),
+    },
+    {
+      path: '/custom_option',
+      name: 'custom_option',
+      meta: {
+        title: '自定义选项分类',
         name: 'custom_option',
         name: 'custom_option',
-        meta: {
-          title: '自定义选项分类',
-          name: 'custom_option',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/customOptions/index.vue'),
+        keepAlive: true
       },
       },
-      {
-        path: '/securityConfig',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/customOptions/index.vue'),
+    },
+    {
+      path: '/securityConfig',
+      name: 'companyInformation',
+      meta: {
+        title: '企业设置',
         name: 'companyInformation',
         name: 'companyInformation',
-        meta: {
-          title: '企业设置',
-          name: 'companyInformation',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/securityConfig/index.vue'),
+        keepAlive: true
       },
       },
-      {
-        path: '/setenterpriseInfo',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/securityConfig/index.vue'),
+    },
+    {
+      path: '/setenterpriseInfo',
+      name: 'setenterpriseInfo',
+      meta: {
+        title: '企业信息',
         name: 'setenterpriseInfo',
         name: 'setenterpriseInfo',
-        meta: {
-          title: '企业信息',
-          name: 'setenterpriseInfo',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/setEnterpriseInfo/index.vue'),
+        keepAlive: true
       },
       },
-      {
-        path: '/modulesPay',
+      component: () => import(/* webpackChunkName: "about" */ '@/views/setEnterpriseInfo/index.vue'),
+    },
+    {
+      path: '/modulesPay',
+      name: 'modulesPay',
+      meta: {
+        title: '模块购买',
         name: 'modulesPay',
         name: 'modulesPay',
-        meta: {
-          title: '模块购买',
-          name: 'modulesPay',
-          keepAlive:true
-        },
-        component: ()=>import(/* webpackChunkName: "about" */ '@/views/modulesPay/index.vue'),
+        keepAlive: true
       },
       },
+      component: () => import(/* webpackChunkName: "about" */ '@/views/modulesPay/index.vue'),
+    },
     ]
     ]
   },
   },
   {
   {
     path: '/404',
     path: '/404',
     name: '404',
     name: '404',
-    component: ()=>import(/* webpackChunkName: "about" */ '@/views/404.vue'),
+    component: () => import(/* webpackChunkName: "about" */ '@/views/404.vue'),
   },
   },
   {
   {
     path: "/:catchAll(.*)",
     path: "/:catchAll(.*)",
     redirect: "/404"
     redirect: "/404"
-  },
+  }, {
+    path: '/connectionPage',
+    name: 'connectionPage',
+    component: () => import(/* webpackChunkName: "about" */ '@/views/connectionPage/index.vue')
+  }
 ]
 ]
 
 
-routes[1].children = [...routes[1].children,...HDrpManagement,...SDrpManagement,...ARDrpManagement,...Customized,...MAR]
+routes[1].children = [...routes[1].children, ...HDrpManagement, ...SDrpManagement, ...ARDrpManagement, ...Customized, ...MAR]
 
 
 const router = createRouter({
 const router = createRouter({
   history: createWebHashHistory(),
   history: createWebHashHistory(),
   routes
   routes
 })
 })
-router.beforeEach((to, from,next)=> {
-  const authPaths = ['videoList','landing','404','login','addTableField','connectionPage']
+router.beforeEach((to, from, next) => {
+  const authPaths = ['videoList', 'landing', '404', 'login', 'addTableField', 'connectionPage']
   if (authPaths.includes(to.name)) {
   if (authPaths.includes(to.name)) {
     next()
     next()
     return
     return
   }
   }
   const store = useAuthStore()
   const store = useAuthStore()
-  store.appData(to.meta.name).then(()=>{
+  store.appData(to.meta.name).then(() => {
     let app = store.app
     let app = store.app
     if (to.name !== '404' && to.name !== 'login') {
     if (to.name !== '404' && to.name !== 'login') {
       if (!store.hasAppData(to.meta.name)) {
       if (!store.hasAppData(to.meta.name)) {

+ 215 - 0
src/views/connectionPage/index.vue

@@ -0,0 +1,215 @@
+<template>
+  <div class="container">
+    <div v-show="loading" class="loading-overlay">
+      <div class="loader">
+        <p class="heading">Loading</p>
+        <div class="loading">
+          <div class="load"></div>
+          <div class="load"></div>
+          <div class="load"></div>
+          <div class="load"></div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { ref, reactive, onMounted, onBeforeUnmount, createVNode } from 'vue';
+import { useRouter } from 'vue-router';
+import Api from '@/api/api';
+import { storeToRefs } from 'pinia';
+import { message, Modal } from 'ant-design-vue';
+import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
+import { useAuthStore } from '@/stores/modules/auth';
+import { useBaseStore } from '@/stores/modules/base';
+import { useRouteTabsStore } from '@/stores/modules/routeTabs';
+
+const rotTabs = useRouteTabsStore();
+const store = useAuthStore();
+const base = useBaseStore();
+let { accountList } = storeToRefs(store);
+let { historyRoutes } = storeToRefs(rotTabs);
+
+const router = useRouter();
+const loading = ref(false);
+
+const checkAccountList = (res) => {
+  if (res.code === 1) {
+    if (res.account_list[0].status == 'INACTIVE') return message.error('当前账号已停用!');
+    accountList.value = res.account_list;
+    base.querySite_Parameter();
+    store.defaultAccount(res.account_list[0], (mod) => {
+      if (res.remindchangepassword == 1) {
+        Modal.confirm({
+          centered: true,
+          zIndex: 9999,
+          title: '提醒',
+          icon: createVNode(ExclamationCircleOutlined),
+          content: res.remindchangepassword_str,
+          okText: '确定',
+          onOk: () => {
+            sessionStorage.setItem('openPasDialog', '1');
+            router.replace({ name: 'landing'});
+          }
+        });
+
+        setTimeout(() => {
+          loading.value = false;
+        }, 1000);
+        
+      } else {
+        router.replace({ name: 'landing'});
+        setTimeout(() => {
+          loading.value = false;
+        }, 1000);
+      }
+    });
+  } else {
+    setTimeout(() => {
+      loading.value = false;
+    }, 1000);
+    message.error(res.msg);
+  }
+};
+
+
+
+const getRouteParams = () => {
+  const cur = router.currentRoute.value || {};
+  const query = cur.query || {};
+  let accesstoken = query.accesstoken || '';
+  let username = query.username || '';
+
+  if (!accesstoken || !username) {
+    const hash = window.location.hash || '';
+    const qIndex = hash.indexOf('?');
+    if (qIndex !== -1) {
+      const queryString = hash.slice(qIndex + 1);
+      // 规范化:将额外的 '?' 替换为 '&',以兼容错误格式
+      const normalized = queryString.replace(/\?/g, '&');
+      const params = new URLSearchParams(normalized);
+      accesstoken = accesstoken || params.get('accesstoken') || '';
+      username = username || params.get('username') || '';
+    }
+  }
+  return { accesstoken, username };
+};
+
+const ssoLogin = async () => {
+  const { accesstoken, username } = getRouteParams();
+  if (!accesstoken || !username) return;
+  loading.value = true;
+  try {
+    const res = await Api.ssologin({ accountno: username, password: accesstoken, systemclient: 'web' });
+    checkAccountList(res);
+  } catch (e) {
+    setTimeout(() => {
+      loading.value = false;
+    }, 1000);
+    message.error('网络异常,请稍后重试');
+  }
+}
+
+const getSourceUrl = () => {
+  const ref = document.referrer || '';
+  if (ref) return ref;
+  const cur = router.currentRoute.value || {};
+  const list = historyRoutes.value || [];
+  const base = `${window.location.origin}${window.location.pathname}${window.location.search}#`;
+  if (list.length > 1) {
+    const idx = list.findIndex(e => e.name === cur.name);
+    const prev = idx > 0 ? list[idx - 1] : list[list.length - 2];
+    if (prev) {
+      const qs = prev.query && Object.keys(prev.query).length > 0 ? `?${new URLSearchParams(prev.query).toString()}` : '';
+      return `${base}${prev.path}${qs}`;
+    }
+  }
+  const qs = cur.query && Object.keys(cur.query).length > 0 ? `?${new URLSearchParams(cur.query).toString()}` : '';
+  return `${base}${cur.path || ''}${qs}`;
+}
+
+onMounted(() => {
+  ssoLogin()
+  sessionStorage.setItem('sourceUrl', getSourceUrl());
+});
+
+onBeforeUnmount(() => {
+});
+</script>
+
+<style>
+.container {
+  position: relative;
+  min-height: 100vh;
+}
+.page-content {
+  width: 100%;
+  height: 100%;
+}
+/* From Uiverse.io by Praashoo7 */ 
+.loader {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.heading {
+  color: black;
+  letter-spacing: 0.2em;
+  margin-bottom: 1em;
+}
+.loading-overlay{
+  height:100vh;
+  width:100vw;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.loading {
+  display: flex;
+  width: 5em;
+  align-items: center;
+  justify-content: center;
+}
+
+.load {
+  width: 23px;
+  height: 3px;
+  background-color: limegreen;
+  animation: 1s move_5011 infinite;
+  border-radius: 5px;
+  margin: 0.1em;
+}
+
+.load:nth-child(1) {
+  animation-delay: 0.2s;
+}
+
+.load:nth-child(2) {
+  animation-delay: 0.4s;
+}
+
+.load:nth-child(3) {
+  animation-delay: 0.6s;
+}
+
+@keyframes move_5011 {
+  0% {
+    width: 0.2em;
+  }
+
+  25% {
+    width: 0.7em;
+  }
+
+  50% {
+    width: 1.5em;
+  }
+
+  100% {
+    width: 0.2em;
+  }
+}
+</style>

+ 115 - 102
src/views/login/login.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-<div class="conatiner">
+  <div class="conatiner">
     <div class="login-wrap">
     <div class="login-wrap">
       <div class="top">
       <div class="top">
         <!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#1890ff" fill-opacity="1" d="M0,288L48,266.7C96,245,192,203,288,202.7C384,203,480,245,576,245.3C672,245,768,203,864,202.7C960,203,1056,245,1152,272C1248,299,1344,309,1392,314.7L1440,320L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>     -->
         <!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#1890ff" fill-opacity="1" d="M0,288L48,266.7C96,245,192,203,288,202.7C384,203,480,245,576,245.3C672,245,768,203,864,202.7C960,203,1056,245,1152,272C1248,299,1344,309,1392,314.7L1440,320L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>     -->
@@ -11,29 +11,14 @@
         </div>
         </div>
         <a-tabs v-model:activeKey="activeKey" @change="tabsChange">
         <a-tabs v-model:activeKey="activeKey" @change="tabsChange">
           <a-tab-pane key="1" tab="账号登陆">
           <a-tab-pane key="1" tab="账号登陆">
-            <a-form
-              :model="formState"
-              name="basic"
-              layout="vertical"
-              autocomplete="off"
-              @finish="onFinish"
-              @finishFailed="onFinishFailed"
-              size="large"
-            >
-              <a-form-item
-                label="账号"
-                name="phonenumber"
-                :rules="[{ required: true, message: '请输入账号' }]" 
-              >
+            <a-form :model="formState" name="basic" layout="vertical" autocomplete="off" @finish="onFinish"
+              @finishFailed="onFinishFailed" size="large">
+              <a-form-item label="账号" name="phonenumber" :rules="[{ required: true, message: '请输入账号' }]">
                 <a-input v-model:value="formState.phonenumber" placeholder="请输入账号" />
                 <a-input v-model:value="formState.phonenumber" placeholder="请输入账号" />
               </a-form-item>
               </a-form-item>
 
 
-              <a-form-item
-                label="密码"
-                name="password"
-                :rules="[{ required: true, message: '请输入密码!' }]"
-              >
-                <a-input-password v-model:value="formState.password" placeholder="请输入密码"/>
+              <a-form-item label="密码" name="password" :rules="[{ required: true, message: '请输入密码!' }]">
+                <a-input-password v-model:value="formState.password" placeholder="请输入密码" />
               </a-form-item>
               </a-form-item>
 
 
               <a-form-item name="remember">
               <a-form-item name="remember">
@@ -46,33 +31,19 @@
             </a-form>
             </a-form>
           </a-tab-pane>
           </a-tab-pane>
           <a-tab-pane key="2" tab="手机号登录" force-render>
           <a-tab-pane key="2" tab="手机号登录" force-render>
-            <a-form
-              :model="formState"
-              name="basic"
-              layout="vertical"
-              autocomplete="off"
-              @finish="onPhoneLoginFinish"
-              @finishFailed="onFinishFailed"
-              size="large"
-            >
-              <a-form-item
-                label="手机号"
-                name="phonenumber"
-                :rules="[{ required: true, message: '请输入手机号' }]" 
-              >
-                <a-input v-model:value="formState.phonenumber" placeholder="请输入手机号"/>
+            <a-form :model="formState" name="basic" layout="vertical" autocomplete="off" @finish="onPhoneLoginFinish"
+              @finishFailed="onFinishFailed" size="large">
+              <a-form-item label="手机号" name="phonenumber" :rules="[{ required: true, message: '请输入手机号' }]">
+                <a-input v-model:value="formState.phonenumber" placeholder="请输入手机号" />
               </a-form-item>
               </a-form-item>
 
 
-              <a-form-item
-                label="验证码"
-                name="password"
-                :rules="[{ required: true, message: '请输入验证码!' }]"
-              >
-              <a-input v-model:value="formState.password" placeholder="请输入验证码">
-                <template #suffix>
-                  <span style="cursor: pointer;" @click.native="countDown">{{count === 0?'点击获取验证码':count+ 's'}}</span>
-                </template>
-              </a-input>
+              <a-form-item label="验证码" name="password" :rules="[{ required: true, message: '请输入验证码!' }]">
+                <a-input v-model:value="formState.password" placeholder="请输入验证码">
+                  <template #suffix>
+                    <span style="cursor: pointer;" @click.native="countDown">{{ count === 0 ? '点击获取验证码' : count + 's'
+                    }}</span>
+                  </template>
+                </a-input>
               </a-form-item>
               </a-form-item>
 
 
               <a-form-item>
               <a-form-item>
@@ -81,7 +52,7 @@
             </a-form>
             </a-form>
           </a-tab-pane>
           </a-tab-pane>
         </a-tabs>
         </a-tabs>
-        
+
       </div>
       </div>
     </div>
     </div>
     <a-layout-footer class="footer">
     <a-layout-footer class="footer">
@@ -90,11 +61,11 @@
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { defineComponent, reactive,ref,createVNode } from 'vue';
+import { defineComponent, reactive, ref, createVNode } from 'vue';
 import { useRouter } from "vue-router";
 import { useRouter } from "vue-router";
-import Api  from '@/api/api'
+import Api from '@/api/api'
 import md5 from 'js-md5'
 import md5 from 'js-md5'
-import { message,Modal } from 'ant-design-vue';
+import { message, Modal } from 'ant-design-vue';
 import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import { useAuthStore } from '@/stores/modules/auth'
 import { useAuthStore } from '@/stores/modules/auth'
 import { useRouteTabsStore } from '@/stores/modules/routeTabs'
 import { useRouteTabsStore } from '@/stores/modules/routeTabs'
@@ -118,38 +89,38 @@ export default defineComponent({
 
 
       login()
       login()
     };
     };
-    const onPhoneLoginFinish = (values)=>{
+    const onPhoneLoginFinish = (values) => {
       loginByCode()
       loginByCode()
     }
     }
     const onFinishFailed = (errorInfo) => {
     const onFinishFailed = (errorInfo) => {
       console.log('Failed:', errorInfo);
       console.log('Failed:', errorInfo);
     };
     };
-    const checkAccountList = (res)=>{
+    const checkAccountList = (res) => {
       if (res.code === 1) {
       if (res.code === 1) {
         if (res.account_list[0].status == 'INACTIVE')
         if (res.account_list[0].status == 'INACTIVE')
           return message.error('当前账号已停用!')
           return message.error('当前账号已停用!')
-        
+
         loading.value = false
         loading.value = false
         accountList.value = res.account_list
         accountList.value = res.account_list
-        store.defaultAccount(res.account_list[0],(mod)=>{
+        store.defaultAccount(res.account_list[0], (mod) => {
 
 
           const loginTips = localStorage.getItem('loginTips')
           const loginTips = localStorage.getItem('loginTips')
 
 
           if (res.remindchangepassword == 1) {
           if (res.remindchangepassword == 1) {
             Modal.confirm({
             Modal.confirm({
-              centered:true,
-              zIndex:9999,
+              centered: true,
+              zIndex: 9999,
               title: '提醒',
               title: '提醒',
               icon: createVNode(ExclamationCircleOutlined),
               icon: createVNode(ExclamationCircleOutlined),
               content: res.remindchangepassword_str,
               content: res.remindchangepassword_str,
               okText: '确定',
               okText: '确定',
               onOk: () => {
               onOk: () => {
                 sessionStorage.setItem('openPasDialog', '1')
                 sessionStorage.setItem('openPasDialog', '1')
-                router.replace({ name: 'landing'});
+                router.replace({ name: 'landing' });
               }
               }
             });
             });
           } else {
           } else {
-            router.replace({ name: 'landing'});
+            router.replace({ name: 'landing' });
           }
           }
         })
         })
       } else {
       } else {
@@ -157,46 +128,74 @@ export default defineComponent({
         message.error(res.msg)
         message.error(res.msg)
       }
       }
     }
     }
-    const login = async ()=>{
+    const login = async () => {
       loading.value = true
       loading.value = true
       const res = await Api.loginbyaccount({
       const res = await Api.loginbyaccount({
-        "accountno":formState.phonenumber,
-        "password":md5(formState.password),  
+        "accountno": formState.phonenumber,
+        "password": md5(formState.password),
         "systemclient": "web"
         "systemclient": "web"
       })
       })
 
 
       checkAccountList(res)
       checkAccountList(res)
     };
     };
-    const countDown = async ()=> {
+    const countDown = async () => {
       if (!formState.phonenumber) return message.error('请输入手机号!')
       if (!formState.phonenumber) return message.error('请输入手机号!')
       if (count.value > 0) return false
       if (count.value > 0) return false
       await loginCode()
       await loginCode()
       count.value = 60
       count.value = 60
-      var down = setInterval(()=>{
-        count.value --
-        count.value === 0? clearInterval(down):''
-      },1000)
+      var down = setInterval(() => {
+        count.value--
+        count.value === 0 ? clearInterval(down) : ''
+      }, 1000)
     };
     };
-    const loginCode = async ()=> {
+    const loginCode = async () => {
       const res = await Api.loginCode({
       const res = await Api.loginCode({
-        "phonenumber":formState.phonenumber,
+        "phonenumber": formState.phonenumber,
         "systemclient": "web"
         "systemclient": "web"
       })
       })
-      res.code == 1?'':message.error(res.msg)
+      res.code == 1 ? '' : message.error(res.msg)
     };
     };
-    const loginByCode = async ()=>{
+    const loginByCode = async () => {
       loading.value = true
       loading.value = true
       const res = await Api.login({
       const res = await Api.login({
-        "phonenumber":formState.phonenumber,
-        "password":md5(formState.password),  
+        "phonenumber": formState.phonenumber,
+        "password": md5(formState.password),
         "systemclient": "web"
         "systemclient": "web"
       })
       })
       checkAccountList(res)
       checkAccountList(res)
     }
     }
-    const tabsChange = ()=>{
+    const tabsChange = () => {
       formState.phonenumber = null,
       formState.phonenumber = null,
-      formState.password = null
+        formState.password = null
+    }
+    const getRouteParams = () => {
+      const cur = router.currentRoute.value || {};
+      const query = cur.query || {};
+      let accesstoken = query.accesstoken || '';
+      let username = query.username || '';
+
+      if (!accesstoken || !username) {
+        const hash = window.location.hash || '';
+        const qIndex = hash.indexOf('?');
+        if (qIndex !== -1) {
+          const queryString = hash.slice(qIndex + 1);
+          // 规范化:将额外的 '?' 替换为 '&',以兼容错误格式
+          const normalized = queryString.replace(/\?/g, '&');
+          const params = new URLSearchParams(normalized);
+          accesstoken = accesstoken || params.get('accesstoken') || '';
+          username = username || params.get('username') || '';
+        }
+      }
+      return { accesstoken, username };
+    };
+    const ssoLogin = async () => {
+      const { accesstoken, username } = getRouteParams();
+      console.log(accesstoken, username)
+      if (!accesstoken || !username) return
+      const res = await Api.ssologin({ "accountno": username, "password": accesstoken, "systemclient": "web" })
+      checkAccountList(res)
     }
     }
+    ssoLogin()
     return {
     return {
       formState,
       formState,
       onFinish,
       onFinish,
@@ -209,7 +208,7 @@ export default defineComponent({
       tabsChange
       tabsChange
     };
     };
   },
   },
-  mounted () {
+  mounted() {
     sessionStorage.clear()
     sessionStorage.clear()
     localStorage.clear();
     localStorage.clear();
     historyRoutes.value = []
     historyRoutes.value = []
@@ -217,82 +216,96 @@ export default defineComponent({
 });
 });
 </script>
 </script>
 <style>
 <style>
-.login-form .ant-form-item .ant-form-item-label >label,.login-form .ant-checkbox-wrapper {
-  color:#fff
+.login-form .ant-form-item .ant-form-item-label>label,
+.login-form .ant-checkbox-wrapper {
+  color: #fff
 }
 }
+
 .login-form .ant-tabs {
 .login-form .ant-tabs {
-  color:#fff !important;
+  color: #fff !important;
 }
 }
 </style>
 </style>
 <style scoped>
 <style scoped>
-.conatiner{
+.conatiner {
   background: url('@/assets/bg.jpg');
   background: url('@/assets/bg.jpg');
   background-size: cover;
   background-size: cover;
 }
 }
-.title{
+
+.title {
   height: 33px;
   height: 33px;
   margin: 0 0 30px;
   margin: 0 0 30px;
   font-size: 1.25rem;
   font-size: 1.25rem;
   font-weight: 600;
   font-weight: 600;
-  animation: showup 3s forwards ;
+  animation: showup 3s forwards;
 }
 }
-.login-wrap{
+
+.login-wrap {
   overflow: hidden;
   overflow: hidden;
 }
 }
-.login-wrap .top{
-  width:100%;
+
+.login-wrap .top {
+  width: 100%;
   /* background:#f3f4f591 */
   /* background:#f3f4f591 */
 }
 }
-.login-wrap .top{
-  height:calc(100vh - 70px);
-  width:100%;
+
+.login-wrap .top {
+  height: calc(100vh - 70px);
+  width: 100%;
 }
 }
-.login-wrap svg{
+
+.login-wrap svg {
   height: 70%;
   height: 70%;
 }
 }
-.login-form{
+
+.login-form {
   position: absolute;
   position: absolute;
   right: 50%;
   right: 50%;
-  top:50vh;
+  top: 50vh;
   width: 500px;
   width: 500px;
   margin-right: -250px;
   margin-right: -250px;
   margin-top: -244px;
   margin-top: -244px;
   padding: 30px;
   padding: 30px;
-  background-color: rgba(0,0,0,.2);
+  background-color: rgba(0, 0, 0, .2);
   border-radius: 5px;
   border-radius: 5px;
-  box-shadow: 2px 8px 8px 0 rgba(0,0,0,.2);
-  color:#fff;
+  box-shadow: 2px 8px 8px 0 rgba(0, 0, 0, .2);
+  color: #fff;
   z-index: 9999;
   z-index: 9999;
 }
 }
-.input-wrap{
+
+.input-wrap {
   width: 100%;
   width: 100%;
 }
 }
-.color-info{
-  font-weight:300
+
+.color-info {
+  font-weight: 300
 }
 }
+
 .footer {
 .footer {
-  height:70px;
-  line-height:70px;
+  height: 70px;
+  line-height: 70px;
   font-size: 14px;
   font-size: 14px;
   text-align: center;
   text-align: center;
   /* background:#1677ff; */
   /* background:#1677ff; */
-  color:#fff !important;
-  
+  color: #fff !important;
+
 }
 }
+
 @keyframes typingH {
 @keyframes typingH {
   0% {
   0% {
     height: 0px;
     height: 0px;
   }
   }
+
   100% {
   100% {
     height: 300px;
     height: 300px;
   }
   }
 }
 }
 
 
 @media(max-width: 1600px) {
 @media(max-width: 1600px) {
-  .login-form{
+  .login-form {
     transform: scale(.8);
     transform: scale(.8);
   }
   }
-  .introduce{
+
+  .introduce {
     font-size: 15px;
     font-size: 15px;
   }
   }
 }
 }