有一專案
后臺:.net core
前端:vue3
在centos nginx中部署如下
后臺可以瀏覽器正常訪問,
http://www.somehwhtj.com:8000/swagger/index.html
前端為vue3
在vue.config.js中
proxy: {
'/api': {
target: define.APIURl,
//APIURI在src/utils/define.js中定義,提供
此處為http://www.somehwhtj.com:8000
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
介面轉發
但是前端在瀏覽器中登錄時提示:CORS erros
我把地址復制出來是這樣:
http://www.somehwhtj.com:8000/api/Common/Login/Login?n=1620373222
我把這個地址拷貝到瀏覽器中去訪問,則跳轉到了
https://localhost:5001/api/Common/Login/Login?n=1620373222
求解決方法
同樣的專案,部署在IIS中沒有問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/283411.html
標籤:JavaScript
下一篇:Css
