From 38a38e546fed6884ca48e0b0829d0d55cd7dfa5a Mon Sep 17 00:00:00 2001 From: lbw Date: Mon, 6 Mar 2023 12:45:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E7=99=BB=E5=BD=95=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=9D=83=E9=99=90=E3=80=91=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=B8=94console=20=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/router.md | 2 +- src/router/backEnd.ts | 2 +- src/views/admin/role/form.vue | 4 ++++ src/views/login/component/mobile.vue | 2 +- src/views/login/component/password.vue | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/router.md b/doc/router.md index 9b9edb35..d9ea5224 100644 --- a/doc/router.md +++ b/doc/router.md @@ -83,7 +83,7 @@ export async function initBackEndControlRoutes() { const res = await getBackEndControlRoutes(); // 无登录权限时,添加判断 // https://gitee.com/lyt-top/vue-next-admin/issues/I64HVO - if (res.data.length <= 0) return Promise.resolve(true); + if ((res.data || []).length <= 0) return Promise.resolve(true); // 存储接口原始路由(未处理component),根据需求选择使用 useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data))); // 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由 diff --git a/src/router/backEnd.ts b/src/router/backEnd.ts index b183aca5..8c97ae5a 100644 --- a/src/router/backEnd.ts +++ b/src/router/backEnd.ts @@ -43,7 +43,7 @@ export async function initBackEndControlRoutes() { const res = await getBackEndControlRoutes(); // 无登录权限时,添加判断 // https://gitee.com/lyt-top/vue-next-admin/issues/I64HVO - if (res.data.length <= 0) return Promise.resolve(true); + if ((res.data || []).length <= 0) return Promise.resolve(true); // 存储接口原始路由(未处理component),根据需求选择使用 useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data))); // 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由 diff --git a/src/views/admin/role/form.vue b/src/views/admin/role/form.vue index 4405da28..58719b72 100644 --- a/src/views/admin/role/form.vue +++ b/src/views/admin/role/form.vue @@ -140,6 +140,10 @@ const dictType = ref([ label: '本级', value: 3, }, + { + label: '本人', + value: 4, + }, ]); // 打开弹窗 diff --git a/src/views/login/component/mobile.vue b/src/views/login/component/mobile.vue index a9483a2e..5ef83fbe 100644 --- a/src/views/login/component/mobile.vue +++ b/src/views/login/component/mobile.vue @@ -91,7 +91,7 @@ const handleLogin = async () => { .then(() => { emit('signInSuccess'); }) - .catch(() => { + .finally(() => { loading.value = false; }); }; diff --git a/src/views/login/component/password.vue b/src/views/login/component/password.vue index 127bc952..d55c6636 100644 --- a/src/views/login/component/password.vue +++ b/src/views/login/component/password.vue @@ -101,7 +101,7 @@ const onSignIn = () => { // 登录后前端页面跳转 emit('signInSuccess'); }) - .catch(() => { + .finally(() => { loading.value = false; }); };