Skip to content

Commit faf269c

Browse files
committed
fix: 适配邮箱账号登录
1 parent 7a396e1 commit faf269c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/service.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ async function Login(payload: loginPayload): Promise<string> {
1414
try {
1515
const response: AxiosResponse = await axios.post('https://gf2-bbs-api.sunborngame.com/login/account', payload);
1616
console.log(response.data);
17-
return response.data.data.account.token as string;
17+
if (response.data.code === 0) {
18+
return response.data.data.account.token as string;
19+
}
20+
else {
21+
payload.source = 'mail';
22+
const response: AxiosResponse = await axios.post('https://gf2-bbs-api.sunborngame.com/login/account', payload);
23+
console.log(response.data);
24+
return response.data.data.account.token as string;
25+
}
1826
}
1927
catch (error) {
2028
if (axios.isAxiosError(error)) {

0 commit comments

Comments
 (0)