生产环境和开发环境判断
This commit is contained in:
parent
e5e97d2598
commit
7c377f02eb
|
|
@ -2,9 +2,12 @@ import axios from 'axios';
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { showNotify } from 'vant';
|
import { showNotify } from 'vant';
|
||||||
|
|
||||||
// const url = 'http://192.168.0.230';
|
let url = '';
|
||||||
const url = window.location.origin;
|
if(import.meta.env.MODE === 'development'){
|
||||||
|
url = 'http://192.168.0.230';
|
||||||
|
}else{
|
||||||
|
url = window.location.origin;
|
||||||
|
}
|
||||||
axios.defaults.baseURL = url;
|
axios.defaults.baseURL = url;
|
||||||
axios.defaults.withCredentials = false;
|
axios.defaults.withCredentials = false;
|
||||||
axios.defaults.timeout = 200000;
|
axios.defaults.timeout = 200000;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue