-- token bug

This commit is contained in:
yuping
2022-12-20 18:35:15 +08:00
parent 6cd7eb3bdc
commit 0bbb4403e7
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
import {reactive, ref, toRefs, watch} from "vue";
import {getCookie} from "@/api/method";
import {getCookieForName} from "@/api/method";
import JSONBigInt from 'json-bigint';
const JSONBigIntStr = JSONBigInt({storeAsString: true});
@@ -143,7 +143,7 @@ export async function request(_url, params) {
return fetch(url, {
method,
headers: {
token: getCookie('token'),
token: getCookieForName('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
...method !== 'get' ? {body: JSON.stringify(body)} : {}