自动点赞提交

This commit is contained in:
wong
2026-05-12 16:58:46 +08:00
parent 1d11f01115
commit 41ffb8a220
22 changed files with 1247 additions and 156 deletions

View File

@@ -188,6 +188,12 @@ class FriendTaskController extends BaseController
$data['memo'] = '操作过于频繁,请稍后再试';
}
if (strpos('登录过期,请重新登录', $item['extra']) !== false){
$data['reason'] = '登录过期';
$data['memo'] = '登录过期,请重新登录';
}
if (strpos('当前账号存在安全风险', $item['extra']) !== false){
$data['reason'] = '账号风险';
$data['memo'] = '当前账号存在安全风险,需先到「微信团队」进行安全验证后才能继续使用当前功能';

View File

@@ -349,7 +349,11 @@ class WebSocketController extends BaseController
$snsId = !empty($data['snsId']) ? $data['snsId'] : '';
$wechatAccountId = !empty($data['wechatAccountId']) ? $data['wechatAccountId'] : '';
$wechatFriendId = !empty($data['wechatFriendId']) ? $data['wechatFriendId'] : 0;
$momentInteractType = isset($data['momentInteractType']) ? intval($data['momentInteractType']) : 1;
if (!in_array($momentInteractType, [1, 2], true)) {
$momentInteractType = 1;
}
$sendWord = isset($data['sendWord']) ? (string)$data['sendWord'] : '';
//过滤消息
if (empty($snsId)) {
@@ -358,19 +362,26 @@ class WebSocketController extends BaseController
if (empty($wechatAccountId)) {
return json_encode(['code' => 400, 'msg' => '微信id不能为空']);
}
if ($momentInteractType === 2 && $sendWord === '') {
return json_encode(['code' => 400, 'msg' => '评论内容不能为空']);
}
try {
$result = [
"cmdType" => "CmdMomentInteract",
"momentInteractType" => 1,
"momentInteractType" => $momentInteractType,
"seq" => time(),
"snsId" => $snsId,
"wechatAccountId" => $wechatAccountId,
"wechatFriendId" => $wechatFriendId,
];
if ($momentInteractType === 2) {
$result['sendWord'] = $sendWord;
}
$message = $this->sendMessage($result);
return json_encode(['code' => 200, 'msg' => '点赞成功', 'data' => $message]);
$okMsg = $momentInteractType === 2 ? '评论成功' : '点赞成功';
return json_encode(['code' => 200, 'msg' => $okMsg, 'data' => $message]);
} catch (\Exception $e) {
return json_encode(['code' => 500, 'msg' => $e->getMessage()]);
}