Update index.js

p7zwxau5j 2 months ago
parent 48fb461721
commit 9407490943

@ -17,10 +17,8 @@ Page({
});
},
onTeacherLogin: function() {
// 教师登录逻辑
const { studentId, name } = this.data;
if (studentId === '520' && name === 'fzu') {
// 匹配成功,跳转到教师端
wx.navigateTo({
url: '/pages/teacherHomePage/teacherHomePage'
});
@ -48,7 +46,6 @@ Page({
return;
}
// 将输入的学号转换为数字
const num = Number(studentId);
if (isNaN(num)) {
wx.showToast({
@ -64,7 +61,6 @@ Page({
name: name
}).get().then(res => {
if (res.data.length > 0) {
// 找到匹配的用户,进行跳转
wx.navigateTo({
url: '/pages/studentHomePage/studentHomePage?studentId=' + encodeURIComponent(studentId) + '&name=' + encodeURIComponent(name)
});

Loading…
Cancel
Save