浏览代码

add uncached config.json fetch

Mistivia 1 月之前
父节点
当前提交
cd1428d17b
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/main.js

+ 3 - 1
src/main.js

@@ -22,7 +22,9 @@ function fetchJSONSync(url) {
     }
     }
 }
 }
 
 
-globalConfig = fetchJSONSync('./config.json');
+const timestamp = new Date().getTime();
+globalConfig = fetchJSONSync('./config.json' + '?t=' + timestamp);
+
 for (let key in globalConfig) {
 for (let key in globalConfig) {
     if (globalConfig[key]["type"] === undefined) {
     if (globalConfig[key]["type"] === undefined) {
         globalConfig[key].type = 'openai';
         globalConfig[key].type = 'openai';