-
Notifications
You must be signed in to change notification settings - Fork 43
Description
感谢作者的开源,我在vite.config.js设置了:
server: {
proxy: {
// 选项写法
‘/api‘: {
target: ‘http://jsonplaceholder.typicode.com‘,
changeOrigin: true,
rewrite: (path) => path.replace(/^/api/, ‘‘),
},
},
},
也在axios.config.ts设置了export const baseURL ='http://192.168.2.103:8080/'
但没有解决 ,信息如下:
Access to XMLHttpRequest at 'http://192.168.2.103:8080/api/rpc/sp_login' from origin 'http://127.0.0.1:5173' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'http://127.0.0.1:5173, http://127.0.0.1:5173', but only one is allowed.
axios.config.ts:58 Error: Network Error
at createError (createError.js:16:15)
at XMLHttpRequest.handleError (xhr.js:117:14)
xhr.js:210 POST http://192.168.2.103:8080/api/rpc/sp_login net::ERR_FAILED 200
请作者指教