fix: error throw

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

No files matched your search

+1 -3
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;
}