zs 2 years ago
parent
commit
9dcc59b431
1 changed files with 2 additions and 0 deletions
  1. 2 0
      pagesMy/home/index.js

+ 2 - 0
pagesMy/home/index.js

@@ -59,6 +59,8 @@ Page({
             let icon = [{ id: res.id, name: res.name, uri: res.uri, url: `${app.globalData.fileserverUrl}` + res.uri }]
             let arr = await app.$api(`user/${that.data.user._id}`, 'POST', { icon: icon });
             if (arr.errcode == '0') {
+                const user = await app.$api(`user/${that.data.user._id}`, 'get', {});
+                if (user.errcode == '0') wx.setStorage({ key: "user", data: user.data })// 存用户信息到storage,以便之后判断用户是否登录
                 wx.showToast({ title: `头像上传成功`, icon: 'success' });
                 that.search()
             } else {