Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage into develop

This commit is contained in:
zhangyc
2022-12-20 08:36:16 +08:00

View File

@@ -1,8 +1,9 @@
import { reactive, ref, toRefs, watch } from "vue";
import { getCookie } from "@/api/method";
import {reactive, ref, toRefs, watch} from "vue";
import {getCookie} from "@/api/method";
import JSONBigInt from 'json-bigint';
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
const JSONBigIntStr = JSONBigInt({storeAsString: true});
export function useBoeApiPage(_url, params = {}, config = {
init: true,
result: res => res.result,
@@ -138,14 +139,14 @@ export async function request(_url, params) {
}
}
const body = method !== 'get' ? params || {} : {}
url = process.env.VUE_APP_BOE_API_URL + url
url = process.env.NODE_ENV === 'development' ? url : process.env.VUE_APP_BOE_API_URL + url
return fetch(url, {
method,
headers: {
token: getCookie('token'),
...method !== 'get' ? { 'Content-Type': 'application/json' } : {}
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
...method !== 'get' ? { body: JSON.stringify(body) } : {}
...method !== 'get' ? {body: JSON.stringify(body)} : {}
}).then(res => {
return res.text()
}).then(res => {