修改手动绑定结构,,调整用户最新信息

This commit is contained in:
2024-03-29 10:02:14 +08:00
parent c9abd2cfa0
commit 567133455c
11 changed files with 64 additions and 13 deletions

View File

@@ -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({