#
18516761980
2022-06-14 d16d3b70e94f798d7e5abd145f8566d81d0c66c9
src/main/webapp/static/layuiadmin/lib/admin.js
@@ -381,9 +381,24 @@
    ,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: [
@@ -395,7 +410,7 @@
        ,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;
@@ -411,13 +426,15 @@
          $.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 {
@@ -425,7 +442,6 @@
              }
            }
          });
          layer.close(index);
        }
        ,btn2: function(index, layero){
          layer.close(index);