File size: 8,900 Bytes
a451929
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1da2d85
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
<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>deepseek</title>
    
  
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://new.hkems-stmo.top/css/bootstrap.min.css" />
    <script src="https://new.hkems-stmo.top/js/bootstrap.bundle.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <!--调用需要的框架文件-->
 
    <style>
        /* 遮罩层,用于挡住内容 */
        #overlayverify {
            position: fixed;
            left: 0px;
            top: 0px;
            height: 100%;
            background-color: #cccccc;
            z-index: 100
        }
 
        /* 模态框主体 */
        .popup {
            background-color: #ffffff;
            height: 430px;
            border-radius: 5px;
            margin: 100px auto;
            text-align: center
        }
 
        /* 模态框的标题 */
        .popup_title {
            height: 60px;
            line-height: 60px;
            border-bottom: solid 1px #cccccc
        }
 
        /* 模态框的内容 */
        .popup_content {
            text-align: left;
            margin: 0 auto;
            width: 90%;
            height: 200px;
            line-height: 45px;
            padding: 10px 20px;
            text-indent: 2em
        }
 
        .popup_line {
            margin: 0 auto;
            height: 20px;
            width: 85%;
            border-bottom: 1px solid #dbdbdb
        }
 
        /* 模态框的按钮栏 */
        .popup_btn {
            padding-top: 30px
        }
 
        /* 弹出框的按钮 */
        .popup_btn button.ds {
            color: #778899;
            width: 40%;
            height: 40px;
            cursor: pointer;
            border: solid 1px #cccccc;
            border-radius: 5px;
            margin: 5px 10px;
            color: #ffffff;
            background-color: rgb(150, 150, 150)
        }
 
        .popup_btn button.ag {
            color: #778899;
            width: 40%;
            height: 40px;
            cursor: pointer;
            border: solid 1px #cccccc;
            border-radius: 5px;
            margin: 5px 10px;
            color: #ffffff;
            background-color: #337ab7
        }
    </style>
    <script>
        var testV = 3;
        /*定义最高尝试次数*/
        var error = 0;
        /*定义初始错误量*/
        var accountlist = ['admin', 'amd2'];
        var passwordlist = ['pas167534', 'dhjnvc5685'];
        /*定义账号密码列表*/
        function verify() {
            /*用户提交验证*/
            var account = AandP.account.value;
            var password = AandP.password.value;
            /*从AandP表单里获取用户输入的账号密码,为相应的变量名赋值*/
            if (testV > 1) {
                /*如果尝试机会>1*/
                if (accountlist.indexOf(account) == -1) {
                    /*则使用accountlist.indexOf(account)方法获得输入的用户名在用户列表的位数,用if语句判断如果等于-1(即不存在)*/
                    error += 1;
                    /*则使error变量+1*/
                }
                else {
                    /*如果不等于-1,即意味着用户输入的用户名存在,就可以接着进行密码的核验*/
                    var Correspondingpassword = passwordlist[accountlist.indexOf(account)];
                    /*用 列表名[位数(通过accountlist.indexOf(account)获得)] 方法查询到用户输入的用户名相对应的密码,赋入Correspondingpassword变量*/
                    if (Correspondingpassword == password) {
                        out.innerHTML = '账号密码正确,验证通过';
                    }
                    /*将用户输入的密码与查询到与用户输入的用户名相对应的密码对比,如果成功则用innerHTML将提示输出到id为out的块组件*/
                    else {
                        error += 1;
                    }
                    /*如果不匹配,对error变量+1*/
                }
                if (error != 0) {
                    /*验证部分结束。如果error变量不等于零,即至少发生了账号错误或账号密码不匹配中的一个事件:*/
                    testV -= 1
                    out.innerHTML = '账号或密码错误,你还剩' + testV + '次机会';
                    /*让尝试次数testV-1,然后用innerHTML将提示输出到id为out的块组件*/
                }
                else {
                    /*如果error变量等于零,则验证成功*/
                    overlayverify.style.display = "none";
                    /*为挡住页面的模态框写入“display:none”的样式,使其消失*/
                }
            }
            else {
                /*如果尝试机会<1,即没有尝试机会了*/
                out.innerHTML = '登陆冻结,请刷新或联系管理员';
                /*用innerHTML将提示输出到id为out的块组件*/
            }
            document.getElementById("AandP").reset();
            /*重置用户输入的数据*/
        }
 
        function dontknow() {
            /*用户不知道密码*/
            window.location.href = 'https://h5.m.taobao.com/awp/core/detail.htm?id=903202386495&spm=a2141.7631671.content.1'
            /*跳转到其他页面*/
        }
    </script>
</head>
 
<body>
    <div class="container">
        <div class="row">
            <div id="overlayverify" style="display: block;">
                <!--建立遮罩层挡住内容-->
                <div class="col-sm-2 col-lg-4"></div>
                <!--bootstarp框架,用于调节样式-->
                <div class="popup col-sm-8 col-lg-4">
                    <!--建立一个模态框-->
                    <p class="popup_title">统一身份验证验证</p>
                    <p class="popup_content overflow-auto" style="line-height: 40px;">欢迎访问,在进行浏览前,我们需要验证你的身份。
                    </p>
                    <!--说明-->
                    <form name="AandP" style="margin-top: -20%;">
                        <!--建立名为AandP的表单(Account and Password),容纳用户输入进输入框的内容-->
                        <input class="form-control signinput" id="account" placeholder="请输入账号:"
                            style="width: 80%;margin-left: 10%;margin-bottom: 15px;" />
                        <input class="form-control" id="password" type="password" placeholder="请输入密码"
                            style="width: 80%;margin-left: 10%;margin-bottom: 10px;" />
                        <!--分别设置了账号密码的输入框,各自用id="xxx"来标识-->
                    </form>
                    <div id="out" style="color: red;"></div>
                    <!--建立一个id为out的输出反馈的div,登陆失败等信息被写入到这-->
                    <div class="popup_line"></div>
                    <div class="popup_btn" style="margin-top: -20px;">
                        <button class="cancelBtn ds overflow-hidden" onclick="dontknow()">我不知道密码</button>
                        <button class="confirmBtn ag overflow-hidden" onclick="verify()">验证并访问</button>
                        <!--用onclick绑定函数,点击按钮运行onclick指定的函数-->
                    </div>
                </div>
                <div class="col-sm-2 col-lg-4"></div>
                <!--bootstarp框架,用于调节样式-->
            </div>
        </div>
    </div>
    <div>
        
        <!--在这里写入你想在通过验证之后展示的内容-->
    <script>
      (function () {
        function isMobile() {
          // 获取用户代理字符串
          const userAgent =
            navigator.userAgent || navigator.vendor || window.opera;

          // 定义常见移动设备的用户代理标识
          const mobileRegex =
            /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i;

          // 测试用户代理字符串是否匹配移动设备的标识
          return mobileRegex.test(userAgent);
        }
        const isMobileDevice = isMobile();

        const iframe = document.createElement("iframe");
        iframe.style.width = "100%";
        iframe.style.height = "100vh";
        iframe.style.border = "none";
        iframe.allow="microphone; camera";
        iframe.src="https://open-avatar.holoworld.com.cn:8282/";
        iframe.sandbox="allow-scripts allow-same-origin";

        document.body.appendChild(iframe);
      })();
    </script>
     </div>
  </body>
</html>