大修改
This commit is contained in:
1 parent
a1cbc9404a
commit
e81481623c
47 files changed
+1453
-285
No files matched your search
@@ -34,27 +34,32 @@ Page({
|
||||
},
|
||||
|
||||
applyConfig() {
|
||||
const qrcodeName = store.cfg('profile.qrcode_image', '');
|
||||
const qrcodeName = store.cfg('profile.qrcode_image');
|
||||
this.setData({
|
||||
version: store.cfg('site.version', 'V0.0.9'),
|
||||
text2: store.cfg('profile.menu.change_info', '修改资料'),
|
||||
text3: store.cfg('profile.menu.share', '好友分享'),
|
||||
text4: store.cfg('profile.menu.contact', '在线沟通'),
|
||||
text5: store.cfg('profile.menu.wechat', '添加微信:叶雷讲数学'),
|
||||
text6: store.cfg('profile.qrcode_caption', '长按识别二维码'),
|
||||
version: store.cfg('site.version'),
|
||||
text2: store.cfg('profile.menu.change_info'),
|
||||
text3: store.cfg('profile.menu.share'),
|
||||
text4: store.cfg('profile.menu.contact'),
|
||||
text5: store.cfg('profile.menu.wechat'),
|
||||
text6: store.cfg('profile.qrcode_caption'),
|
||||
qrcodeUrl: qrcodeName ? config.STATIC_BASE_URL + '/Images/WXCode/' + qrcodeName + '.png' : '',
|
||||
});
|
||||
},
|
||||
|
||||
applyUser() {
|
||||
const user = store.getUser();
|
||||
// 已登录 = 有 token 且设置过昵称;未设置昵称的仍是游客,与旧版语义一致
|
||||
const registered = !!(user && user.nickname);
|
||||
// 「已登录」看的是用户主动登录过没有(服务端记着这一位),不是有没有 token
|
||||
const registered = !!(user && user.isLogin === 1);
|
||||
this.setData({
|
||||
isLoggedIn: registered,
|
||||
userNameText: registered ? user.nickname : '未登录',
|
||||
loginBtnText: registered ? '退出登录' : '登录注册',
|
||||
headiconUrl: user && user.headiconUrl ? user.headiconUrl : config.STATIC_BASE_URL + config.PLACEHOLDER.USER,
|
||||
// 未登录一律用默认头像:静默登录仍会带回上次设置的头像,
|
||||
// 不挡住的话退出登录后还会显示用户自己的头像。
|
||||
headiconUrl:
|
||||
registered && user.headiconUrl
|
||||
? user.headiconUrl
|
||||
: config.STATIC_BASE_URL + config.PLACEHOLDER.USER,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user