diff --git a/class/core/site_api.py b/class/core/site_api.py index 670228fa1..e992b55e3 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -666,13 +666,6 @@ class site_api: path = self.sslDir + '/' + site_name csr_path = path + '/fullchain.pem' # 生成证书路径 - file = self.getHostConf(site_name) - content = mw.readFile(file) - key_text = 'ssl_certificate' - status = True - if content.find(key_text) == -1: - status = False - if ssl_type == 'lets': ssl_lets_dir = self.sslLetsDir + '/' + site_name csr_lets_path = ssl_lets_dir + '/fullchain.pem' # 生成证书路径 @@ -684,6 +677,13 @@ class site_api: if mw.md5(mw.readFile(csr_acme_path)) == mw.md5(mw.readFile(csr_path)): return mw.returnJson(False, '已部署Acme') + file = self.getHostConf(site_name) + content = mw.readFile(file) + key_text = 'ssl_certificate' + status = True + if content.find(key_text) == -1: + status = False + def getLetLogsApi(self): log_file = mw.getRunDir() + '/logs/letsencrypt.log' if not os.path.exists(log_file): diff --git a/route/static/app/site.js b/route/static/app/site.js index b9f89770c..8e2e727b0 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -1789,7 +1789,14 @@ function httpToHttps(siteName){ function deleteSSL(type,id,siteName){ $.post('/site/delete_ssl','site_name='+siteName+'&ssl_type='+type,function(rdata){ - layer.msg(rdata.msg,{icon:rdata.status?1:2}); + showMsg(rdata.msg, function(){ + opSSL(type,id,siteName); + },{icon:rdata.status?1:2}, 2000); + },'json'); +} + +function deploySSL(type,id,siteName){ + $.post('/site/deploy_ssl','site_name='+siteName+'&ssl_type='+type,function(rdata){ showMsg(rdata.msg, function(){ opSSL(type,id,siteName); },{icon:rdata.status?1:2}, 2000); @@ -1946,7 +1953,7 @@ function opSSL(type, id, siteName, callback){
证书(PEM格式)
\ \
\ - \ + \ \ \
\ @@ -2031,7 +2038,7 @@ function opSSL(type, id, siteName, callback){
证书(PEM格式)
\ \
\ - \ + \ \
\ \