fix(projects): fix login redirect
This commit is contained in:
parent
ef6cf93d96
commit
3830ec7a69
@ -93,11 +93,15 @@ export function useRouterPush(inSetup = true) {
|
|||||||
return routerPushByKey('login', { query, params: { module } });
|
return routerPushByKey('login', { query, params: { module } });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Redirect from login */
|
/**
|
||||||
async function redirectFromLogin() {
|
* Redirect from login
|
||||||
|
*
|
||||||
|
* @param [needRedirect=true] Whether to redirect after login. Default is `true`
|
||||||
|
*/
|
||||||
|
async function redirectFromLogin(needRedirect = true) {
|
||||||
const redirect = route.value.query?.redirect as string;
|
const redirect = route.value.query?.redirect as string;
|
||||||
|
|
||||||
if (redirect) {
|
if (needRedirect && redirect) {
|
||||||
routerPush(redirect);
|
routerPush(redirect);
|
||||||
} else {
|
} else {
|
||||||
toHome();
|
toHome();
|
||||||
|
@ -71,9 +71,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
if (pass) {
|
if (pass) {
|
||||||
await routeStore.initAuthRoute();
|
await routeStore.initAuthRoute();
|
||||||
|
|
||||||
if (redirect) {
|
await redirectFromLogin(redirect);
|
||||||
await redirectFromLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (routeStore.isInitAuthRoute) {
|
if (routeStore.isInitAuthRoute) {
|
||||||
window.$notification?.success({
|
window.$notification?.success({
|
||||||
|
Loading…
Reference in New Issue
Block a user