Skip to content

Commit 85ad8bd

Browse files
committed
fix: failure to obtain user information after login
修复登录后无法获取用户信息
1 parent 36c4780 commit 85ad8bd

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

src/main.qml

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ ApplicationWindow {
100100
userProvince = profile.province;
101101
userBirthday = profile.birthday;
102102
console.log("用户信息获取成功");
103+
isLogin = true;
103104
API.getUserLikeSongIds(userID);
104105
}
105106

src/qml/login/CaptchaLogin.qml

+11-12
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Item {
1212
// 验证验证码
1313
function onReply(reply) {
1414
API.onVerifyCaptchaCompleted.disconnect(onReply);
15-
if (reply.data === true)
15+
if (reply.data === true) {
1616
login();
17-
else {
17+
} else {
1818
code.text = "";
19-
code.showAlert = true
19+
code.showAlert = true;
2020
}
2121
}
2222

@@ -110,6 +110,14 @@ Item {
110110
RecommandButton {
111111
id: captchaBtn
112112

113+
function onReply() {
114+
API.onSendCaptchaCompleted.disconnect(onReply);
115+
console.log("验证码发送成功");
116+
captchaBtn.enabled = false;
117+
captchaBtn.text = "59s后重发";
118+
sendCaptchaTimer.start();
119+
}
120+
113121
width: 100
114122
text: "获取验证码"
115123
enabled: phone.text !== "" && phone.text.length === 11
@@ -119,15 +127,6 @@ Item {
119127
API.onSendCaptchaCompleted.connect(onReply);
120128
API.getCaptcha(phone.text);
121129
}
122-
123-
function onReply() {
124-
API.onSendCaptchaCompleted.disconnect(onReply);
125-
console.log("验证码发送成功");
126-
captchaBtn.enabled = false;
127-
captchaBtn.text = "59s后重发";
128-
sendCaptchaTimer.start();
129-
}
130-
131130
}
132131

133132
}

src/qml/login/QRCodeLogin.qml

-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ Item {
4848
API.addCookie();
4949
API.getAccountInfo();
5050
Router.back();
51-
isLogin = true;
5251
timer.stop();
53-
root.close();
5452
}
5553

5654
// 处理二维码失效后的逻辑

0 commit comments

Comments
 (0)