mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

* rebase * i18n-1 * add error info i18n * fix * fix * refactor: 删除error.json * delete useI18n
29 lines
687 B
TypeScript
29 lines
687 B
TypeScript
import { ErrType } from '../errorCode';
|
|
import { i18nT } from '../../../../web/i18n/utils';
|
|
/* dataset: 502000 */
|
|
export enum AppErrEnum {
|
|
unExist = 'appUnExist',
|
|
unAuthApp = 'unAuthApp'
|
|
}
|
|
const appErrList = [
|
|
{
|
|
statusText: AppErrEnum.unExist,
|
|
message: i18nT('common:code_error.app_error.not_exist')
|
|
},
|
|
{
|
|
statusText: AppErrEnum.unAuthApp,
|
|
message: i18nT('common:code_error.app_error.un_auth_app')
|
|
}
|
|
];
|
|
export default appErrList.reduce((acc, cur, index) => {
|
|
return {
|
|
...acc,
|
|
[cur.statusText]: {
|
|
code: 502000 + index,
|
|
statusText: cur.statusText,
|
|
message: cur.message,
|
|
data: null
|
|
}
|
|
};
|
|
}, {} as ErrType<`${AppErrEnum}`>);
|