Skip to content

Commit

Permalink
1._this.certloading = false; 被移动到了 axios 异步请求的回调函数中,以确保在请求完成后再将 this.…
Browse files Browse the repository at this point in the history
…certloading 设置为 false。

2.用sh执行脚本不需要可执行权限
  • Loading branch information
potongren committed Jan 3, 2024
1 parent aaa15b5 commit 6cfab20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/podcast/Servlet/UserServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public void certificateServlet(HttpServletRequest request, HttpServletResponse r
String domain = request.getParameter("domain");
//执行申请证书脚本
Process exec = Runtime.getRuntime()
.exec("/opt/tomcat/tomcat8/webapps/podcast2/tmp/install_ca.sh " + domain + " /opt/tomcat/tomcat8/cert/podcast2");
.exec("sh /opt/tomcat/tomcat8/webapps/podcast2/tmp/install_ca.sh " + domain + " /opt/tomcat/tomcat8/cert/podcast2");
int exitCode = exec.waitFor();

//返回退出码
response.getWriter().write(exitCode);
response.getWriter().write(exitCode+"");

}

Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/js/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ new Vue({
//申请CA证书
certificates(){
_this=this;

if (this.certificatesDomain==null){

this.$message.error('请输入你的域名!');
Expand All @@ -662,13 +661,14 @@ new Vue({
type: 'success'
});
}else {
this.certloading=true
_this.certloading = true
//发送到服务端
axios({
method:"post",
url:"./user/certificateServlet",
data:"domain="+_this.certificatesDomain
}).then(function (resp) {
_this.certloading = false;
if (resp.data == "0"){
//提示成功
_this.$message({
Expand All @@ -681,7 +681,7 @@ new Vue({
}
})
}
this.certloading=false;

}
},
});

0 comments on commit 6cfab20

Please sign in to comment.