fix: error throw

This commit is contained in:
手瓜一十雪
2024-11-14 12:54:58 +08:00
parent 5632488d15
commit 73d89c675b
11 changed files with 27 additions and 29 deletions

View File

@@ -18,13 +18,11 @@ export default class SendLike extends BaseAction<Payload, null> {
payloadSchema = SchemaData;
async _handle(payload: Payload): Promise<null> {
//logDebug('点赞参数', payload);
const qq = payload.user_id.toString();
const uid: string = await this.core.apis.UserApi.getUidByUinV2(qq) || '';
const result = await this.core.apis.UserApi.like(uid, parseInt(payload.times?.toString()) || 1);
//logDebug('点赞结果', result);
if (result.result !== 0) {
throw `点赞失败 ${result.errMsg}`;
throw new Error( `点赞失败 ${result.errMsg}`);
}
return null;
}