mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
@@ -0,0 +1,27 @@
|
||||
const { eapiResDecrypt, eapiReqDecrypt } = require('../util/crypto')
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
module.exports = async (query, request) => {
|
||||
const hexString = query.hexString
|
||||
const isReq = query.isReq != 'false'
|
||||
if (!hexString) {
|
||||
return {
|
||||
status: 400,
|
||||
body: {
|
||||
code: 400,
|
||||
message: 'hex string is required',
|
||||
},
|
||||
}
|
||||
}
|
||||
// 去除空格
|
||||
let pureHexString = hexString.replace(/\s/g, '')
|
||||
return {
|
||||
status: 200,
|
||||
body: {
|
||||
code: 200,
|
||||
data: isReq
|
||||
? eapiReqDecrypt(pureHexString)
|
||||
: eapiResDecrypt(pureHexString),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user