fix: oauth登录菜单会折叠一次(二次路由跳转导致)
- 修复oauth登录后 菜单会折叠一次(函数和finally都执行了路由跳转) - 加载中Spin效果
This commit is contained in:
parent
0c081031c2
commit
02de029e6f
@ -4,8 +4,7 @@ import type { AuthApi } from '#/api';
|
||||
import { onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import { DEFAULT_TENANT_ID } from '@vben/constants';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { DEFAULT_TENANT_ID, LOGIN_PATH } from '@vben/constants';
|
||||
import { useAccessStore } from '@vben/stores';
|
||||
import { cn } from '@vben/utils';
|
||||
|
||||
@ -64,15 +63,15 @@ onMounted(async () => {
|
||||
await authCallback(data);
|
||||
message.success(`${source}授权成功`);
|
||||
} else {
|
||||
// todo
|
||||
// 这里内部已经做了跳转到首页的操作
|
||||
await authStore.authLogin(data as any);
|
||||
message.success(`${source}登录成功`);
|
||||
}
|
||||
} catch {
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
// 500 你还没有绑定第三方账号,绑定后才可以登录!
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
router.push(preferences.app.defaultHomePath);
|
||||
router.push(LOGIN_PATH);
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user