admin
2025-02-20 fa677dec1c55db004a31beefb1e346e18c7858c2
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
<!DOCTYPE html>
<html>
 
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>福利发放</title>
        <script>
            window.onresize = function() {
                document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
            };
            window.onresize();
        </script>
        <link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
        <link rel="stylesheet" type="text/css" href="css/common.css" />
        <script src="../js/jquery.min.js"></script>
        <script src="../layui/layui.js"></script>
        <script src="js/http.js"></script>
 
        <style>
            .icon {
                width: 2.5rem;
                height: auto;
                margin-top: 1rem;
            }
            
            .title {
                font-family: Microsoft YaHei;
                font-weight: 400;
                font-size: 0.48rem;
                color: #3279F3;
                margin-top: 0.2rem;
            }
            
            .container {
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            
            .btn {
                width: 5.97rem;
                height: 0.9rem;
                border-radius: 0.45rem;
                font-size: 0.34rem;
                color: #FFFFFF;
                margin-top: 0.87rem;
            }
            
            .login_content {
                background-color: #F3F3F3;
                height: 0.9rem;
                border-radius: 0.45rem;
                width: 5.97rem;
                margin-top: 0.23rem;
                line-height: 0.9rem;
                padding-left: 0.42rem;
            }
            
            .login_content img {
                width: 0.37rem;
                margin-right: 0.2rem;
            }
            
            .login_content input {
                border: none;
                background-color: transparent;
                font-size: 0.34rem;
                height: 0.9rem;
                line-height: 0.9rem;
                color: #000000;
            }
        </style>
    </head>
 
    <body>
 
        <div class="container">
            <img class="icon" src="img/logo.png" />
 
            <div class="title">登录你的账户</div>
 
            <div style="height: 0.8rem;"></div>
 
            <div class="login_content">
                <img src="img/icon_account.png" />
                <input type="text" id="account" placeholder="请输入账号" />
            </div>
 
            <div class="login_content">
                <img src="img/icon_pwd.png" style="width: 0.31rem;" />
                <input type="password" id="pwd" placeholder="请输入密码" />
            </div>
 
            <button class="btn-active btn">登&nbsp;&nbsp;&nbsp;&nbsp;录</button>
 
        </div>
 
        <script>
            $(function() {
                $(".btn").click(function() {
                    var account = $("#account").val();
                    var pwd = $("#pwd").val();
                    if (account.length <= 0) {
                        layer.msg("请输入账号");
                        return;
                    }
                    if (pwd.length <= 0) {
                        layer.msg("请输入密码");
                        return;
                    }
                    var index = layer.load();
                    http_util.post("/agentapi/admin/login", {
                        account: account,
                        pwd: pwd
                    }, function(res) {
                        layer.close(index);
                        if (res.code == 0) {
                            layer.msg("登录成功");
                            let redirect = http_util.getQueryString("redirect");
                            if (redirect != null && redirect.length > 0) {
                                window.location.replace(redirect);
                            } else {
                                window.location.replace("index.html");
                            }
                        } else {
                            layer.msg(res.msg);
                        }
                    }, function(res) {
                        layer.close(index);
                        layer.msg(res);
                    });
                });
            });
        </script>
 
    </body>
 
</html>