czt
13 小时以前 d3822e70e1c175604407917460afbf54a7787597
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="zh-cn" xmlns:th=http://www.thymeleaf.org>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>智能粮库管理系统-异常说明</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet"  th:href="@{/ajax/libs/layui-ruoyi/css/layui.css}"/>
</head>
<body>
 
<div style="margin: 20px; text-align: center;">
 
    <img th:src="${qrCodeString}" src="../static/images/big-icon-sys.png" />
 
    <h1 style="margin-top: -10px">抱歉,系统未授权或者授权到期,请联系管理员重新授权</h1>
    <h5 style="margin-top: 50px; font-weight:700">授权KEY:<b th:text="${checkLicInfo}"></b></h5>
    <div  style="width: 100%;text-align: center;">
        <center>
            <div style="width: 800px;padding-top:20px;align-self: center; ">
                <form class="layui-form" lay-filter="form1" action="">
                    <div class="layui-form-item layui-form-text" style="margin-left: -100px">
                        <label class="layui-form-label">授权码:</label>
                        <div class="layui-input-block">
                            <textarea name="authStr" placeholder="请输入授权码,点击立即提交,授权成功后会返回上一页面" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </form>
                <div class="layui-form-item">
                    <div class="layui-input-block" style="width: 50%; float: left; margin-left: unset">
                        <button class="layui-btn layui-btn-normal" style="float: right; margin-right: 50px" onclick="getLicense()">获取授权</button>
                    </div>
                    <div class="layui-input-block" style="width: 50%; float: right; margin-left: unset">
                        <button class="layui-btn" style="float: left; margin-left: 50px" onclick="submitLicense()">立即提交</button>
                    </div>
                </div>
            </div>
        </center>
    </div>
</div>
 
</body>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/ajax/libs/layui-ruoyi/layui.js}"></script>
<script th:inline="javascript">
    //系统登陆人
    var loginUser = [[${loginUser}]];
    var companyId = [[${loginUser.companyId}]];
</script>
<script>
    var layer;
    var form;
    $(function () {
        layui.use(['layer','form'], function () {
            layer = layui.layer;
            form = layui.form;
        });
    });
 
    //获取授权码
    function getLicense() {
        var ii = layer.load(0, {shade: false})
        $.ajax({
            type: 'POST',
            url: "getLicense",
            dataType: 'JSON',
            contentType: "application/json;charset=UTF-8",
            data: JSON.stringify({"companyId":companyId}),
            success: function (result) {
                layer.close(ii);
                layer.alert(result.msg);
                if(result.code == "0000"){
                    window.history.back()
                }
            },
            error: function (result) {
                layer.close(ii);
                layer.alert(result.msg);
            }
        });
    };
 
    //提交授权码
    function submitLicense() {
        var data1 = form.val("form1");
        if(!data1.authStr){
            layer.alert("请输入授权码!");
            return;
        }
        var d = {"key":data1.authStr,"companyId":companyId};
        $.ajax({
            type: 'POST',
            url: "authorize",
            dataType: 'JSON',
            contentType: "application/json;charset=UTF-8",
            data: JSON.stringify(d),
            success: function (result) {
                layer.alert(result.msg);
                if(result.code == "0000"){
                    window.history.back()
                }
            },
            error: function (result) {
                layer.alert(result.msg);
            }
        });
    };
 
</script>
</html>