Commit 544fb891 by cocomilk2012

update

parent c43100af
Showing with 5 additions and 2 deletions
......@@ -98,7 +98,7 @@ function getPathByTo(to, authcode_key) {
router.beforeEach((to, from, next) => {
console.log('开始路由');
if (isOpenHttps === 'true' && location.href.startsWith('http://')) {
location.href = location.href.replace('http://', 'https://');
}
......@@ -112,7 +112,6 @@ router.beforeEach((to, from, next) => {
console.log('authcode=', authcode);
if (!!authcode) {
getAccessToken(authcode)
.then((res) => {
......@@ -121,12 +120,16 @@ router.beforeEach((to, from, next) => {
//@ts-ignore
const accessToken: string = res;
localStorage.setItem('token', accessToken);
console.log('redirectPath=', redirectPath);
window.location.href = redirectPath;
})
.catch((err) => {
console.log('err=', err);
});
} else {
console.log('to.path=', to.path);
next();
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment