Commit 8f96f33a authored by zhengke's avatar zhengke

调整请求接口

parent 5b191608
...@@ -3,6 +3,7 @@ import Axios, { ...@@ -3,6 +3,7 @@ import Axios, {
InternalAxiosRequestConfig, InternalAxiosRequestConfig,
AxiosError, AxiosError,
} from 'axios'; } from 'axios';
import { domainManager } from '@/utils/domainManager'
let datas: AxiosResponse let datas: AxiosResponse
export enum ApiResult{ export enum ApiResult{
...@@ -65,7 +66,7 @@ const getErrorCode2text = (response: AxiosResponse): string => { ...@@ -65,7 +66,7 @@ const getErrorCode2text = (response: AxiosResponse): string => {
* service.get<{data: string; code: number}>('/test').then(({data}) => { console.log(data.code) }) * service.get<{data: string; code: number}>('/test').then(({data}) => { console.log(data.code) })
*/ */
const service = Axios.create({ const service = Axios.create({
baseURL: 'http://192.168.10.214/api/common/post', baseURL: `${domainManager().domainUrl}`,//'http://192.168.10.214/api/common/post'
timeout: 20000, timeout: 20000,
headers: { headers: {
'User-Type': 'bus', 'User-Type': 'bus',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment