提交首页修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { getPrivaciList, login } from "../../service/user";
|
||||
import { alertError, alertInfo, alertSuccess, loadingFunc, wxLogin } from "../../utils/index";
|
||||
import request from "../../utils/request";
|
||||
import { getUserInfo } from "../../service/user"
|
||||
import Dialog from '@vant/weapp/dialog/dialog';
|
||||
const { OK } = request;
|
||||
|
||||
@@ -20,21 +21,29 @@ Page({
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
this.getPrivacy();
|
||||
const user = wx.getStorageSync('user')
|
||||
if (!user || !user.id) {
|
||||
async setUser() {
|
||||
const result = await getUserInfo();
|
||||
if (result.code !== OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setData({ user: result.data })
|
||||
wx.setStorageSync('user', result.data)
|
||||
// const user = wx.getStorageSync('user')
|
||||
// this.setData({ user: user })
|
||||
},
|
||||
onLoad() {
|
||||
this.getPrivacy();
|
||||
this.setUser();
|
||||
// if (user.status === 0 || user.status === 2) {
|
||||
// wx.redirectTo({
|
||||
// url: '/pages/waitApprove/index',
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
wx.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
// wx.switchTab({
|
||||
// url: '/pages/home/index',
|
||||
// })
|
||||
|
||||
},
|
||||
async getPrivacy() {
|
||||
|
Reference in New Issue
Block a user