Browse Source

fix: #3207 ensure corner case

Yidadaa 1 year ago
parent
commit
cb140e482f
2 changed files with 4 additions and 2 deletions
  1. 1 1
      README_CN.md
  2. 3 1
      app/utils/clone.ts

+ 1 - 1
README_CN.md

@@ -138,7 +138,7 @@ Azure Api 版本,你可以在这里找到:[Azure 文档](https://learn.micro
 OPENAI_API_KEY=<your api key here>
 
 # 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址
-BASE_URL=https://nb.nextweb.fun/api/proxy
+BASE_URL=https://ab.nextweb.fun/api/proxy
 ```
 
 ### 本地开发

+ 3 - 1
app/utils/clone.ts

@@ -6,5 +6,7 @@ export function ensure<T extends object>(
   obj: T,
   keys: Array<[keyof T][number]>,
 ) {
-  return keys.every((k) => obj[k] !== undefined && obj[k] !== null);
+  return keys.every(
+    (k) => obj[k] !== undefined && obj[k] !== null && obj[k] !== "",
+  );
 }