Browse Source

登录失败添加redirect

bill 1 year ago
parent
commit
f80adbb356
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/api/instance.ts

+ 2 - 2
src/api/instance.ts

@@ -25,8 +25,8 @@ export const {
 } = instance
 
 const gotoLogin = () => {
-  // const loginHref = import.meta.env.DEV ? 'http://localhost:5174' : '/'
-  // location.href = loginHref + '?redirect=' + escape(location.href) + '#/login'
+  const loginHref = import.meta.env.DEV ? 'http://localhost:5174' : '/'
+  location.href = loginHref + '?redirect=' + escape(location.href) + '#/login'
 }
 
 addReqErrorHandler(err => {