|
@@ -19,6 +19,18 @@ const whiteList = ['/pages/login/index','/pages/login/register']
|
|
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
// tools.showLoading()
|
|
// tools.showLoading()
|
|
|
|
|
+ console.log(to)
|
|
|
|
|
+ console.log(from)
|
|
|
|
|
+ if(to.path==='/pages/login/index'){
|
|
|
|
|
+ uni.setStorageSync('pageFullPath',from.fullPath)
|
|
|
|
|
+ }else if(from.path==='/pages/login/index'){
|
|
|
|
|
+ let oldFullPath= uni.getStorageSync('pageFullPath')
|
|
|
|
|
+ if(oldFullPath){
|
|
|
|
|
+ uni.setStorageSync('pageFullPath','')
|
|
|
|
|
+ next(oldFullPath);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let userToken=''
|
|
let userToken=''
|
|
|
if (to.query.token ) {
|
|
if (to.query.token ) {
|
|
|
userToken = to.query.token;
|
|
userToken = to.query.token;
|
|
@@ -33,7 +45,8 @@ router.beforeEach(async (to, from, next) => {
|
|
|
await tools.weiXinLogin().then(isLogin=>{
|
|
await tools.weiXinLogin().then(isLogin=>{
|
|
|
console.log('-----------isLogin-----------')
|
|
console.log('-----------isLogin-----------')
|
|
|
if(isLogin){
|
|
if(isLogin){
|
|
|
- next();
|
|
|
|
|
|
|
+ // next();
|
|
|
|
|
+ next('/pages/login/index');
|
|
|
}else {
|
|
}else {
|
|
|
next('/pages/login/index');
|
|
next('/pages/login/index');
|
|
|
}
|
|
}
|