From 2dbd7e31b6a9c07dfddd7913b5a3dd3ea9af477d Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Thu, 30 Mar 2023 15:39:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug=E8=B7=AF=E7=94=B1=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=20=E5=88=9D=E5=A7=8B=E5=8C=96=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/init-home/index.vue | 14 ++++++++++---- src/views/system/Menu/Detail/BasicInfo.vue | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/views/init-home/index.vue b/src/views/init-home/index.vue index 81dde0a8..c54aa561 100644 --- a/src/views/init-home/index.vue +++ b/src/views/init-home/index.vue @@ -71,6 +71,7 @@ import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable'; import { FILE_UPLOAD } from '@/api/comm'; import { LocalStore } from '@/utils/comm'; import { message } from 'jetlinks-ui-components'; +import { useUserInfo } from '@/store/userInfo'; const basicRef = ref(); const roleRef = ref(); const initDataRef = ref(); @@ -81,6 +82,7 @@ const loading = ref(false); */ const activeKey = ref('1'); const spinning = ref(false); +const userInfo = useUserInfo(); // const action = ref(`${BASE_API_PATH}/file/static`); // const headers = ref({ [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) }); /** @@ -132,12 +134,16 @@ const submitData = async () => { * 判断是否已有配置 */ const judgeInitSet = async () => { - const resp:any = await getInit(); - if(resp.status === 200 && resp.result.length){ + if (userInfo.$state.userInfos.username === 'admin') { + const resp: any = await getInit(); + if (resp.status === 200 && resp.result.length) { + window.location.href = '/'; + } + } else { window.location.href = '/'; } -} -onMounted(()=>{ +}; +onMounted(() => { judgeInitSet(); }); diff --git a/src/views/system/Menu/Detail/BasicInfo.vue b/src/views/system/Menu/Detail/BasicInfo.vue index 4d965770..025a1d92 100644 --- a/src/views/system/Menu/Detail/BasicInfo.vue +++ b/src/views/system/Menu/Detail/BasicInfo.vue @@ -101,6 +101,7 @@ message: '请输入页面地址', }, { max: 128, message: '最多可输入128字符' }, + { pattern: /^\// ,message:'请正确填写地址,以/开头'}, ]" >