From 266aaa312aa40022ba5aa6603d48c1a02811cf8c Mon Sep 17 00:00:00 2001 From: qsh <> Date: Fri, 16 May 2025 10:50:53 +0800 Subject: [PATCH] sc --- src/api/platform/index.js | 6 ++ src/config/axios/service.ts | 12 +-- .../components/UserInfo/src/UserInfo.vue | 8 +- src/permission.js | 18 ++-- src/views/Home/index.vue | 85 ++++++++++++++++++- src/views/Login/components/LoginForm.vue | 8 ++ src/views/Profile/components/ProfileUser.vue | 2 +- 7 files changed, 116 insertions(+), 23 deletions(-) create mode 100644 src/api/platform/index.js diff --git a/src/api/platform/index.js b/src/api/platform/index.js new file mode 100644 index 0000000..2da28a9 --- /dev/null +++ b/src/api/platform/index.js @@ -0,0 +1,6 @@ +import request from '@/config/axios' + +// 查询应用列表 +export const getAppList = (params) => { + return request.get({ url: '/admin-api/system/auth/get-user-client', params }) +} diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 620be60..99a1087 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -213,12 +213,12 @@ service.interceptors.response.use( type: 'warning' }).then(() => { // 无访问权限,退出登录 - const tenantId = cache.local.get('TENANT_ID') - const appId = cache.local.get('App_ID') + // const tenantId = cache.local.get('TENANT_ID') + // const appId = cache.local.get('App_ID') resetRouter() // 重置静态路由表 cache.local.clear() removeToken() - window.location.href = `/login?tenantId=${tenantId}&appId=${appId}` + window.location.href = `/login` }) } } @@ -258,15 +258,15 @@ const handleAuthorized = () => { confirmButtonText: t('login.relogin'), type: 'warning' }).then(() => { - const tenantId = cache.local.get('TENANT_ID') - const appId = cache.local.get('App_ID') + // const tenantId = cache.local.get('TENANT_ID') + // const appId = cache.local.get('App_ID') resetRouter() // 重置静态路由表 cache.local.clear() removeToken() isRelogin.show = false // 干掉token后再走一次路由让它过router.beforeEach的校验 // window.location.href = window.location.href - window.location.href = `/login?tenantId=${tenantId}&appId=${appId}` + window.location.href = `/login` }) } return Promise.reject(t('sys.api.timeoutMessage')) diff --git a/src/layout/components/UserInfo/src/UserInfo.vue b/src/layout/components/UserInfo/src/UserInfo.vue index a6f049b..b2172ac 100644 --- a/src/layout/components/UserInfo/src/UserInfo.vue +++ b/src/layout/components/UserInfo/src/UserInfo.vue @@ -6,7 +6,7 @@ import { useDesign } from '@/hooks/web/useDesign' import avatarImg from '@/assets/imgs/avatar.gif' import { useUserStore } from '@/store/modules/user' import { useTagsViewStore } from '@/store/modules/tagsView' -import { getTenantId, getAppId } from '@/utils/auth' +// import { getTenantId, getAppId } from '@/utils/auth' import { Setting } from '@/layout/components/Setting' import cache from '@/plugins/cache' @@ -36,11 +36,11 @@ const loginOut = () => { type: 'warning' }) .then(async () => { - const tenantId = getTenantId() - const appId = getAppId() + // const tenantId = getTenantId() + // const appId = getAppId() await userStore.loginOut() tagsViewStore.delAllViews() - replace(`/login?tenantId=${tenantId}&appId=${appId}`) + replace(`/login`) }) .catch(() => {}) } diff --git a/src/permission.js b/src/permission.js index 9192a5f..228bf79 100644 --- a/src/permission.js +++ b/src/permission.js @@ -7,7 +7,7 @@ import { usePageLoading } from '@/hooks/web/usePageLoading' import { useDictStoreWithOut } from '@/store/modules/dict' import { useUserStoreWithOut } from '@/store/modules/user' import { usePermissionStoreWithOut } from '@/store/modules/permission' -import { getTenantId, getAppId } from '@/utils/auth' +import { getAppId } from '@/utils/auth' import cache from '@/plugins/cache' const { start, done } = useNProgress() @@ -26,7 +26,7 @@ router.beforeEach(async (to, from, next) => { cache?.local?.delete('roleRouters') cache?.local?.delete('user') cache?.local?.delete('App_ID') - next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`) + next(`/login`) } else { if (getAccessToken()) { if (to.path === '/login') { @@ -60,13 +60,13 @@ router.beforeEach(async (to, from, next) => { if (whiteList.indexOf(to.path) !== -1) { next() } else { - const tenantId = getTenantId() - const appId = getAppId() - if (tenantId && appId) { - next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页 - } else { - next(`/oa/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 - } + // const tenantId = getTenantId() + // const appId = getAppId() + // if (tenantId && appId) { + // next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页 + // } else { + next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + // } } } } diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index 7beecf8..faeeacd 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -1,7 +1,86 @@ - + + + +.cutout-text { + position: relative; + font-size: 40px; + font-weight: bold; + -webkit-text-stroke: 1px #9a9acc; + color: #001529; + &::before { + content: ' '; + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + background-image: linear-gradient(45deg, #ff269b, #2ab5f5, #ffbf00); + mix-blend-mode: multiply; + } + &::after { + content: ''; + position: absolute; + left: -75%; + top: 0; + width: 200%; + height: 100%; + background: radial-gradient(circle, #fff, #000 50%); + background-size: 25% 30%; + mix-blend-mode: color-dodge; + animation: mix 4s linear infinite; + background-repeat: repeat; + } +} +@keyframes mix { + to { + transform: translateX(25%); + } +} + diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 3307ab8..d616811 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -193,6 +193,14 @@ const handleLogin = async (params) => { if (!res) { return } + + if (res?.instanceId) { + authUtil.setAppId(res.instanceId) + } + if (res?.tenantId) { + authUtil.setTenantId(res.tenantId) + } + ElLoading.service({ lock: true, text: '正在加载系统中...', diff --git a/src/views/Profile/components/ProfileUser.vue b/src/views/Profile/components/ProfileUser.vue index aacd064..188f7e2 100644 --- a/src/views/Profile/components/ProfileUser.vue +++ b/src/views/Profile/components/ProfileUser.vue @@ -7,7 +7,7 @@
  • {{ t('profile.user.username') }} -
    {{ userInfo?.username }}
    +
    {{ userInfo?.nickname }}