自动化立体仓库 - WMS系统
luxiaotao1123
2020-08-01 1ef6817089e2095b2cff7667740330d27ca3d68e
#当前本版十分完美、冻结
3个文件已修改
56 ■■■■ 已修改文件
src/main/java/com/zy/common/web/AuthController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/layuiadmin/lib/admin.js 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
    }
}
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);
        }
      })
    }
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>