muxi feng commited on
Commit
407e55b
·
1 Parent(s): ad0710e

改进判断登录逻辑

Browse files
app/components/user.tsx CHANGED
@@ -49,9 +49,11 @@ export function User() {
49
  }
50
 
51
  useEffect(()=>{
52
- useStor.getUserInfo()
 
 
53
  setUserName(useStor.name)
54
- },[useStor.name])
55
 
56
  useEffect(() => {
57
  const keydownEvent = (e: KeyboardEvent) => {
 
49
  }
50
 
51
  useEffect(()=>{
52
+ if(accessStore.auth){
53
+ useStor.getUserInfo()
54
+ }
55
  setUserName(useStor.name)
56
+ },[useStor.name,accessStore.auth])
57
 
58
  useEffect(() => {
59
  const keydownEvent = (e: KeyboardEvent) => {
app/masks/cn.ts CHANGED
@@ -20,10 +20,10 @@ export const CN_MASKS: BuiltinMask[] = [
20
  {
21
  model:"gpt-3.5-turbo",
22
  temperature:0.5,
23
- max_tokens:2000,
24
  presence_penalty:0,
25
  sendMemory:true,
26
- historyMessageCount:8,
27
  compressMessageLengthThreshold:1000
28
  },
29
  lang:"cn",
 
20
  {
21
  model:"gpt-3.5-turbo",
22
  temperature:0.5,
23
+ max_tokens:3000,
24
  presence_penalty:0,
25
  sendMemory:true,
26
+ historyMessageCount:10,
27
  compressMessageLengthThreshold:1000
28
  },
29
  lang:"cn",
app/requests.ts CHANGED
@@ -216,6 +216,10 @@ export async function requestChatStream(
216
  onController?: (controller: AbortController) => void;
217
  },
218
  ) {
 
 
 
 
219
  let vip=await isVip()
220
  const Bot = useAppConfig.getState().bot;
221
  if(!vip){
 
216
  onController?: (controller: AbortController) => void;
217
  },
218
  ) {
219
+ if(!useAccessStore.getState().auth){
220
+ options?.onError(new Error("Unauthorized"), 401);
221
+ return
222
+ }
223
  let vip=await isVip()
224
  const Bot = useAppConfig.getState().bot;
225
  if(!vip){
app/store/config.ts CHANGED
@@ -101,15 +101,15 @@ export const ALL_MODELS = [
101
 
102
  export const ALL_BOT = [
103
  {
104
- name: "OpenAI",
105
  available: true,
106
  },
107
  {
108
- name: "OpenAI绘画",
109
  available: true,
110
  },
111
  {
112
- name: "必应",
113
  available: true,
114
  },
115
  // {
@@ -117,7 +117,7 @@ export const ALL_BOT = [
117
  // available: true,
118
  // },
119
  {
120
- name: "万卷",
121
  available: true,
122
  },
123
  {
 
101
 
102
  export const ALL_BOT = [
103
  {
104
+ name: "OpenAI (VIP)",
105
  available: true,
106
  },
107
  {
108
+ name: "OpenAI绘画 (VIP)",
109
  available: true,
110
  },
111
  {
112
+ name: "必应 (VIP)",
113
  available: true,
114
  },
115
  // {
 
117
  // available: true,
118
  // },
119
  {
120
+ name: "万卷 (VIP)",
121
  available: true,
122
  },
123
  {