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:'请正确填写地址,以/开头'}, ]" >