mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00

* rebase * i18n-1 * add error info i18n * fix * fix * refactor: 删除error.json * delete useI18n
31 lines
697 B
TypeScript
31 lines
697 B
TypeScript
import { ErrType } from '../errorCode';
|
|
import { i18nT } from '../../../../web/i18n/utils';
|
|
/* dataset: 508000 */
|
|
export enum PluginErrEnum {
|
|
unExist = 'pluginUnExist',
|
|
unAuth = 'pluginUnAuth'
|
|
}
|
|
|
|
const errList = [
|
|
{
|
|
statusText: PluginErrEnum.unExist,
|
|
message: i18nT('common:code_error.plugin_error.not_exist')
|
|
},
|
|
{
|
|
statusText: PluginErrEnum.unAuth,
|
|
message: i18nT('common:code_error.plugin_error.un_auth')
|
|
}
|
|
];
|
|
|
|
export default errList.reduce((acc, cur, index) => {
|
|
return {
|
|
...acc,
|
|
[cur.statusText]: {
|
|
code: 508000 + index,
|
|
statusText: cur.statusText,
|
|
message: cur.message,
|
|
data: null
|
|
}
|
|
};
|
|
}, {} as ErrType<`${PluginErrEnum}`>);
|