修改本地php请求
This commit is contained in:
parent
c20cb8cfbc
commit
d2a56965fc
|
|
@ -7,7 +7,8 @@ export const productUrl='dj-admin';
|
|||
// const baseUrl = "https://web-api.hnsiyao.cn/czg/" //测试
|
||||
// const baseUrl = "https://web.hnsiyao.cn/czg/" // 线上
|
||||
// const baseUrl = "http://192.168.1.31:8080/admin/" // php本地
|
||||
const baseUrl = "https://playlet.test.sxczgkj.com/admin/" // php测试服
|
||||
// const baseUrl = "https://playlet.test.sxczgkj.com/admin/" // php测试服
|
||||
const baseUrl = "http://192.168.1.10:8787/czg/" // php测试服
|
||||
|
||||
export default{
|
||||
baseUrl
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ const http = axios.create({
|
|||
http.interceptors.request.use(config => {
|
||||
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
|
||||
// config.baseURL = $urlMap[$env]
|
||||
const arr = config.url.split('admin/')
|
||||
const arr = config.url.split('czg/')
|
||||
config.url = baseUrl + (arr.length >= 2 ? arr[1] : arr[0])
|
||||
config.url = config.url.replace('admin//', 'admin/');
|
||||
config.url = config.url.replace('czg//', 'czg/');
|
||||
// config.url = "https://dj-api.hnsiyao.cn/czg/"
|
||||
return config
|
||||
}, error => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue