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