2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

修正模板一报错

This commit is contained in:
Ctrlcvs 2022-10-31 15:23:24 +08:00
parent 7b557f1ce4
commit ffd380ec52

View File

@ -226,13 +226,12 @@ export async function Note(e, {
if (mb < 0) { if (mb < 0) {
mb = lodash.random(0, path_url.length - 1); mb = lodash.random(0, path_url.length - 1);
} }
let urlType = note_file("xiaoyao"); let urlType = note_file("xiaoyao");
let objFile = Object.keys(urlType) let objFile = Object.keys(urlType)
if (objFile.length > 0) { if (objFile.length > 0) {
objFile = objFile[lodash.random(0, objFile.length - 1)] objFile = objFile[lodash.random(0, objFile.length - 1)]
} }
let img_path = `${urlType[objFile]}`; let img_path = `./plugins/xiaoyao-cvs-plugin/resources/dailyNote/${path_img[mb]}`;
if (tempData[e.user_id] && tempData[e.user_id].type > -1) { if (tempData[e.user_id] && tempData[e.user_id].type > -1) {
mb = tempData[e.user_id].type; mb = tempData[e.user_id].type;
objFile = tempData[e.user_id].temp; objFile = tempData[e.user_id].temp;
@ -248,7 +247,6 @@ export async function Note(e, {
} }
img_path = `${urlType[objFile]}${path_img[mb]}`; img_path = `${urlType[objFile]}${path_img[mb]}`;
} }
var image = fs.readdirSync(img_path); var image = fs.readdirSync(img_path);
// console.log(fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/BJT-Templet/Template2`)) // console.log(fs.readdirSync(`./plugins/xiaoyao-cvs-plugin/resources/dailyNote/BJT-Templet/Template2`))
var list_img = []; var list_img = [];