Skip to content

Commit

Permalink
fix: 🐛 miniprogram authlogin add redirecturl param
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingyun2010 committed Aug 20, 2021
1 parent 3b11c8e commit 45400c8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const initToken = async (ignore?: () => boolean) => {
at.user.getToken().then(t => {
if (t) {
setToken(t);
resolve();
resolve(void 0);
} else {
clearToken();
reject(new Error('token is empty'));
Expand All @@ -93,7 +93,7 @@ const initToken = async (ignore?: () => boolean) => {

if (token && String(token).length > 20) {
setToken(token);
resolve();
resolve(void 0);
} else {
clearToken();
reject(new Error('token is empty'));
Expand All @@ -111,6 +111,7 @@ interface ItoLogin {
success?: () => void;
cancel?: () => void;
isBind?: boolean;
redirectUrl?: string;
}

const toLogin = (appParams?: ItoLogin) => {
Expand All @@ -127,7 +128,7 @@ const toLogin = (appParams?: ItoLogin) => {
}
});
} else if (window.isMiniProgram) {
Mini.authLogin();
Mini.authLogin(appParams && appParams.redirectUrl);
} else {
window.location.href = `/m/login/?${qs.stringify({
redirect: window.location.href,
Expand Down

0 comments on commit 45400c8

Please sign in to comment.