修复了爆炸现场

main
白封羽 2022-12-26 21:20:24 +08:00
parent 5c55686420
commit 415075c217
3 changed files with 97 additions and 162 deletions

View File

@ -1,3 +1,4 @@
export interface Token { export interface Token {
accessToken: string; accessToken: string;
refreshToken: string; refreshToken: string;

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,8 @@
import axios, {AxiosRequestConfig, AxiosResponse} from "axios"; import axios, {AxiosRequestConfig, AxiosResponse} from "axios";
import {store} from "../models/store";
//export const baseUrl = "https://www.hammer-hfut.tk/api/" export const baseUrl = "http://101.34.228.45:8080/"
export const baseUrl = "https://mock.apifox.cn/m1/2116708-0-ae5ae4e4/" //export const baseUrl = "https://mock.apifox.cn/m1/2116708-0-ae5ae4e4/"
const axiosInstance = axios.create({ const axiosInstance = axios.create({
baseURL: baseUrl, baseURL: baseUrl,
@ -11,7 +12,8 @@ const axiosInstance = axios.create({
axiosInstance.interceptors.request.use( axiosInstance.interceptors.request.use(
function (config: AxiosRequestConfig) { function (config: AxiosRequestConfig) {
console.log(config) console.log(config)
// @ts-ignore
config.headers.Authorization = "bearer "+store.getState().token.accessToken
return config return config
}, },
function (error) { function (error) {