fix: 兼容获取appKey和version
This commit is contained in:
@@ -148,6 +148,19 @@ app
|
||||
if (!files || !files.length) {
|
||||
throw new CustomError('files is required');
|
||||
}
|
||||
let am = await AppModel.findOne({ where: { key: appKey, uid: tokenUser.id } });
|
||||
if (!am) {
|
||||
am = await AppModel.create({
|
||||
user: tokenUser.username,
|
||||
key: appKey,
|
||||
uid: tokenUser.id,
|
||||
version: '0.0.0',
|
||||
title: appKey,
|
||||
data: {
|
||||
files: [],
|
||||
},
|
||||
});
|
||||
}
|
||||
let app = await AppListModel.findOne({ where: { version: version, key: appKey, uid: tokenUser.id } });
|
||||
if (!app) {
|
||||
// throw new CustomError('app not found');
|
||||
|
||||
Reference in New Issue
Block a user