| | |
| | |
|
| | | /*
|
| | | * @LastEditors: Please set LastEditors
|
| | | * @LastEditTime: 2022-10-11 16:09:59
|
| | | * @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) {
|
| | |
| | | * @param {Params} params
|
| | | * @return {*}
|
| | | */
|
| | | export const GETNOBASE = async (url: string, params: Params): Promise<any> => {
|
| | | export const GETNOBASE = async (url: string, params?: Params): Promise<any> => {
|
| | | try {
|
| | | const data = await axios.get(url, {
|
| | | params: params,
|