From 5fd17483f79e767a90dbc824f535e7e3fe4f3e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moshow=E9=83=91=E9=94=B4?= Date: Tue, 23 Apr 2024 21:26:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E7=BD=B2=E5=9C=A8re?= =?UTF-8?q?vertProxy=E7=8E=AF=E5=A2=83=E4=B8=AD=E7=9A=84basePath=E6=97=A0?= =?UTF-8?q?=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/statics/js/main.js | 4 ++-- .../src/main/resources/templates/header.html | 3 +++ .../src/main/resources/templates/index.html | 2 +- .../src/main/resources/templates/main-v2.html | 16 +++++++++++----- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/generator-web/src/main/resources/statics/js/main.js b/generator-web/src/main/resources/statics/js/main.js index 369de1c..3cd412d 100644 --- a/generator-web/src/main/resources/statics/js/main.js +++ b/generator-web/src/main/resources/statics/js/main.js @@ -121,7 +121,7 @@ const vm = new Vue({ generate : function(){ //get value from codemirror vm.formData.tableSql=$.inputArea.getValue(); - axios.post("code/generate",vm.formData).then(function(res){ + axios.post(basePath+"/code/generate",vm.formData).then(function(res){ if(res.code===500){ error("生成失败"); return; @@ -146,7 +146,7 @@ const vm = new Vue({ }, created: function () { //load all templates for selections 加载所有模板供选择 - axios.post("template/all",{ + axios.post(basePath+"/template/all",{ id:1234 }).then(function(res){ //console.log(res.templates); diff --git a/generator-web/src/main/resources/templates/header.html b/generator-web/src/main/resources/templates/header.html index aaa6bf3..93a22a9 100644 --- a/generator-web/src/main/resources/templates/header.html +++ b/generator-web/src/main/resources/templates/header.html @@ -13,6 +13,9 @@ var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); + + var basePath = "${request.contextPath}"; + console.log("basePath",basePath) <#if value.mode=='local'> diff --git a/generator-web/src/main/resources/templates/index.html b/generator-web/src/main/resources/templates/index.html index bae48d5..b0557f1 100644 --- a/generator-web/src/main/resources/templates/index.html +++ b/generator-web/src/main/resources/templates/index.html @@ -113,7 +113,7 @@ by https://zhengkai.blog.csdn.net