| | |
| | | ,note: function(othis){ |
| | | var mobile = admin.screen() < 2 |
| | | ,note = layui.data(setter.tableName).note; |
| | | |
| | | // 获取激活状态 |
| | | var activation = false; |
| | | var exprTime; |
| | | $.ajax({ |
| | | url: baseUrl+"/system/activation/auth", |
| | | dataType:'json', |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | activation = true; |
| | | exprTime = res.data; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | events.note.index = admin.popup({ |
| | | title: 'WMS 秘钥' |
| | | title: (activation?"已激活(有效期至"+exprTime+")":"Activation Code(未激活)") |
| | | // title: 'license' |
| | | ,shade: 0 |
| | | ,offset: [ |
| | |
| | | ,skin: 'layadmin-note layui-anim layui-anim-upbit' |
| | | ,content: '<textarea placeholder="内容"></textarea>' |
| | | ,resize: false |
| | | ,btn: ['添加', '取消'] |
| | | ,btn: [(activation?"更新":"立即激活"), '取消'] |
| | | ,success: function(layero, index){ |
| | | var textarea = layero.find('textarea') |
| | | ,value = note === undefined ? '' : note; |
| | |
| | | $.ajax({ |
| | | url: baseUrl+"/system/secret/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: "secret="+note, |
| | | data: "secret="+$("#LAY_adminNote").children("textarea").val(), |
| | | dataType:'json', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | console.log(note) |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg) |
| | | alert("激活成功"); |
| | | location.reload(); |
| | | // layer.msg(res.msg); |
| | | // layer.close(index); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/login"; |
| | | } else { |
| | |
| | | } |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | } |
| | | ,btn2: function(index, layero){ |
| | | layer.close(index); |