From cb15c57d0ff984f5a100cf25d560fb0a69c00984 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期二, 16 四月 2024 18:21:05 +0800 Subject: [PATCH] 音频bug4 --- pages/testLogin/index.js | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pages/testLogin/index.js b/pages/testLogin/index.js index e402ac9..01c8a86 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,19 +55,29 @@ 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, + icon: teacherInfos.icon, + userId: res.userId, + role: 'Teacher', + roleId: teacherRole.role.id + } + } else if (WeChatInfo) { defaultUser = { nickName: WeChatInfo.name, - avatarUrl: WeChatInfo.icon, - userId: res.userId + icon: WeChatInfo.icon, + userId: res.userId, } - } - if (secretData) { + } else if (secretData) { defaultUser = { nickName: secretData.credential, - avatarUrl: "../../static/images/index/tab.png", + icon: "", userId: res.userId } } @@ -85,7 +98,7 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - + console.log(options); }, /** -- Gitblit v1.9.1