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

* adapt v1 chat init * adapt v1 chat init * adapt v1 chat init * perf: message input line; fix: http request un stream * perf: message input line; fix: http request un stream * perf: message input line; fix: http request un stream * perf: error tip
41 lines
870 B
TypeScript
41 lines
870 B
TypeScript
import { ErrType } from '../errorCode';
|
|
|
|
/* dataset: 505000 */
|
|
export enum OutLinkErrEnum {
|
|
unExist = 'outlinkUnExist',
|
|
unAuthLink = 'unAuthLink',
|
|
linkUnInvalid = 'linkUnInvalid',
|
|
|
|
unAuthUser = 'unAuthUser'
|
|
}
|
|
const errList = [
|
|
{
|
|
statusText: OutLinkErrEnum.unExist,
|
|
message: '分享链接不存在'
|
|
},
|
|
{
|
|
statusText: OutLinkErrEnum.unAuthLink,
|
|
message: '分享链接无效'
|
|
},
|
|
{
|
|
code: 501,
|
|
statusText: OutLinkErrEnum.linkUnInvalid,
|
|
message: '分享链接无效'
|
|
},
|
|
{
|
|
statusText: OutLinkErrEnum.unAuthUser,
|
|
message: '身份校验失败'
|
|
}
|
|
];
|
|
export default errList.reduce((acc, cur, index) => {
|
|
return {
|
|
...acc,
|
|
[cur.statusText]: {
|
|
code: cur?.code || 505000 + index,
|
|
statusText: cur.statusText,
|
|
message: cur.message,
|
|
data: null
|
|
}
|
|
};
|
|
}, {} as ErrType<`${OutLinkErrEnum}`>);
|