mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-19 01:20:08 +08:00
[fix] NotLoginError fixed#184
This commit is contained in:
parent
0faf5baf64
commit
0c32ce0256
@ -111,15 +111,20 @@ class MainSite extends BasePlugin
|
||||
* 投币
|
||||
* @param string $aid
|
||||
* @return void
|
||||
* @throws NoLoginException
|
||||
*/
|
||||
protected function reward(string $aid): void
|
||||
{
|
||||
$response = ApiCoin::coin($aid);
|
||||
//
|
||||
if ($response['code']) {
|
||||
Log::warning("主站任务: $aid 投币失败 {$response['code']} -> {$response['message']}");
|
||||
} else {
|
||||
Log::notice("主站任务: $aid 投币成功");
|
||||
switch ($response['code']) {
|
||||
case -101:
|
||||
throw new NoLoginException($response['message']);
|
||||
case 0:
|
||||
Log::notice("主站任务: $aid 投币成功");
|
||||
break;
|
||||
default:
|
||||
Log::warning("主站任务: $aid 投币失败 {$response['code']} -> {$response['message']}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,7 +285,7 @@ class MainSite extends BasePlugin
|
||||
//
|
||||
$response = ApiShare::share($aid);
|
||||
switch ($response['code']) {
|
||||
case 137004:
|
||||
case -101:
|
||||
throw new NoLoginException($response['message']);
|
||||
case 0:
|
||||
Log::notice("主站任务: $aid 分享成功");
|
||||
|
||||
@ -25,7 +25,6 @@ class ApiShare
|
||||
/**
|
||||
* 分享视频
|
||||
* @param string $aid
|
||||
* @param string $cid
|
||||
* @return array
|
||||
*/
|
||||
public static function share(string $aid): array
|
||||
@ -37,7 +36,6 @@ class ApiShare
|
||||
//
|
||||
$payload = [
|
||||
'aid' => $aid,
|
||||
'jsonp' => "jsonp",
|
||||
'csrf' => $user['csrf'],
|
||||
];
|
||||
$headers = [
|
||||
@ -48,4 +46,4 @@ class ApiShare
|
||||
return Request::postJson(true, 'pc', $url, $payload, $headers);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user