|
|
@@ -214,19 +214,14 @@ Component({
|
|
|
*/
|
|
|
async navigateToHome() {
|
|
|
const currentUser = Parse.User.current();
|
|
|
- const isAuth = login.loginNow()
|
|
|
-
|
|
|
- if (!currentUser || !isAuth) {
|
|
|
- console.error('❌ 当前没有登录用户!');
|
|
|
- wx.showToast({
|
|
|
- title: '请先登录',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- // 跳转到登录页
|
|
|
- wx.navigateTo({
|
|
|
- url: 'plugin://fm-plugin/fm-auth'
|
|
|
- });
|
|
|
- return;
|
|
|
+ let userInfo = wx.getStorageSync("userLogin");
|
|
|
+ if (userInfo == '') {
|
|
|
+ // wx.showToast({
|
|
|
+ // title: '请先登录',
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ login.loginNow()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
let token = currentUser.getSessionToken();
|
|
|
@@ -365,20 +360,14 @@ Component({
|
|
|
console.log('===========================================');
|
|
|
|
|
|
const currentUser = Parse.User.current();
|
|
|
- console.log('📱 当前用户:', currentUser);
|
|
|
- const isAuth = login.loginNow()
|
|
|
-
|
|
|
- if (!currentUser || !isAuth) {
|
|
|
- console.error('❌ 当前没有登录用户!');
|
|
|
- wx.showToast({
|
|
|
- title: '请先登录',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- // 跳转到登录页
|
|
|
- wx.navigateTo({
|
|
|
- url: 'plugin://fm-plugin/fm-auth'
|
|
|
- });
|
|
|
- return;
|
|
|
+ let userInfo = wx.getStorageSync("userLogin");
|
|
|
+ if (userInfo == '') {
|
|
|
+ // wx.showToast({
|
|
|
+ // title: '请先登录',
|
|
|
+ // icon: 'none'
|
|
|
+ // });
|
|
|
+ login.loginNow()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
let token = currentUser.getSessionToken();
|