feat: 上传文件到minio
This commit is contained in:
@@ -10,10 +10,15 @@ app
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const tokenUser = ctx.state.tokenUser;
|
||||
const data = ctx.query.data || {};
|
||||
if (!data.key) {
|
||||
throw new CustomError('key is required');
|
||||
}
|
||||
const list = await AppListModel.findAll({
|
||||
order: [['updatedAt', 'DESC']],
|
||||
where: {
|
||||
uid: tokenUser.id,
|
||||
key: data.key,
|
||||
},
|
||||
});
|
||||
ctx.body = list;
|
||||
@@ -61,6 +66,10 @@ app
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rest.key) {
|
||||
throw new CustomError('key is required');
|
||||
}
|
||||
const app = await AppListModel.create({ data, ...rest, uid: tokenUser.id });
|
||||
ctx.body = app;
|
||||
return ctx;
|
||||
@@ -82,7 +91,9 @@ app
|
||||
if (!app) {
|
||||
throw new CustomError('app not found');
|
||||
}
|
||||
await app.destroy();
|
||||
await app.destroy({
|
||||
force: true,
|
||||
});
|
||||
ctx.body = 'success';
|
||||
return ctx;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user