From 686fe55892de7bf8d206cddbead77a5fbdb0e091 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期日, 08 三月 2026 19:59:29 +0800
Subject: [PATCH] #
---
src/main/webapp/views/login.html | 254 +++++++++++++++++++++++++++++---------------------
1 files changed, 147 insertions(+), 107 deletions(-)
diff --git a/src/main/webapp/views/login.html b/src/main/webapp/views/login.html
index d82ce9a..5094c39 100644
--- a/src/main/webapp/views/login.html
+++ b/src/main/webapp/views/login.html
@@ -88,11 +88,6 @@
<div id="login-wrapper" class="animate__animated animate__bounceInDown">
<header>
<h2 id="login-title" style="cursor: pointer; user-select: none;">WCS绯荤粺V3.0</h2>
- <div id="system-btns" style="display: none; margin-bottom: 20px;">
- <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-project-name">鑾峰彇椤圭洰鍚嶇О</button>
- <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-server-info">鑾峰彇绯荤粺閰嶇疆</button>
- <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-activate">涓�閿縺娲�</button>
- </div>
</header>
<div class="layui-form layadmin-user-login-body">
<div class="layui-form-item">
@@ -103,18 +98,27 @@
<label class="layui-icon layui-icon-password layadmin-user-login-icon"></label>
<input id="password" class="layui-input" type="password" name="password" lay-verify="password" placeholder="瀵嗙爜">
</div>
-<!-- <div id="code-box" class="layui-form-item" style="">-->
-<!-- <label id="code-label" class="layui-icon layui-icon-vercode layadmin-user-login-icon"></label>-->
-<!-- <input id="code" class="layui-input" type="text" name="password" lay-verify="code" placeholder="楠岃瘉鐮�">-->
-<!-- <img id="codeImg" title="鐪嬩笉娓咃紵鐐瑰嚮鎹竴寮犮��">-->
-<!-- </div>-->
- <!--<div class="layui-form-item">-->
- <!--<input id="rememberPwd" style="vertical-align: middle" type="checkbox" lay-filter="remPwd" lay-skin="switch" lay-text="寮�鍚瘄鍏抽棴" title="璁颁綇瀵嗙爜" checked="checked">-->
- <!--<span style="vertical-align: middle;font-size: 15px">璁颁綇瀵嗙爜</span>-->
- <!--</div>-->
</div>
<div class="layui-form-item login-submit">
<button id="login-button" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">鐧�     褰�</button>
+ </div>
+</div>
+<div id="system-tools-panel" style="display: none; padding: 20px;">
+ <div style="margin-bottom: 18px;">
+ <div style="margin-bottom: 10px; color: #666; font-weight: 600;">鎺ㄨ崘鎿嶄綔</div>
+ <div style="display: flex; flex-wrap: wrap; gap: 12px;">
+ <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-request-code">鑾峰彇璇锋眰鐮�</button>
+ <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-activate">涓�閿縺娲�</button>
+ </div>
+ <div style="margin-top: 8px; color: #999; font-size: 12px;">浼樺厛浣跨敤鈥滆幏鍙栬姹傜爜鈥濆拰鈥滀竴閿縺娲烩�濆畬鎴愯鍙瘉鐢宠涓庢縺娲汇��</div>
+ </div>
+ <div>
+ <div style="margin-bottom: 10px; color: #666; font-weight: 600;">鍏朵粬宸ュ叿</div>
+ <div style="display: flex; flex-wrap: wrap; gap: 12px;">
+ <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-project-name">鑾峰彇椤圭洰鍚嶇О</button>
+ <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-server-info">鑾峰彇绯荤粺閰嶇疆</button>
+ <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-upload-license">褰曞叆璁稿彲璇�</button>
+ </div>
</div>
</div>
@@ -122,40 +126,6 @@
<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../static/js/tools/md5.js"></script>
<script type="text/javascript">
-
- // // 楠岃瘉鐮佸紑鍏�
- // var codeSwitch = 'Y';
- // $.ajax({
- // url: baseUrl+"/code/switch.action",
- // async: false,
- // success: function (res) {
- // if (res.data === 'N'){
- // codeSwitch = res.data;
- // $('#code-box').css("display", "none");
- // }
- // }
- // });
-
- // // 鍒濆鍖栭獙璇佺爜
- // initCode();
- // $('#codeImg').click(function () {
- // initCode();
- // });
- // function initCode() {
- // var random = Math.random();
- // $('#codeImg').attr("src", baseUrl+"/code.action?sd="+random);
- // setTimeout(function () {
- // $.ajax({
- // url: baseUrl+"/code.do",
- // data: {sd: random},
- // method: 'POST',
- // async: false,
- // success: function (code) {
- // sessionStorage.setItem("code", code);
- // }
- // });
- // }, 100);
- // }
layui.use(['form','layer'],function () {
var form = layui.form,
@@ -171,8 +141,8 @@
clearTimeout(titleClickTimer);
}
if (titleClickCount >= 3) {
- $('#system-btns').show();
titleClickCount = 0;
+ openSystemToolsDialog();
} else {
titleClickTimer = setTimeout(function() {
titleClickCount = 0;
@@ -180,56 +150,18 @@
}
});
- // 鑾峰彇绯荤粺閰嶇疆
- $('#btn-server-info').click(function() {
- $.ajax({
- url: baseUrl + "/license/getServerInfos",
- 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 () {
- fallbackCopy(text);
- });
- } else {
- fallbackCopy(text);
- }
- });
- }
- });
- },
- error: function () {
- layer.msg('鑾峰彇绯荤粺閰嶇疆淇℃伅澶辫触');
+ function openSystemToolsDialog() {
+ layer.open({
+ type: 1,
+ title: '绯荤粺宸ュ叿',
+ area: ['560px', '300px'],
+ shadeClose: true,
+ content: $('#system-tools-panel'),
+ end: function () {
+ $('#system-tools-panel').hide();
}
});
- return false;
- });
+ }
function fallbackCopy(text) {
try {
@@ -246,6 +178,123 @@
layer.msg('澶嶅埗澶辫触');
}
}
+
+ function openTextDialog(title, label, text, tip) {
+ var html = ''
+ + '<div style="padding:15px 20px 5px 20px;">'
+ + '<div style="font-weight:600;margin-bottom:8px;">' + label + '</div>'
+ + (tip ? '<div style="color:#999;margin-bottom:8px;">' + tip + '</div>' : '')
+ + '<textarea id="dialog-text" readonly style="width:100%;min-height:220px;background:#f7f7f7;border:1px solid #e6e6e6;border-radius:6px;padding:12px;line-height:1.6;resize:none;">'
+ + text
+ + '</textarea>'
+ + '<div class="layui-btn-container" style="text-align:right;margin-top:10px;">'
+ + '<button class="layui-btn layui-btn-primary" id="copy-dialog-text">澶嶅埗</button>'
+ + '</div>'
+ + '</div>';
+ layer.open({
+ type: 1,
+ title: title,
+ area: ['720px','460px'],
+ shadeClose: true,
+ content: html,
+ success: function (layero) {
+ layero.find('#copy-dialog-text').on('click', function () {
+ var value = layero.find('#dialog-text').val();
+ if (navigator.clipboard && navigator.clipboard.writeText) {
+ navigator.clipboard.writeText(value).then(function () {
+ layer.msg('宸插鍒跺埌鍓创鏉�');
+ }).catch(function () {
+ fallbackCopy(value);
+ });
+ } else {
+ fallbackCopy(value);
+ }
+ });
+ }
+ });
+ }
+
+ // 鑾峰彇璇锋眰鐮�
+ $('#btn-request-code').click(function() {
+ $.ajax({
+ url: baseUrl + "/license/getRequestCode",
+ method: 'GET',
+ success: function (res) {
+ if (res.code === 200){
+ openTextDialog('鑾峰彇璇锋眰鐮�', '璇锋眰鐮�', res.msg || '', '璇锋眰鐮佷腑宸插寘鍚」鐩悕绉帮紝鐩存帴鍙戠粰璁稿彲璇佹湇鍔$鍗冲彲銆�');
+ } else {
+ layer.msg(res.msg || '鑾峰彇璇锋眰鐮佸け璐�');
+ }
+ },
+ error: function () {
+ layer.msg('鑾峰彇璇锋眰鐮佸け璐�');
+ }
+ });
+ return false;
+ });
+
+ // 鑾峰彇绯荤粺閰嶇疆
+ $('#btn-server-info').click(function() {
+ $.ajax({
+ url: baseUrl + "/license/getServerInfos",
+ method: 'GET',
+ success: function (res) {
+ var pretty = '';
+ try {
+ pretty = JSON.stringify(res, null, 2);
+ } catch (e) {
+ pretty = res;
+ }
+ openTextDialog('鑾峰彇绯荤粺閰嶇疆', '绯荤粺閰嶇疆淇℃伅', pretty, '鑰侀」鐩粛鍙户缁娇鐢ㄨ繖浠界‖浠朵俊鎭� JSON 鐢宠璁稿彲璇併��');
+ },
+ error: function () {
+ layer.msg('鑾峰彇绯荤粺閰嶇疆淇℃伅澶辫触');
+ }
+ });
+ return false;
+ });
+
+ // 褰曞叆璁稿彲璇�
+ $('#btn-upload-license').click(function () {
+ layer.open({
+ type: 1,
+ title: '褰曞叆璁稿彲璇�',
+ area: ['760px', '420px'],
+ shadeClose: true,
+ content: ''
+ + '<div style="padding:15px 20px 5px 20px;">'
+ + '<div style="font-weight:600;margin-bottom:8px;">璁稿彲璇� Base64</div>'
+ + '<div style="color:#999;margin-bottom:8px;">灏嗚鍙瘉鏈嶅姟绔繑鍥炵殑 license 瀛楁瀹屾暣绮樿创鍒拌繖閲屻��</div>'
+ + '<textarea id="license-base64-input" style="width:100%;min-height:240px;background:#fff;border:1px solid #e6e6e6;border-radius:6px;padding:12px;line-height:1.6;resize:none;"></textarea>'
+ + '</div>',
+ btn: ['鎻愪氦', '鍙栨秷'],
+ yes: function (index, layero) {
+ var license = $.trim(layero.find('#license-base64-input').val());
+ if (!license) {
+ layer.msg('璁稿彲璇佸唴瀹逛笉鑳戒负绌�');
+ return;
+ }
+ $.ajax({
+ url: baseUrl + '/license/updateLicense',
+ method: 'POST',
+ contentType: 'application/json;charset=UTF-8',
+ data: JSON.stringify({license: license}),
+ success: function (res) {
+ if (res.code === 200) {
+ layer.close(index);
+ layer.msg('璁稿彲璇佹洿鏂版垚鍔�');
+ } else {
+ layer.msg(res.msg || '璁稿彲璇佹洿鏂板け璐�');
+ }
+ },
+ error: function () {
+ layer.msg('璁稿彲璇佸綍鍏ュけ璐�');
+ }
+ });
+ }
+ });
+ return false;
+ });
// 涓�閿縺娲�
$('#btn-activate').click(function() {
@@ -299,15 +348,6 @@
layer.msg("璇疯緭鍏ュ瘑鐮�", {offset: '150px'});
return;
}
- // var code = $("#code").val();
- // if (code === "" && codeSwitch === 'Y') {
- // layer.msg("璇疯緭鍏ラ獙璇佺爜", {offset: '150px'});
- // return;
- // }
- // if (sessionStorage.getItem("code").toUpperCase() !== code.toUpperCase()&&codeSwitch==='Y'){
- // layer.msg("楠岃瘉鐮侀敊璇�", {offset: '150px'});
- // return;
- // }
var user = {
mobile: mobile,
@@ -339,4 +379,4 @@
});
</script>
<script type></script>
-</html>
\ No newline at end of file
+</html>
--
Gitblit v1.9.1