From 1ef6817089e2095b2cff7667740330d27ca3d68e Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期六, 01 八月 2020 11:17:33 +0800 Subject: [PATCH] #当前本版十分完美、冻结 --- src/main/java/com/zy/common/web/AuthController.java | 10 ++++++---- src/main/webapp/views/index.html | 5 +++++ src/main/webapp/static/layuiadmin/lib/admin.js | 41 +++++++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/zy/common/web/AuthController.java b/src/main/java/com/zy/common/web/AuthController.java index beb3a50..31232e4 100644 --- a/src/main/java/com/zy/common/web/AuthController.java +++ b/src/main/java/com/zy/common/web/AuthController.java @@ -17,10 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.*; @@ -327,5 +324,10 @@ return R.ok(resources); } + @PostMapping(value = "/system/secret/auth") + @ManagerAuth(memo = "鏇存柊绉橀挜") + public R systemSecret(@RequestParam(value = "secret") String secret) { + return R.ok(secret); + } } diff --git a/src/main/webapp/static/layuiadmin/lib/admin.js b/src/main/webapp/static/layuiadmin/lib/admin.js index d372ba0..6f6f1f6 100644 --- a/src/main/webapp/static/layuiadmin/lib/admin.js +++ b/src/main/webapp/static/layuiadmin/lib/admin.js @@ -377,13 +377,14 @@ }); } - //渚跨 + //绉橀挜 ,note: function(othis){ var mobile = admin.screen() < 2 ,note = layui.data(setter.tableName).note; events.note.index = admin.popup({ - title: '渚跨' + title: 'WMS 绉橀挜' + // title: 'license' ,shade: 0 ,offset: [ '41px' @@ -394,16 +395,40 @@ ,skin: 'layadmin-note layui-anim layui-anim-upbit' ,content: '<textarea placeholder="鍐呭"></textarea>' ,resize: false + ,btn: ['娣诲姞', '鍙栨秷'] ,success: function(layero, index){ var textarea = layero.find('textarea') - ,value = note === undefined ? '渚跨涓殑鍐呭浼氬瓨鍌ㄥ湪鏈湴锛岃繖鏍峰嵆渚夸綘鍏虫帀浜嗘祻瑙堝櫒锛屽湪涓嬫鎵撳紑鏃讹紝渚濈劧浼氳鍙栧埌涓婁竴娆$殑璁板綍銆傛槸涓潪甯稿皬宸у疄鐢ㄧ殑鏈湴澶囧繕褰�' : note; + ,value = note === undefined ? '' : note; - textarea.val(value).focus().on('keyup', function(){ - layui.data(setter.tableName, { - key: 'note' - ,value: this.value - }); + // textarea.val(value).focus().on('keyup', function(){ + // layui.data(setter.tableName, { + // key: 'note' + // ,value: this.value + // }); + // }); + } + ,yes: function(index, layero){ + $.ajax({ + url: baseUrl+"/system/secret/auth", + headers: {'token': localStorage.getItem('token')}, + data: "secret="+note, + dataType:'json', + method: 'POST', + success: function (res) { + console.log(note) + if (res.code === 200) { + layer.msg(res.msg) + } else if (res.code === 403) { + top.location.href = baseUrl+"/login"; + } else { + layer.msg(res.msg) + } + } }); + layer.close(index); + } + ,btn2: function(index, layero){ + layer.close(index); } }) } diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html index 4290938..c6864cd 100644 --- a/src/main/webapp/views/index.html +++ b/src/main/webapp/views/index.html @@ -78,6 +78,11 @@ </a> </li> <li class="layui-nav-item layui-hide-xs" lay-unselect> + <a href="javascript:;" layadmin-event="note"> + <i class="layui-icon layui-icon-note"></i> + </a> + </li> + <li class="layui-nav-item layui-hide-xs" lay-unselect> <a href="javascript:;" layadmin-event="fullscreen"> <i class="layui-icon layui-icon-screen-full"></i> </a> -- Gitblit v1.9.1