修改本地php请求

This commit is contained in:
YeMingfei666 2025-08-19 09:44:48 +08:00
parent c20cb8cfbc
commit d2a56965fc
2 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,8 @@ export const productUrl='dj-admin';
// const baseUrl = "https://web-api.hnsiyao.cn/czg/" //测试 // const baseUrl = "https://web-api.hnsiyao.cn/czg/" //测试
// const baseUrl = "https://web.hnsiyao.cn/czg/" // 线上 // const baseUrl = "https://web.hnsiyao.cn/czg/" // 线上
// const baseUrl = "http://192.168.1.31:8080/admin/" // php本地 // 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{ export default{
baseUrl baseUrl

View File

@ -33,9 +33,9 @@ const http = axios.create({
http.interceptors.request.use(config => { http.interceptors.request.use(config => {
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
// config.baseURL = $urlMap[$env] // 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 = 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/" // config.url = "https://dj-api.hnsiyao.cn/czg/"
return config return config
}, error => { }, error => {