zhangyanpeng
2024-05-29 1f227a1cf627526701c652ba84bae3e430bba8d3
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <title>电子签章</title>
    <link href="./login.css?v=2024051101" rel="stylesheet">
    <link href="./css/picture.css" rel="stylesheet">
    <link href="./img/org/head.png" rel="shortcut icon" type="image/x-icon">
    
    <script src="./js/config.js?v=2024051101"></script>
    <script src="./js/jquery-3.5.1.min.js"></script>
    
    <script src="./js/foundation.js?v=2024051101"></script>
    <script src="./js/picture.js?v=2024051101"></script>
    <script src="./js/vue/page.js?v=2024051101"></script>
    
    <script type="text/javascript">
        var browsertype, edt_username, edt_password, lbl_message, servertype, background_img, returnbutton;
        var loginObj;
        
        function returnlogin() {
            document.getElementsByClassName("loginArea")[0].style.left = "0%";
            document.getElementsByClassName("loginPuzzle")[0].style.left = "100%";
        }
        
        function login() {
            lbl_message.html("");
            
            if (browsertype.type == "IE" && browsertype.version < 8) {
                lbl_message.html("本系统支持IE8以上版本,请关闭兼容性视图模式或升级IE");
                return;
            }
            
            var param = {
                username: edt_username.val(),
                password: edt_password.val()
            }
            
            Server.call("root/client/login", param, function(result) {
                var data = result.data.data;
                cleanMsg();
                returnbutton[0].style.display = "block";
                document.getElementsByClassName("loginArea")[0].style.left = "-100%";
                document.getElementsByClassName("loginPuzzle")[0].style.left = "0%";
                if (window.location.href.substring(0, 4) == "http") {
                    jigsaw.init(document.getElementById("captcha"), function(info) {
                        // document.getElementById('msg').innerHTML = '验证成功!'
                        doSuccess(data.token);
                    }); 
                }
                else {
                    doSuccess(data.token);
                }
                
            },function(result) {
                if (!result.success) {
                    doError(result);
                    return;
                }
            });
        }
        
        function dologin() {
            lbl_message.html("");
            
            var param = {
                username: edt_username.val(),
                password: edt_password.val()
            }
            
            Server.call("root/client/login", param, function(result) {
                var data = result.data.data;
                doSuccess(data.token);
            },function(result) {
                if (!result.success) {
                    doError(result);
                    return;
                }
            });
        }
        
        function doSuccess(token) {
            var tokenname = "" //"hdtoken"
            if (edt_username.val()) {
                tokenname = edt_username.val();
            }
            localStorage.setItem("HDU" + tokenname, token);
            // localStorage.setItem("hdtoken", token);
            var db = "db=" + edt_username.val();
            var db_ =  strToMuddleStr(db);
            // util.pageTo("./module/system/page/main.html?db=" + edt_username.val());
            util.pageTo("./module/system/page/main.html?" + db_);
        }
        
        function doError(result) {
            lbl_message.html(config.servertype + "登录错误:账号密码错误");
        }
 
        function forgot() {
            window.open('forgot.html', "forgot-password");
        }
            
        $(document).ready(function() {
            if (config.isupgrading) {
                var background_img_upgrading = $("#background_img_upgrading");
                var background_img = $("#background_img");
                
                background_img_upgrading.show();
                background_img.hide();
                return
            }
            else {
                edt_username = $("#edt_username");
                edt_password = $("#edt_password");
                lbl_message = $("#lbl_message");
                
                servertype = $("#servertype");
                background_img = $("#background_img");
                returnbutton = $(".returnbutton");
                let clientHeight = document.documentElement.clientHeight;
                
                setTopConfig();
                setTopButtonsConfig();
                servertype.html(config.servertype);
                browsertype = BrowserType();
                var username = localStorage.getItem("username");
                if (username) {
                    edt_username.val(username);
                }
            }
            
            
            document.onkeydown = function (event) {
                    var e = event || window.event;
                    if (e && e.keyCode == 13) { //回车键的键值为13
                       login();
                    }
                };
        });
        
    </script>
</head>
 
<body>
    <div class="header">
        <img class="header-logo" src="./img/org/gp_logo.png" height="35">
        <div class="header-label" >
            <label class="header-label-cn">经销商管理系统<span id="servertype"></span></label>
            <br/>
            <label class="header-label-en">DealerManagementSystem</label>
            <br/>
            <div style="height: 1px; overflow: hidden;">&nbsp;</div>
        </div>
    </div>
    
    <div id="background_img_upgrading" class="background" style="display: none;">
        <div class="loginBody" style="width: 380px;">
            <div class="loginArea_up" style="text-align: center;padding-top: 20px;">
                <label style="font-size: 28px; color: #fff;">系统升级中,暂停服务</label>
            </div>
        </div>
    </div>
    
    <div id="background_img" class="background">
        <label class="background-label">电子签章演示环境</label>
        <div class="loginBody">
            <div class="loginArea">
                <!-- <div class="loginPortrait">
                    <img src="./img/loginPortrait.png" height="80">
                </div> -->
                
                <!-- <div class="loginTitle">账号密码登录<span id="servertype"></span></div> -->
                
                <div style="position: relative; height: 100%; display: flex; justify-content: center;">
                    <div style="position: absolute; top: 30%; left: 40px; right: 40px; height: 220px;">
                        <div style="height: 34px; width: 100%; position: relative;">
                            <i class="user-class" >账号:</i>
                            <input id="edt_username" autocomplete="off" class="user"/>
                        </div>
                        <div style="height: 34px; width: 100%; position: relative; margin-top: 20px;">
                            <i class="user-class" >密码:</i>
                            <input type="password" id="edt_password" autocomplete="off" class="user"/>
                        </div>
                        <div style="height: 10px; width: 100%; text-align: right; margin-top: 5px; color: LightGray; font-weight: 600;">
                            <div class="forgot" style="width:27%; float:right;" onclick="forgot();">忘记密码 </div>
                        </div>
                        <div style="position: absolute; bottom: 0px; width: 100%;height: 70px; text-align: center;">
                            <div style="position: relative;">
                                <div onclick="login();" class="x-btn-text"  >登&nbsp;&nbsp;&nbsp;录 </div>
                                <div class="loginMessage">
                                    <label id="lbl_message" style="left: 10px; color: #ff0000;"></label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="clear:both"></div>    
            </div>
            
            <div class="loginPuzzle">
                <div style="width: 260px; height: 100%;background-color: #ffffff00; border-radius: 0px 15px 15px 0px; overflow: hidden;">
                    <div id="puzzle" class="container" >
                        <div id="captcha" ></div>
                        <div id="msg" ></div>
                        <div class="returnbutton" style="width: 100%; height: 50px; text-align: right; display: none;">
                            <button onclick="returnlogin();" class="x-btn-text-return" style="width: 100px;">重新登录</button>
                        </div>
                    </div>
                    <!-- <div style="position: absolute; bottom: 0px; width: 260px; top: 260px; text-align: right;">
                        <button onclick="returnlogin();" class="x-btn-text-return" style="width: 100px;">重新登录</button>
                    </div> -->
                </div>
            </div>
        </div>
    </div>
    
    <div style="position: absolute;bottom: 8px;left: 0px; right: 0px;font-size: 12px;text-align: center;">请将Windows系统更新至7.0及以上。推荐使用微软自带浏览器Edge、谷歌浏览器Chrome、火狐浏览器。</div>
    
    <script>
        // jigsaw.init(document.getElementById("captcha"), function(info) {
        //     document.getElementById('msg').innerHTML = '验证成功!'
        //     dologin();
        // }); 
        
        function cleanMsg() {
            document.getElementById('captcha').innerHTML = ''
            document.getElementById('msg').innerHTML = ''
        }
        
    </script>
</body>
</html>