mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复对比工具保存文件
This commit is contained in:
+4
-1
@@ -89,7 +89,10 @@ export default (app: Router) => {
|
|||||||
if (config.blackFileList.includes(name)) {
|
if (config.blackFileList.includes(name)) {
|
||||||
res.send({ code: 403, message: '文件无法访问' });
|
res.send({ code: 403, message: '文件无法访问' });
|
||||||
}
|
}
|
||||||
const path = join(config.configPath, name);
|
let path = join(config.configPath, name);
|
||||||
|
if (name.startsWith('data/scripts/')) {
|
||||||
|
path = join(config.rootPath, name);
|
||||||
|
}
|
||||||
await fs.writeFile(path, content);
|
await fs.writeFile(path, content);
|
||||||
res.send({ code: 200, message: '保存成功' });
|
res.send({ code: 200, message: '保存成功' });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user