From d0ed00b27764d916a0ef8ee9731a4be9daa64e74 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期三, 08 二月 2023 10:34:36 +0800 Subject: [PATCH] # --- src/main/webapp/views/index.html | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html index cbe75fb..85e62d6 100644 --- a/src/main/webapp/views/index.html +++ b/src/main/webapp/views/index.html @@ -41,6 +41,9 @@ </li> </ul> <ul class="layui-nav layui-layout-right"> + <li class="layui-nav-item" lay-unselect id="activation-icon"> + <a ew-event="license" title="token"><i class="layui-icon layui-icon-auz"></i></a> + </li> <li class="layui-nav-item" lay-unselect> <a ew-event="note" title="渚跨"><i class="layui-icon layui-icon-note"></i></a> </li> @@ -102,13 +105,14 @@ base: baseUrl + "/static/layui/lay/modules/" }).extend({ notice: 'notice/notice', - }).use(['index', 'element', 'layer', 'admin', 'notice'], function () { + }).use(['index', 'element', 'layer', 'admin', 'notice', 'form'], function () { var $ = layui.jquery; var index = layui.index; var element = layui.element; var layer = layui.layer; var admin = layui.admin; var notice = layui.notice; + var form = layui.form; var easywebIframeMsg = localStorage.getItem("easyweb-iframe"); if (!isEmpty(easywebIframeMsg)) { @@ -119,12 +123,23 @@ } $.ajax({ + url: baseUrl + "/system/activation/auth", + method: 'GET', + async: false, + success: function (res) { + if (res.code === 200) { + $("#activation-icon").hide(); + } else { + $("#activation-icon").click(); + } + } + }); + + $.ajax({ url: baseUrl + "/menu/auth", headers: {'token': localStorage.getItem('token')}, method: 'POST', - // async: false, success: function (res) { - // 鍏抽棴鍔犺浇鍔ㄧ敾 $('.layuimini-loader').fadeOut(); if (res.code === 200) { var tpl = $('#menuTpl').html(); @@ -140,7 +155,26 @@ } }); - // 榛樿鍔犺浇涓婚〉 + form.on('submit(saveLicense)', function (data) { + $.ajax({ + url: baseUrl+"/system/license/auth", + headers: {'token': localStorage.getItem('token')}, + data: data.field, + method: 'POST', + success: function (res) { + if (res.code === 200) { + alert("鎺堟潈鎴愬姛"); + window.location.reload(); + } else if (res.code === 403) { + top.location.href = baseUrl+"/login"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }); + return false; + }) + index.loadHome({ menuPath: baseUrl+'/views/home/navigation.html', menuName: '<i class="layui-icon layui-icon-home"></i>' @@ -155,7 +189,6 @@ admin.closeAllTabs(); }); - // 鏇挎崲閫�鍑烘寜閽彉閲� var logout = document.getElementById('logout'); var url = logout.getAttribute('href'); logout.setAttribute('href', baseUrl + "/login"); @@ -174,6 +207,18 @@ </li> {{/each}} </script> +<script type="text/html" id="license-box"> + <form class="layui-form" style="padding-right: 10px"> + <div class="layui-form-item" style="padding: 20px 25px"> + <textarea name="license" placeholder="璇疯緭鍏ユ縺娲荤爜" class="layui-textarea" autocomplete="off" + lay-verType="tips" lay-verify="required" required></textarea> + </div> + <div class="layui-form-item text-right"> + <button class="layui-btn layui-btn-normal" lay-filter="saveLicense" lay-submit="">纭畾</button> + <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button> + </div> + </form> +</script> </body> </html> -- Gitblit v1.9.1