|
@@ -1,7 +1,7 @@
|
|
|
import { appVersionCode, baseAPIUrl } from '@/http/configAPI.js'
|
|
|
import { getChromeStorage } from '@/uilts/chromeExtension.js'
|
|
|
|
|
|
-export async function commonFetch({ url, method = 'POST' , params = {}, baseInfo = {}}) {
|
|
|
+export async function commonFetch({ url = '', method = 'POST' , params = {}, baseInfo = {}}) {
|
|
|
|
|
|
let storage_mid = await getChromeStorage('mid') || ''
|
|
|
const { mid } = storage_mid || {}
|
|
@@ -18,6 +18,9 @@ export async function commonFetch({ url, method = 'POST' , params = {}, baseInfo
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
let _url = baseAPIUrl + url
|
|
|
+ if(url.includes('http')){
|
|
|
+ _url = url
|
|
|
+ }
|
|
|
fetch(_url, {
|
|
|
method: method, // or 'PUT'
|
|
|
cache: 'no-cache',
|