Commit d3e30bd6 by yuzhenWang

Merge branch 'feature-20250609-优化cffp' into 'master'

修复没有登录状态

See merge request !11
parents c4e19de9 efcdf574
......@@ -133,6 +133,7 @@
uni.setStorageSync('uni-token', res.data['data']['token']);
uni.setStorageSync('cffp_userId', options.userId);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('loginType','codelogin')
uni.setStorageSync('isH5', 1);
this.courseList()
}
......
......@@ -14,6 +14,13 @@ export default function initApp(){
uni.addInterceptor('navigateTo', {
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke (e) {
if(!uni.getStorageSync('loginType')){
uni.clearStorageSync();
uni.setStorageSync('loginType','visitor')
uni.redirectTo({
url: '/components/login/login'
})
}
if(uni.getStorageSync('cffp_userId')){
api.queryInfo({userId:uni.getStorageSync('cffp_userId')}).then(res=>{
if(!res['success']){
......
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 to comment