mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2026-01-16 13:20:27 +00:00
[fix] Login
This commit is contained in:
parent
d01ecf0a4b
commit
08b473a4e9
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,5 +24,6 @@ conf/user.conf
|
|||||||
conf/user1.conf
|
conf/user1.conf
|
||||||
/conf/user.conf
|
/conf/user.conf
|
||||||
/conf/test.conf
|
/conf/test.conf
|
||||||
|
/conf/test1.conf
|
||||||
/log/
|
/log/
|
||||||
/src/backup/
|
/src/backup/
|
||||||
@ -308,17 +308,31 @@ class Login
|
|||||||
// {"ts":1593079322,"code":-629,"message":"账号或者密码错误"}
|
// {"ts":1593079322,"code":-629,"message":"账号或者密码错误"}
|
||||||
// {"ts":1593082268,"code":-105,"data":{"url":"https://passport.bilibili.com/register/verification.html?success=1>=b6e5b7fad7ecd37f465838689732e788&challenge=7efb4020b22c0a9ac124aea624e11ad7&ct=1&hash=7fa8282ad93047a4d6fe6111c93b308a"},"message":"验证码错误"}
|
// {"ts":1593082268,"code":-105,"data":{"url":"https://passport.bilibili.com/register/verification.html?success=1>=b6e5b7fad7ecd37f465838689732e788&challenge=7efb4020b22c0a9ac124aea624e11ad7&ct=1&hash=7fa8282ad93047a4d6fe6111c93b308a"},"message":"验证码错误"}
|
||||||
// {"ts":1593082432,"code":0,"data":{"status":0,"token_info":{"mid":123456,"access_token":"123123","refresh_token":"123123","expires_in":2592000},"cookie_info":{"cookies":[{"name":"bili_jct","value":"123123","http_only":0,"expires":1595674432},{"name":"DedeUserID","value":"123456","http_only":0,"expires":1595674432},{"name":"DedeUserID__ckMd5","value":"123123","http_only":0,"expires":1595674432},{"name":"sid","value":"bd6aagp7","http_only":0,"expires":1595674432},{"name":"SESSDATA","value":"6d74d850%123%2Cf0e36b61","http_only":1,"expires":1595674432}],"domains":[".bilibili.com",".biligame.com",".bigfunapp.cn"]},"sso":["https://passport.bilibili.com/api/v2/sso","https://passport.biligame.com/api/v2/sso","https://passport.bigfunapp.cn/api/v2/sso"]}}
|
// {"ts":1593082432,"code":0,"data":{"status":0,"token_info":{"mid":123456,"access_token":"123123","refresh_token":"123123","expires_in":2592000},"cookie_info":{"cookies":[{"name":"bili_jct","value":"123123","http_only":0,"expires":1595674432},{"name":"DedeUserID","value":"123456","http_only":0,"expires":1595674432},{"name":"DedeUserID__ckMd5","value":"123123","http_only":0,"expires":1595674432},{"name":"sid","value":"bd6aagp7","http_only":0,"expires":1595674432},{"name":"SESSDATA","value":"6d74d850%123%2Cf0e36b61","http_only":1,"expires":1595674432}],"domains":[".bilibili.com",".biligame.com",".bigfunapp.cn"]},"sso":["https://passport.bilibili.com/api/v2/sso","https://passport.biligame.com/api/v2/sso","https://passport.bigfunapp.cn/api/v2/sso"]}}
|
||||||
|
// {"ts":1610254019,"code":0,"data":{"status":2,"url":"https://passport.bilibili.com/account/mobile/security/managephone/phone/verify?tmp_token=2bc5dd260df7158xx860565fxx0d5311&requestId=dffcfxx052fe11xxa9c8e2667739c15c&source=risk","message":"您的账号存在高危异常行为,为了您的账号安全,请验证手机号后登录帐号"}}
|
||||||
// https://passport.bilibili.com/mobile/verifytel_h5.html
|
// https://passport.bilibili.com/mobile/verifytel_h5.html
|
||||||
switch ($de_raw['code']) {
|
switch ($de_raw['code']) {
|
||||||
case 0:
|
case 0:
|
||||||
// 正常登录
|
// 二次判断
|
||||||
Log::info("{$mode}登录成功");
|
switch ($de_raw['data']['status']){
|
||||||
$access_token = $de_raw['data']['token_info']['access_token'];
|
case 0:
|
||||||
$refresh_token = $de_raw['data']['token_info']['refresh_token'];
|
// 正常登录
|
||||||
self::saveConfig('ACCESS_TOKEN', $access_token);
|
Log::info("{$mode}登录成功");
|
||||||
self::saveConfig('REFRESH_TOKEN', $refresh_token);
|
$access_token = $de_raw['data']['token_info']['access_token'];
|
||||||
self::saveCookie($de_raw);
|
$refresh_token = $de_raw['data']['token_info']['refresh_token'];
|
||||||
Log::info('信息配置完毕');
|
self::saveConfig('ACCESS_TOKEN', $access_token);
|
||||||
|
self::saveConfig('REFRESH_TOKEN', $refresh_token);
|
||||||
|
self::saveCookie($de_raw);
|
||||||
|
Log::info('信息配置完毕');
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 异常高危
|
||||||
|
Log::error('登录失败', ['msg' => $de_raw['data']['message']]);
|
||||||
|
die();
|
||||||
|
default:
|
||||||
|
Log::error('登录失败', ['msg' => '未知错误: ' . $de_raw['data']['message']]);
|
||||||
|
die();
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case -105:
|
case -105:
|
||||||
// 需要验证码
|
// 需要验证码
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user