mirror of
https://github.com/lkeme/BiliHelper-personal.git
synced 2025-12-22 03:40:06 +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
|
* @param string $aid
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws NoLoginException
|
||||||
*/
|
*/
|
||||||
protected function reward(string $aid): void
|
protected function reward(string $aid): void
|
||||||
{
|
{
|
||||||
$response = ApiCoin::coin($aid);
|
$response = ApiCoin::coin($aid);
|
||||||
//
|
//
|
||||||
if ($response['code']) {
|
switch ($response['code']) {
|
||||||
Log::warning("主站任务: $aid 投币失败 {$response['code']} -> {$response['message']}");
|
case -101:
|
||||||
} else {
|
throw new NoLoginException($response['message']);
|
||||||
|
case 0:
|
||||||
Log::notice("主站任务: $aid 投币成功");
|
Log::notice("主站任务: $aid 投币成功");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Log::warning("主站任务: $aid 投币失败 {$response['code']} -> {$response['message']}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +285,7 @@ class MainSite extends BasePlugin
|
|||||||
//
|
//
|
||||||
$response = ApiShare::share($aid);
|
$response = ApiShare::share($aid);
|
||||||
switch ($response['code']) {
|
switch ($response['code']) {
|
||||||
case 137004:
|
case -101:
|
||||||
throw new NoLoginException($response['message']);
|
throw new NoLoginException($response['message']);
|
||||||
case 0:
|
case 0:
|
||||||
Log::notice("主站任务: $aid 分享成功");
|
Log::notice("主站任务: $aid 分享成功");
|
||||||
|
|||||||
@ -25,7 +25,6 @@ class ApiShare
|
|||||||
/**
|
/**
|
||||||
* 分享视频
|
* 分享视频
|
||||||
* @param string $aid
|
* @param string $aid
|
||||||
* @param string $cid
|
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function share(string $aid): array
|
public static function share(string $aid): array
|
||||||
@ -37,7 +36,6 @@ class ApiShare
|
|||||||
//
|
//
|
||||||
$payload = [
|
$payload = [
|
||||||
'aid' => $aid,
|
'aid' => $aid,
|
||||||
'jsonp' => "jsonp",
|
|
||||||
'csrf' => $user['csrf'],
|
'csrf' => $user['csrf'],
|
||||||
];
|
];
|
||||||
$headers = [
|
$headers = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user