mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-02 00:30:25 +00:00
refactor: sign music
This commit is contained in:
2
src/core
2
src/core
Submodule src/core updated: f76362e1e8...d06dd4d66c
@@ -30,7 +30,8 @@ import { getFriend, getGroup, getGroupMember, getUidByUin, selfInfo } from '@/co
|
|||||||
import { NTQQMsgApi } from '@/core/apis';
|
import { NTQQMsgApi } from '@/core/apis';
|
||||||
import { NTQQFileApi } from '@/core/apis';
|
import { NTQQFileApi } from '@/core/apis';
|
||||||
import { ob11Config } from '@/onebot11/config';
|
import { ob11Config } from '@/onebot11/config';
|
||||||
import { CustomMusicSignPostData, IdMusicSignPostData, MusicSign } from '@/core/apis/sign';
|
import { CustomMusicSignPostData, IdMusicSignPostData } from '@/core/apis/sign';
|
||||||
|
import { RequestUtil } from '@/common/utils/request';
|
||||||
|
|
||||||
const ALLOW_SEND_TEMP_MSG = false;
|
const ALLOW_SEND_TEMP_MSG = false;
|
||||||
|
|
||||||
@@ -136,7 +137,9 @@ async function genMusicElement(postData: IdMusicSignPostData | CustomMusicSignPo
|
|||||||
throw Error('音乐消息签名地址未配置');
|
throw Error('音乐消息签名地址未配置');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const musicJson = await new MusicSign(signUrl).sign(postData);
|
//const musicJson = await new MusicSign(signUrl).sign(postData);
|
||||||
|
// 待测试
|
||||||
|
const musicJson = await RequestUtil.HttpGetJson<any>(signUrl, 'POST', postData);
|
||||||
return SendMsgElementConstructor.ark(musicJson);
|
return SendMsgElementConstructor.ark(musicJson);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError('生成音乐消息失败', e);
|
logError('生成音乐消息失败', e);
|
||||||
|
|||||||
Reference in New Issue
Block a user