mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🌈 style: 代码格式化
This commit is contained in:
parent
8426215d5f
commit
648ed593c7
@ -27,11 +27,7 @@ async function store2ha1(passstore) {
|
|||||||
const parts = passstore.split(".");
|
const parts = passstore.split(".");
|
||||||
if (parts.length === 2) {
|
if (parts.length === 2) {
|
||||||
// 新的加密方式 with IV: IV.E
|
// 新的加密方式 with IV: IV.E
|
||||||
const c = crypto.createDecipheriv(
|
const c = crypto.createDecipheriv("aes-256-cbc", key, Buffer.from(parts[0], "hex"));
|
||||||
"aes-256-cbc",
|
|
||||||
key,
|
|
||||||
Buffer.from(parts[0], "hex")
|
|
||||||
);
|
|
||||||
let d = c.update(parts[1], "hex", "binary");
|
let d = c.update(parts[1], "hex", "binary");
|
||||||
d += c.final("binary");
|
d += c.final("binary");
|
||||||
return d;
|
return d;
|
||||||
@ -45,12 +41,9 @@ async function store2ha1(passstore) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
console.error(
|
||||||
"在[default]部分设置的passwordSecret无法解密信息。请确保所有节点的passwordSecret相同。如果您更改了密码保密信息,可能需要重新添加用户。",
|
"在[default]部分设置的passwordSecret无法解密信息。请确保所有节点的passwordSecret相同。如果您更改了密码保密信息,可能需要重新添加用户。",
|
||||||
e
|
e,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { ha12store, store2ha1 };
|
||||||
ha12store,
|
|
||||||
store2ha1
|
|
||||||
}
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const BASE_URL = "http://cloud-music.pl-fe.cn"
|
const BASE_URL = "http://cloud-music.pl-fe.cn";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取cookie
|
* 获取cookie
|
||||||
@ -11,7 +11,7 @@ const BASE_URL = "http://cloud-music.pl-fe.cn"
|
|||||||
*/
|
*/
|
||||||
async function getCookies(key) {
|
async function getCookies(key) {
|
||||||
const cookieUrl = `${BASE_URL}/login/qr/check?key=${key}×tamp=${Date.now()}`;
|
const cookieUrl = `${BASE_URL}/login/qr/check?key=${key}×tamp=${Date.now()}`;
|
||||||
return fetch(cookieUrl).then(async (resp) => {
|
return fetch(cookieUrl).then(async resp => {
|
||||||
return await resp.json();
|
return await resp.json();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -24,13 +24,12 @@ async function getCookies(key) {
|
|||||||
async function getLoginStatus(cookie) {
|
async function getLoginStatus(cookie) {
|
||||||
return axios({
|
return axios({
|
||||||
url: `${BASE_URL}/login/status?timestamp=${Date.now()}`,
|
url: `${BASE_URL}/login/status?timestamp=${Date.now()}`,
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: {
|
data: {
|
||||||
cookie,
|
cookie,
|
||||||
},
|
},
|
||||||
})
|
}).then(resp => {
|
||||||
.then(resp => {
|
return resp.data.data;
|
||||||
return resp.data.data
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,13 +41,12 @@ async function getLoginStatus(cookie) {
|
|||||||
async function getDailyRecommend(cookie) {
|
async function getDailyRecommend(cookie) {
|
||||||
return axios({
|
return axios({
|
||||||
url: `${BASE_URL}/recommend/songs?timestamp=${Date.now()}`,
|
url: `${BASE_URL}/recommend/songs?timestamp=${Date.now()}`,
|
||||||
method: 'get',
|
method: "get",
|
||||||
data: {
|
data: {
|
||||||
cookie,
|
cookie,
|
||||||
},
|
},
|
||||||
})
|
}).then(resp => {
|
||||||
.then(resp => {
|
return resp.data.data;
|
||||||
return resp.data.data
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +56,7 @@ async function getDailyRecommend(cookie) {
|
|||||||
*/
|
*/
|
||||||
async function getKey() {
|
async function getKey() {
|
||||||
const keyUrl = `${BASE_URL}/login/qr/key?timestamp=${Date.now()}`;
|
const keyUrl = `${BASE_URL}/login/qr/key?timestamp=${Date.now()}`;
|
||||||
return await fetch(keyUrl).then(async (resp) => {
|
return await fetch(keyUrl).then(async resp => {
|
||||||
const respJson = await resp.json();
|
const respJson = await resp.json();
|
||||||
return respJson.data.unikey;
|
return respJson.data.unikey;
|
||||||
});
|
});
|
||||||
@ -71,7 +69,7 @@ async function getKey() {
|
|||||||
*/
|
*/
|
||||||
async function getQrCode(key) {
|
async function getQrCode(key) {
|
||||||
const qrPicUrl = `${BASE_URL}/login/qr/create?key=${key}&qrimg=true×tamp=${Date.now()}`;
|
const qrPicUrl = `${BASE_URL}/login/qr/create?key=${key}&qrimg=true×tamp=${Date.now()}`;
|
||||||
return await fetch(qrPicUrl).then(async (resp) => {
|
return await fetch(qrPicUrl).then(async resp => {
|
||||||
const respJson = await resp.json();
|
const respJson = await resp.json();
|
||||||
return respJson.data.qrimg;
|
return respJson.data.qrimg;
|
||||||
});
|
});
|
||||||
@ -85,10 +83,9 @@ async function getQrCode(key) {
|
|||||||
async function getUserRecord(uid) {
|
async function getUserRecord(uid) {
|
||||||
return axios({
|
return axios({
|
||||||
url: `${BASE_URL}/user/record?uid=${uid}&type=1×tamp=${Date.now()}`,
|
url: `${BASE_URL}/user/record?uid=${uid}&type=1×tamp=${Date.now()}`,
|
||||||
method: 'get',
|
method: "get",
|
||||||
})
|
}).then(resp => {
|
||||||
.then(resp => {
|
return resp.data;
|
||||||
return resp.data
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,23 +97,21 @@ async function getUserRecord(uid) {
|
|||||||
async function checkMusic(id) {
|
async function checkMusic(id) {
|
||||||
return axios({
|
return axios({
|
||||||
url: `${BASE_URL}/check/music?id=${id}×tamp=${Date.now()}`,
|
url: `${BASE_URL}/check/music?id=${id}×tamp=${Date.now()}`,
|
||||||
method: 'get',
|
method: "get",
|
||||||
})
|
}).then(resp => {
|
||||||
.then(resp => {
|
return resp.data;
|
||||||
return resp.data
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getSong(id, cookie) {
|
async function getSong(id, cookie) {
|
||||||
return axios({
|
return axios({
|
||||||
url: `${BASE_URL}/song/url/v1?id=${id}&level=standard×tamp=${Date.now()}`,
|
url: `${BASE_URL}/song/url/v1?id=${id}&level=standard×tamp=${Date.now()}`,
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: {
|
data: {
|
||||||
cookie,
|
cookie,
|
||||||
},
|
},
|
||||||
})
|
}).then(resp => {
|
||||||
.then(resp => {
|
return resp.data.data;
|
||||||
return resp.data.data
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,5 +123,5 @@ export {
|
|||||||
getQrCode,
|
getQrCode,
|
||||||
getUserRecord,
|
getUserRecord,
|
||||||
checkMusic,
|
checkMusic,
|
||||||
getSong
|
getSong,
|
||||||
}
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user