mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 08:25:07 +00:00
v4.6 -1 (#459)
This commit is contained in:
28
packages/global/common/error/code/openapi.ts
Normal file
28
packages/global/common/error/code/openapi.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
|
||||
/* dataset: 506000 */
|
||||
export enum OpenApiErrEnum {
|
||||
unExist = 'unExist',
|
||||
unAuth = 'unAuth'
|
||||
}
|
||||
const errList = [
|
||||
{
|
||||
statusText: OpenApiErrEnum.unExist,
|
||||
message: 'Api Key 不存在'
|
||||
},
|
||||
{
|
||||
statusText: OpenApiErrEnum.unAuth,
|
||||
message: '无权操作该 Api Key'
|
||||
}
|
||||
];
|
||||
export default errList.reduce((acc, cur, index) => {
|
||||
return {
|
||||
...acc,
|
||||
[cur.statusText]: {
|
||||
code: 506000 + index,
|
||||
statusText: cur.statusText,
|
||||
message: cur.message,
|
||||
data: null
|
||||
}
|
||||
};
|
||||
}, {} as ErrType<`${OpenApiErrEnum}`>);
|
Reference in New Issue
Block a user