From 96cfc17f191fee0a05070ec8e7bb6fb099f0231c Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期三, 24 十二月 2025 14:28:42 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/config/config.js |  112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 112 insertions(+), 0 deletions(-)

diff --git a/src/main/webapp/static/js/config/config.js b/src/main/webapp/static/js/config/config.js
index 4043b9c..12ea9c0 100644
--- a/src/main/webapp/static/js/config/config.js
+++ b/src/main/webapp/static/js/config/config.js
@@ -130,6 +130,24 @@
                     });
                 }
                 break;
+            case 'refreshCache':
+                layer.confirm('纭畾鍒锋柊Redis缂撳瓨鍚�', function(){
+                    $.ajax({
+                        url: baseUrl+"/config/refreshCache",
+                        headers: {'token': localStorage.getItem('token')},
+                        method: 'POST',
+                        success: function (res) {
+                            if (res.code === 200){
+                                layer.msg('鍒锋柊鎴愬姛');
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            } else {
+                                layer.msg(res.msg)
+                            }
+                        }
+                    })
+                });
+                break;
             case 'exportData':
                 layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
                     var titles=[];
@@ -168,6 +186,100 @@
                     });
                 });
                 break;
+            case 'serverInfo':
+                $.ajax({
+                    url: baseUrl + "/license/getServerInfos",
+                    headers: {'token': localStorage.getItem('token')},
+                    method: 'GET',
+                    success: function (res) {
+                        var pretty = '';
+                        try {
+                            pretty = JSON.stringify(res, null, 2);
+                        } catch (e) {
+                            pretty = res;
+                        }
+                        var html = ''
+                            + '<div style="padding:15px 20px 5px 20px;">'
+                            +   '<div style="font-weight:600;margin-bottom:8px;">绯荤粺閰嶇疆淇℃伅</div>'
+                            +   '<pre id="server-info-pre" style="background:#f7f7f7;border:1px solid #e6e6e6;border-radius:6px;padding:12px;white-space:pre-wrap;word-wrap:break-word;max-height:360px;overflow:auto;">'
+                            +       pretty
+                            +   '</pre>'
+                            +   '<div class="layui-btn-container" style="text-align:right;margin-top:6px;">'
+                            +       '<button class="layui-btn layui-btn-primary" id="copy-server-info">澶嶅埗</button>'
+                            +   '</div>'
+                            + '</div>';
+                        layer.open({
+                            type: 1,
+                            title: '鑾峰彇绯荤粺閰嶇疆',
+                            area: ['640px','480px'],
+                            shadeClose: true,
+                            content: html,
+                            success: function (layero, index) {
+                                layero.find('#copy-server-info').on('click', function () {
+                                    var text = layero.find('#server-info-pre').text();
+                                    if (navigator.clipboard && navigator.clipboard.writeText) {
+                                        navigator.clipboard.writeText(text).then(function () {
+                                            layer.msg('宸插鍒跺埌鍓创鏉�');
+                                        }).catch(function () {
+                                            try {
+                                                var textarea = document.createElement('textarea');
+                                                textarea.value = text;
+                                                textarea.style.position = 'fixed';
+                                                textarea.style.opacity = '0';
+                                                document.body.appendChild(textarea);
+                                                textarea.select();
+                                                document.execCommand('copy');
+                                                document.body.removeChild(textarea);
+                                                layer.msg('宸插鍒跺埌鍓创鏉�');
+                                            } catch (err) {
+                                                layer.msg('澶嶅埗澶辫触');
+                                            }
+                                        });
+                                    } else {
+                                        try {
+                                            var textarea = document.createElement('textarea');
+                                            textarea.value = text;
+                                            textarea.style.position = 'fixed';
+                                            textarea.style.opacity = '0';
+                                            document.body.appendChild(textarea);
+                                            textarea.select();
+                                            document.execCommand('copy');
+                                            document.body.removeChild(textarea);
+                                            layer.msg('宸插鍒跺埌鍓创鏉�');
+                                        } catch (err) {
+                                            layer.msg('澶嶅埗澶辫触');
+                                        }
+                                    }
+                                });
+                            }
+                        });
+                    },
+                    error: function () {
+                        layer.msg('鑾峰彇绯荤粺閰嶇疆淇℃伅澶辫触');
+                    }
+                });
+                break;
+            case 'activate':
+                layer.confirm('纭畾鎵ц涓�閿縺娲诲悧', function(){
+                    $.ajax({
+                        url: baseUrl + "/license/activate",
+                        headers: {'token': localStorage.getItem('token')},
+                        method: 'POST',
+                        success: function (res) {
+                            if (res.code === 200){
+                                layer.msg('婵�娲绘垚鍔�');
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            } else {
+                                layer.msg(res.msg)
+                            }
+                        },
+                        error: function () {
+                            layer.msg('婵�娲诲け璐�');
+                        }
+                    });
+                });
+                break;
         }
     });
 

--
Gitblit v1.9.1