浏览代码

fix: use no-cache in sync requests (#2280)

Andy Bao 8 月之前
父节点
当前提交
ff609df8cc
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/background/sync/base.js

+ 4 - 2
src/background/sync/base.js

@@ -2,7 +2,9 @@ import {
   debounce, normalizeKeys, request, noop, makePause, ensureArray, sendCmd,
   buffer2string, getRandomString,
 } from '@/common';
-import { TIMEOUT_HOUR } from '@/common/consts';
+import {
+  TIMEOUT_HOUR, NO_CACHE,
+} from '@/common/consts';
 import {
   forEachEntry, objectSet, objectPick,
 } from '@/common/object';
@@ -338,7 +340,7 @@ export const BaseService = serviceFactory({
     progress.total += 1;
     onStateChange();
     return lastFetch.then(() => {
-      options = Object.assign({}, options);
+      options = Object.assign({}, NO_CACHE, options);
       options.headers = Object.assign({}, this.headers, options.headers);
       let { url } = options;
       if (url.startsWith('/')) url = (options.prefix ?? this.urlPrefix) + url;