This commit is contained in:
2025-12-03 16:40:46 +08:00
parent 31bc2a5576
commit 98f68fe300
6 changed files with 62 additions and 42 deletions

View File

@@ -168,11 +168,12 @@ app
.define(async (ctx) => {
const tokernUser = ctx.state.tokenUser;
const tuid = tokernUser.id;
const { id } = ctx.query?.data || {};
if (id) {
const { id, key } = ctx.query?.data || {};
if (id || key) {
const search: any = id ? { id } : { key };
const config = await ConfigModel.findOne({
where: {
id,
...search
},
});
if (config && config.uid === tuid) {
@@ -186,7 +187,7 @@ app
if (ossConfig.isEndWithJson(key)) {
try {
await ossConfig.deleteObject(key);
} catch (e) {}
} catch (e) { }
}
await config.destroy();
} else {