mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-18 06:20:29 +00:00
refactor: sign music
This commit is contained in:
parent
f32a693393
commit
8fe7d3aaec
2
src/core
2
src/core
@ -1 +1 @@
|
|||||||
Subproject commit f76362e1e894e3c6498f7709ce9f3b1a7c9fe836
|
Subproject commit d06dd4d66ca4d50c70ce066cd872edb939138d34
|
||||||
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user