处理双//请求问题

This commit is contained in:
YeMingfei666 2024-12-30 19:17:03 +08:00
parent 8e1c9d8e1d
commit 830991def7
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const requestURl = "https://web-api.hnsiyao.cn/czg/";//测试
*/
http.interceptors.request.use(config => {
config.headers['token'] = Vue.cookie.get('token') // 请求头带上token
config.url=config.url.replace(/(?!https:\/\/)(\/+)/g, '/');
config.url=config.url.replace('czg//','czg/')
return config
}, error => {
return Promise.reject(error)