From ecbc81c918a288dc752b1634b3f545f795d992aa Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 20 三月 2024 16:15:41 +0800 Subject: [PATCH] 图书分类,图书列表样式修改,答题器优化 --- pages/testLogin/index.js | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/pages/testLogin/index.js b/pages/testLogin/index.js index e402ac9..fdcb3c4 100644 --- a/pages/testLogin/index.js +++ b/pages/testLogin/index.js @@ -7,7 +7,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { - textName: "18892081234", + textName: "15111111116", textPassword: "xA123456", loading: false, userInfo: { @@ -40,6 +40,9 @@ icon: "error", duration: 2000 }) + this.setData({ + loading: false + }) } }); }, @@ -52,16 +55,26 @@ if (res) { console.log(res, "user"); let defaultUser = {}; + let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') + let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); - if (WeChatInfo) { + if (teacherRole && teacherInfos) { + defaultUser = { + ...teacherInfos, + nickName: teacherInfos.fullName, + avatarUrl: teacherInfos.icon, + userId: res.userId, + role: 'Teacher', + roleId: teacherRole.role.id + } + } else if (WeChatInfo) { defaultUser = { nickName: WeChatInfo.name, avatarUrl: WeChatInfo.icon, - userId: res.userId + userId: res.userId, } - } - if (secretData) { + } else if (secretData) { defaultUser = { nickName: secretData.credential, avatarUrl: "../../static/images/index/tab.png", @@ -85,7 +98,7 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - + console.log(options); }, /** -- Gitblit v1.9.1