| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | textName: "18892081234", |
| | | textName: "15111111116", |
| | | textPassword: "xA123456", |
| | | loading: false, |
| | | userInfo: { |
| | |
| | | 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", |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options); |
| | | }, |
| | | |
| | | /** |