mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
V4.6.7-production (#759)
This commit is contained in:
@@ -4,7 +4,7 @@ export const removeFilesByPaths = (paths: string[]) => {
|
||||
paths.forEach((path) => {
|
||||
fs.unlink(path, (err) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
// console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -3,6 +3,7 @@ import { sseResponseEventEnum } from './constant';
|
||||
import { proxyError, ERROR_RESPONSE, ERROR_ENUM } from '@fastgpt/global/common/error/errorCode';
|
||||
import { addLog } from '../system/log';
|
||||
import { clearCookie } from '../../support/permission/controller';
|
||||
import { replaceSensitiveLink } from '@fastgpt/global/common/string/tools';
|
||||
|
||||
export interface ResponseType<T = any> {
|
||||
code: number;
|
||||
@@ -52,7 +53,7 @@ export const jsonRes = <T = any>(
|
||||
res.status(code).json({
|
||||
code,
|
||||
statusText: '',
|
||||
message: message || msg,
|
||||
message: replaceSensitiveLink(message || msg),
|
||||
data: data !== undefined ? data : null
|
||||
});
|
||||
};
|
||||
@@ -90,7 +91,7 @@ export const sseErrRes = (res: NextApiResponse, error: any) => {
|
||||
responseWrite({
|
||||
res,
|
||||
event: sseResponseEventEnum.error,
|
||||
data: JSON.stringify({ message: msg })
|
||||
data: JSON.stringify({ message: replaceSensitiveLink(msg) })
|
||||
});
|
||||
};
|
||||
|
||||
|
@@ -168,6 +168,10 @@ export async function parseHeaderCert({
|
||||
return Promise.reject(ERROR_ENUM.unAuthorization);
|
||||
})();
|
||||
|
||||
if (!authRoot && (!teamId || !tmbId)) {
|
||||
return Promise.reject(ERROR_ENUM.unAuthorization);
|
||||
}
|
||||
|
||||
return {
|
||||
userId: String(uid),
|
||||
teamId: String(teamId),
|
||||
|
Reference in New Issue
Block a user