perf: refresh page.img mode.collection filter

This commit is contained in:
archer
2023-05-09 11:13:33 +08:00
parent 18e0212d27
commit de6ac0f589
11 changed files with 90 additions and 69 deletions

View File

@@ -36,7 +36,8 @@ export const proxyError: Record<string, boolean> = {
export enum ERROR_ENUM {
unAuthorization = 'unAuthorization',
insufficientQuota = 'insufficientQuota'
insufficientQuota = 'insufficientQuota',
unAuthModel = 'unAuthModel'
}
export const ERROR_RESPONSE: Record<
any,
@@ -58,5 +59,11 @@ export const ERROR_RESPONSE: Record<
statusText: ERROR_ENUM.insufficientQuota,
message: '账号余额不足',
data: null
},
[ERROR_ENUM.unAuthModel]: {
code: 511,
statusText: ERROR_ENUM.unAuthModel,
message: '无权使用该模型',
data: null
}
};

View File

@@ -114,7 +114,7 @@ export const authModel = async ({
2. authUser = false and share, anyone can use
*/
if ((authOwner || (authUser && !model.share.isShare)) && userId !== String(model.userId)) {
return Promise.reject('无权操作该模型');
return Promise.reject(ERROR_ENUM.unAuthModel);
}
// do not share detail info