fix: fix proxy for swagger (#471)

This commit is contained in:
Товарищ программист 2022-02-04 20:00:40 +08:00 committed by GitHub
parent e5e1fdae76
commit db44957b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View File

@ -3,10 +3,22 @@ const CracoLessPlugin = require('craco-less');
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
}
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
'/swagger': {
target: 'http://localhost:8000',
changeOrigin: true,
},
'/files': {
target: 'http://localhost:8000',
changeOrigin: true,
},
'/.well-known/openid-configuration': {
target: 'http://localhost:8000',
changeOrigin: true,
}
},
},
plugins: [
@ -15,7 +27,7 @@ module.exports = {
options: {
lessLoaderOptions: {
lessOptions: {
modifyVars: { '@primary-color': 'rgb(45,120,213)' },
modifyVars: {'@primary-color': 'rgb(45,120,213)'},
javascriptEnabled: true,
},
},

View File

@ -410,7 +410,7 @@ class App extends Component {
);
res.push(
<Menu.Item key="/swagger">
<a target="_blank" rel="noreferrer" href={Setting.isLocalhost() ? `${Setting.getFullServerUrl()}/swagger` : "/swagger"}>
<a target="_blank" rel="noreferrer" href={Setting.isLocalhost() ? `${Setting.ServerUrl}/swagger` : "/swagger"}>
{i18next.t("general:Swagger")}
</a>
</Menu.Item>