修改手动绑定结构,,调整用户最新信息
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { alertInfo } from "../../utils/index";
|
||||
import Dialog from '@vant/weapp/dialog/dialog';
|
||||
import { getUserInfo } from "../../service/user";
|
||||
import request from "../../utils/request"
|
||||
const { OK } = request;
|
||||
|
||||
// pages/my/index.js
|
||||
Page({
|
||||
|
||||
@@ -50,7 +54,15 @@ Page({
|
||||
alertInfo("请先登录");
|
||||
return false;
|
||||
}
|
||||
this.setData({ user })
|
||||
this.init()
|
||||
},
|
||||
async init() {
|
||||
const result = await getUserInfo();
|
||||
if (result.code !== OK) {
|
||||
alertInfo(result.message)
|
||||
return;
|
||||
}
|
||||
wx.setStorageSync('user', result.data)
|
||||
},
|
||||
connect() {
|
||||
Dialog.alert({
|
||||
|
Reference in New Issue
Block a user