This commit is contained in:
张成
2025-11-21 16:53:49 +08:00
commit 8309808835
286 changed files with 32656 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
const { sys_parameter, op } = require("../../middleware/baseModel");
module.exports = {
"GET /sys_parameter/index": async (ctx, next) => {
const resList = await sys_parameter.findAll({ where: { is_modified: 0 } });
return ctx.success(resList);
},
"GET /sys_parameter/key": async (ctx, next) => {
let key = ctx.get("key");
const res = await sys_parameter.findOne({ where: { key: key } });
return ctx.success(res);
},
"POST /sys_parameter/setSysConfig": async (ctx, next) => {
let { title, logoUrl } = ctx.getBody();
await sys_parameter.update({ value: title }, { where: { key: "sys_title" } });
await sys_parameter.update({ value: logoUrl }, { where: { key: "sys_logo" } });
return ctx.success();
},
"POST /sys_parameter/add": async (ctx, next) => {
let row = ctx.getBody();
const res = await sys_parameter.create(row);
return ctx.success(res);
},
"POST /sys_parameter/edit": async (ctx, next) => {
let row = ctx.getBody();
let id = ctx.get("id");
const resList = await sys_parameter.update(row, {
where: {
id: id,
},
});
return ctx.success(resList);
},
"POST /sys_parameter/del": async (ctx, next) => {
let id = ctx.get("id");
const res = await sys_parameter.destroy({
where: {
id: id,
},
});
return ctx.success(res);
},
};