| | |
| | |
|
| | | /*
|
| | | * @LastEditors: Please set LastEditors
|
| | | * @LastEditTime: 2022-10-25 15:34:56
|
| | | * @LastEditTime: 2023-05-08 17:44:36
|
| | | */
|
| | | import axios from 'axios';
|
| | |
|
| | |
| | | export { baseUrl };
|
| | | // axios.defaults.withCredentials = true;
|
| | | // 添加请求拦截器
|
| | | axios.interceptors.request.use(function (config: AxiosRequestConfig) {
|
| | | axios.interceptors.request.use(function (config: AxiosRequestConfig):any {
|
| | | // 在发送请求之前做些什么 传token
|
| | | let token: any = getLocalStorage(StorageEnum.GB_TOKEN_STORE);
|
| | | if (token) {
|
| | |
| | | */
|
| | | export const GETNOBASE = async (url: string, params?: Params): Promise<any> => {
|
| | | try {
|
| | | const data = await axios.get(location.pathname+url, {
|
| | | const data = await axios.get(url, {
|
| | | params: params,
|
| | | });
|
| | | return data;
|