Commit 16f2263c authored by liujiangnan's avatar liujiangnan

登录报错题型

parent 6c897a12
......@@ -80,7 +80,6 @@ function HomePage() {
return;
}
endPoint.login({username: session.yourName, password: session.yourPass}).then((userInfo: any) => {
console.log(userInfo);
session.roomName = userInfo["class_id"];
session.yourName = userInfo["nick_name"];
session.role = userInfo["classRole"]==="tea"?"teacher":"student";
......@@ -127,6 +126,11 @@ function HomePage() {
ref.current = false;
globalStore.stopLoading();
})
}).catch((err: any) => {
globalStore.showToast({
type: 'rtmClient',
message: err
})
});
}
......
......@@ -55,6 +55,9 @@ export class EndPoint {
method: 'POST',
data: data
});
if(json.msg==="error"){
throw json.data;
}
let token = json.data;
this.userToken = token;
try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment