update
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user