Skip to content

Commit 5fd1748

Browse files
committed
优化部署在revertProxy环境中的basePath无效问题
1 parent db4c243 commit 5fd1748

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

generator-web/src/main/resources/statics/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const vm = new Vue({
121121
generate : function(){
122122
//get value from codemirror
123123
vm.formData.tableSql=$.inputArea.getValue();
124-
axios.post("code/generate",vm.formData).then(function(res){
124+
axios.post(basePath+"/code/generate",vm.formData).then(function(res){
125125
if(res.code===500){
126126
error("生成失败");
127127
return;
@@ -146,7 +146,7 @@ const vm = new Vue({
146146
},
147147
created: function () {
148148
//load all templates for selections 加载所有模板供选择
149-
axios.post("template/all",{
149+
axios.post(basePath+"/template/all",{
150150
id:1234
151151
}).then(function(res){
152152
//console.log(res.templates);

generator-web/src/main/resources/templates/header.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
var s = document.getElementsByTagName("script")[0];
1414
s.parentNode.insertBefore(hm, s);
1515
})();
16+
17+
var basePath = "${request.contextPath}";
18+
console.log("basePath",basePath)
1619
</script>
1720

1821
<#if value.mode=='local'>

generator-web/src/main/resources/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h5 class="card-title m-0">输出代码</h5>
113113
<footer class="main-footer">
114114
<!-- To the right -->
115115
<div class="float-right d-none d-sm-inline">
116-
Version 2024 April
116+
Version ${(value.version)!!}
117117
</div>
118118
<!-- Default to the left -->
119119
<strong>Powered by Moshow郑锴 , Might the holy light be with you ! <a href="https://zhengkai.blog.csdn.net" target="_blank"><i class="fa fa-fw fa-thumbs-up"></i>zhengkai.blog.csdn.net</a> <a href="https://github.com/moshowgame/SpringBootCodeGenerator/blob/master/donate.png?raw=true" target="_blank"><i class="fa fa-fw fa-credit-card"></i>打赏</a>

generator-web/src/main/resources/templates/main-v2.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
<head>
44
<#include "/header.html">
55
<style>
6-
.el-form-item__content{
6+
/* .el-form-item__content{
77
line-height : 10px;
8-
}
8+
} */
99
/*.el-form-item--mini .el-form-item__content, .el-form-item--mini .el-form-item__label{
1010
line-height : 10px;
1111
}*/
12-
.el-button-group-top {
12+
/* .el-button-group-top {
1313
padding-top: 5px;
14-
}
15-
</style>
14+
} */
15+
.el-button--primary.is-plain.is-disabled, .el-button--primary.is-plain.is-disabled:active, .el-button--primary.is-plain.is-disabled:focus, .el-button--primary.is-plain.is-disabled:hover {
16+
color: #f9faff;
17+
background-color: #91979d;
18+
border-color: #d9ecff;
19+
font-weight: bold;
20+
}
21+
</style>
1622
</head>
1723
<body>
1824

0 commit comments

Comments
 (0)