From 7724e7939fa5ce1bd9d66053836a8d4c75f7baad Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 9 Jul 2024 17:42:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E7=99=BB=E9=99=86=E8=B0=83=E8=AF=95=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/locale/en-US/common.ts | 1 + frontend/src/locale/zh-CN/common.ts | 1 + frontend/src/store/modules/user/index.ts | 9 +++++++-- .../src/views/login/components/login-form.vue | 16 ++++++++-------- .../system/config/components/authConfig.vue | 8 ++++---- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/frontend/src/locale/en-US/common.ts b/frontend/src/locale/en-US/common.ts index a3b9ef9e15..e47dfa328c 100644 --- a/frontend/src/locale/en-US/common.ts +++ b/frontend/src/locale/en-US/common.ts @@ -198,4 +198,5 @@ export default { 'common.advancedSettings': 'Advanced settings', 'common.auth_redirect_tip': 'You will be redirected to the certification source page for certification', 'common.default': 'Default', + 'common.jump': 'Jump', }; diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index 75df08f1b4..665163f40a 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -197,4 +197,5 @@ export default { 'common.advancedSettings': '高级设置', 'common.auth_redirect_tip': '即将跳转至认证源页面进行认证', 'common.default': '默认', + 'common.jump': '跳转', }; diff --git a/frontend/src/store/modules/user/index.ts b/frontend/src/store/modules/user/index.ts index f459c0053d..33f405226e 100644 --- a/frontend/src/store/modules/user/index.ts +++ b/frontend/src/store/modules/user/index.ts @@ -21,6 +21,7 @@ import { removeRouteListener } from '@/utils/route-listener'; import type { LoginData } from '@/models/user'; import { LoginRes } from '@/models/user'; +import { ProjectManagementRouteEnum } from '@/enums/routeEnum'; import useAppStore from '../app'; import { UserState } from './types'; @@ -240,7 +241,9 @@ const useUserStore = defineStore('user', { const { isLoginPage } = useUser(); if (isLoginPage()) { // 当前页面为登录页面,且已经登录,跳转到首页 - const currentRouteName = getFirstRouteNameByPermission(router.getRoutes()); + const currentRouteName = router.getRoutes() + ? getFirstRouteNameByPermission(router.getRoutes()) + : ProjectManagementRouteEnum.PROJECT_MANAGEMENT_PERMISSION_BASIC_INFO; router.push({ name: currentRouteName }); } }, @@ -305,7 +308,9 @@ const useUserStore = defineStore('user', { } if (isLoginPage() && isLogin) { // 当前页面为登录页面,且已经登录,跳转到首页 - const currentRouteName = getFirstRouteNameByPermission(router.getRoutes()); + const currentRouteName = router.getRoutes() + ? getFirstRouteNameByPermission(router.getRoutes()) + : ProjectManagementRouteEnum.PROJECT_MANAGEMENT_PERMISSION_BASIC_INFO; router.push({ name: currentRouteName }); } }, diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 2450e7b687..eae6e9da31 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -118,13 +118,12 @@ import { useRouter } from 'vue-router'; import { useStorage } from '@vueuse/core'; import { Message, SelectOptionData } from '@arco-design/web-vue'; - import { partial } from 'lodash-es'; import TabQrCode from '@/views/login/components/tabQrCode.vue'; import { getProjectInfo } from '@/api/modules/project-management/basicInfo'; - import { getAuthDetail, getAuthDetailByType } from '@/api/modules/setting/config'; - import { getPlatformParamUrl, isLogin as userIsLogin } from '@/api/modules/user'; + import { getAuthDetailByType } from '@/api/modules/setting/config'; + import { getPlatformParamUrl } from '@/api/modules/user'; import { GetLoginLogoUrl } from '@/api/requrls/setting/config'; import { useI18n } from '@/hooks/useI18n'; import useLoading from '@/hooks/useLoading'; @@ -132,13 +131,12 @@ import { NO_PROJECT_ROUTE_NAME, NO_RESOURCE_ROUTE_NAME } from '@/router/constants'; import { useAppStore, useUserStore } from '@/store'; import useLicenseStore from '@/store/modules/setting/license'; - import { UserState } from '@/store/modules/user/types'; import { encrypted } from '@/utils'; import { setLoginExpires, setToken } from '@/utils/auth'; import { getFirstRouteNameByPermission, routerNameHasPermission } from '@/utils/permission'; import type { LoginData } from '@/models/user'; - import { ProjectManagementRouteEnum, SettingRouteEnum } from '@/enums/routeEnum'; + import { SettingRouteEnum } from '@/enums/routeEnum'; import { ValidatedError } from '@arco-design/web-vue/es/form/interface'; @@ -320,13 +318,15 @@ const authId = res.id; openModal({ type: 'info', - content: t('common.auth_redirect_tip'), - okText: t('common.confirm'), + title: t('common.auth_redirect_tip'), + content: '', + okText: t('common.jump'), cancelText: t('common.cancel'), okButtonProps: { status: 'normal', }, - closable: false, + mask: true, + maskStyle: { color: '#323233' }, onBeforeOk: async () => { const config = JSON.parse(res.configuration); // eslint-disable-next-line no-eval diff --git a/frontend/src/views/setting/system/config/components/authConfig.vue b/frontend/src/views/setting/system/config/components/authConfig.vue index 0fcb76ec4b..c628d58b09 100644 --- a/frontend/src/views/setting/system/config/components/authConfig.vue +++ b/frontend/src/views/setting/system/config/components/authConfig.vue @@ -270,12 +270,12 @@ :rules="[{ required: true, message: t('system.config.auth.clientSecretRequired') }]" required > - + > - + >