mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
fix: 【登录没有权限】 没有提示,且console 报错
This commit is contained in:
parent
7a29c1931f
commit
38a38e546f
@ -83,7 +83,7 @@ export async function initBackEndControlRoutes() {
|
|||||||
const res = await getBackEndControlRoutes();
|
const res = await getBackEndControlRoutes();
|
||||||
// 无登录权限时,添加判断
|
// 无登录权限时,添加判断
|
||||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I64HVO
|
// 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),根据需求选择使用
|
// 存储接口原始路由(未处理component),根据需求选择使用
|
||||||
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
||||||
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
|
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
|
||||||
|
@ -43,7 +43,7 @@ export async function initBackEndControlRoutes() {
|
|||||||
const res = await getBackEndControlRoutes();
|
const res = await getBackEndControlRoutes();
|
||||||
// 无登录权限时,添加判断
|
// 无登录权限时,添加判断
|
||||||
// https://gitee.com/lyt-top/vue-next-admin/issues/I64HVO
|
// 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),根据需求选择使用
|
// 存储接口原始路由(未处理component),根据需求选择使用
|
||||||
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
|
||||||
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
|
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
|
||||||
|
@ -140,6 +140,10 @@ const dictType = ref([
|
|||||||
label: '本级',
|
label: '本级',
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '本人',
|
||||||
|
value: 4,
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -91,7 +91,7 @@ const handleLogin = async () => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
emit('signInSuccess');
|
emit('signInSuccess');
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -101,7 +101,7 @@ const onSignIn = () => {
|
|||||||
// 登录后前端页面跳转
|
// 登录后前端页面跳转
|
||||||
emit('signInSuccess');
|
emit('signInSuccess');
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user