mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 11:56:46 +08:00
Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage into develop
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
import { reactive, ref, toRefs, watch } from "vue";
|
import {reactive, ref, toRefs, watch} from "vue";
|
||||||
import { getCookie } from "@/api/method";
|
import {getCookie} from "@/api/method";
|
||||||
import JSONBigInt from 'json-bigint';
|
import JSONBigInt from 'json-bigint';
|
||||||
|
|
||||||
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
|
const JSONBigIntStr = JSONBigInt({storeAsString: true});
|
||||||
|
|
||||||
export function useBoeApiPage(_url, params = {}, config = {
|
export function useBoeApiPage(_url, params = {}, config = {
|
||||||
init: true,
|
init: true,
|
||||||
result: res => res.result,
|
result: res => res.result,
|
||||||
@@ -138,14 +139,14 @@ export async function request(_url, params) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const body = method !== 'get' ? 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, {
|
return fetch(url, {
|
||||||
method,
|
method,
|
||||||
headers: {
|
headers: {
|
||||||
token: getCookie('token'),
|
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 => {
|
}).then(res => {
|
||||||
return res.text()
|
return res.text()
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user