mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
feat: modeldata接口。fix: 部分权限校验bug
This commit is contained in:
@@ -34,7 +34,10 @@ export const authChat = async (chatId: string, authorization?: string) => {
|
||||
|
||||
// 凭证校验
|
||||
if (!chat.isShare) {
|
||||
await authToken(authorization);
|
||||
const userId = await authToken(authorization);
|
||||
if (userId !== String(chat.userId._id)) {
|
||||
return Promise.reject('无权使用该对话');
|
||||
}
|
||||
} else if (chat.loadAmount === 0 || chat.expiredTime <= Date.now()) {
|
||||
return Promise.reject('聊天框已过期');
|
||||
}
|
||||
|
Reference in New Issue
Block a user