|
@@ -58,7 +58,8 @@ Page({
|
|
else res = await app.$api('user', 'POST', parmas);
|
|
else res = await app.$api('user', 'POST', parmas);
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
wx.showToast({ title: `信息提交成功`, icon: 'success' });
|
|
wx.showToast({ title: `信息提交成功`, icon: 'success' });
|
|
- wx.setStorage({ key: "user", data: res.data })// 存用户信息到storage,以便之后判断用户是否登录
|
|
|
|
|
|
+ const user = await app.$api(`user/${form._id}`, 'get', {});
|
|
|
|
+ if (user.errcode == '0') wx.setStorage({ key: "user", data: user.data })// 存用户信息到storage,以便之后判断用户是否登录
|
|
wx.navigateBack({ delta: 1 });
|
|
wx.navigateBack({ delta: 1 });
|
|
} else {
|
|
} else {
|
|
wx.showToast({ title: `${res.errmsg}`, icon: 'none' });
|
|
wx.showToast({ title: `${res.errmsg}`, icon: 'none' });
|