From a9a6615eb083d6fa034c58576e7feac9367e329f Mon Sep 17 00:00:00 2001 From: bentz Date: Tue, 23 Nov 2021 18:24:12 +0800 Subject: [PATCH] chore: update jsconfig --- jsconfig.json | 10 ++++++++++ src/api/req.js | 9 ++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 000000000..fb3c25001 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,10 @@ +{ + "exclude": ["node_modules", "dist"], + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, + "experimentalDecorators": true + } +} diff --git a/src/api/req.js b/src/api/req.js index ec86840c4..16b4196b3 100644 --- a/src/api/req.js +++ b/src/api/req.js @@ -1,15 +1,10 @@ import Taro from '@tarojs/taro' import qs from 'qs' import S from '@/spx' -import { isAlipay, isWeixin } from '@/utils' +import { isAlipay, isWeixin, isWeb } from '@/utils' import log from '@/utils/log' import { HTTP_STATUS } from './consts' -let demoIsTokenRefreshed = true -setTimeout(() => { - demoIsTokenRefreshed = false -}, 0); - class RequestQueue { constructor() { this.requestList = [] @@ -315,7 +310,7 @@ class API { } } -if (process.env.NODE_ENV === 'production') { +if (process.env.NODE_ENV === 'production' && !isWeb) { Taro.addInterceptor(Taro.interceptors.logInterceptor) }