去除请求里的//

This commit is contained in:
YeMingfei666 2024-12-30 18:28:08 +08:00
parent 9b24bee14e
commit 8e1c9d8e1d
1 changed files with 3 additions and 3 deletions

View File

@ -14,15 +14,15 @@ const http = axios.create({
})
// const requestURl = "http://localhost:8100/czg/";
const requestURl = "https://web-api.hnsiyao.cn/czg/";
// const requestURl = "https://web.hnsiyao.cn/czg/";
const requestURl = "https://web-api.hnsiyao.cn/czg/";//测试
// const requestURl = "https://web.hnsiyao.cn/czg/";//正式
/**
* 请求拦截
*/
http.interceptors.request.use(config => {
console.log(Vue.cookie.get('token'))
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
config.url=config.url.replace(/(?!https:\/\/)(\/+)/g, '/');
return config
}, error => {
return Promise.reject(error)