2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>蓝图开发平台</title>
  <meta name="keywords" content="lanbase">
  <meta name="description" content="lanbase开发平台">
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
  <link rel="stylesheet" href="../css/bootstrap.min.css">
  <link rel="stylesheet" href="../css/font-awesome.min.css">
  <link rel="stylesheet" href="../css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="../css/all-skins.min.css">
  <link rel="stylesheet" href="../css/main.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="../libs/html5shiv.min.js"></script>
  <script src="../libs/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition login-page">
<div class="login-box" id="rapp" v-cloak>
  <div class="login-logo">
    <b>蓝图开发平台</b>
  </div>
  <!-- /.login-logo -->
  <div class="login-box-body">
      <p class="login-box-msg">管理员登录</p>
      <div v-if="error" class="alert alert-danger alert-dismissible">
        <h4 style="margin-bottom: 0px;"><i class="fa fa-exclamation-triangle"></i> {{errorMsg}}</h4>
      </div>
      <div class="form-group has-feedback">
          <input type="text" class="form-control" v-model="username" placeholder="账号">
          <span class="glyphicon glyphicon-user form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
          <input type="password" class="form-control" v-model="password" placeholder="密码" @keyup.enter="login">
          <span class="glyphicon glyphicon-lock form-control-feedback"></span>
      </div>
      <div v-show="errorTimes>=3">
          <div class="form-group has-feedback">
              <input type="text" class="form-control" v-model="captcha" placeholder="验证码" @keyup.enter="login">
              <span class="glyphicon glyphfa-warning-sign form-control-feedback"></span>
          </div>
          <div class="form-group has-feedback">
              <img alt="如果看不清楚,请单击图片刷新!" class="pointer" :src="src" @click="refreshCode">
              &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" @click="refreshCode">点击刷新</a>
          </div>
      </div>
 
      <div class="row">
        <div class="col-xs-8">
        </div>
        <!-- /.col -->
        <div class="col-xs-4">
          <button type="button" class="btn btn-primary btn-block btn-flat" @click="login">登录</button>
        </div>
        <!-- /.col -->
      </div>
    <!-- /.social-auth-links -->
 
  </div>
  <!-- /.login-box-body -->
</div>
<!-- /.login-box -->
<script src="../libs/jquery.min.js"></script>
<script src="../plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../libs/vue.min.js"></script>
<script src="../libs/bootstrap.min.js"></script>
<script src="../libs/app.js"></script>
<script src="../js/common.js"></script>
<script type="text/javascript">
var vm = new Vue({
    el:'#rapp',
    data:{
        username: '',
        password: '',
        captcha: '',
        error: false,
        errorMsg: '',
        src: restServerBaseURL + 'captcha.jpg',
        errorTimes: 0
    },
    beforeCreate: function(){
        if(self != top){
            top.location.href = self.location.href;
        }
    },
    methods: {
        refreshCode: function(){
            this.src = restServerBaseURL + "captcha.jpg?t=" + $.now();
        },
        login: function () {
            var data = "username="+vm.username+"&password="+vm.password+"&error="+vm.error+"&captcha="+vm.captcha;
            $.ajax({
                type: "POST",
                url: restServerBaseURL + "sys/login",
                data: data,
                dataType: "json",
                success: function(r){
                    if(r.code == 0){//登录成功
                        localStorage.setItem("token", r.token);
                        parent.location.href = baseURL + 'admin/index.html';
                    }else{
                        vm.error = true;
                        vm.errorMsg = r.msg;
                        vm.errorTimes=r.errorTimes;
                        vm.refreshCode();
                    }
                }
            });
        },
        getLoginErrorTimes: function () {
            $.get(restServerBaseURL + "sys/getLoginErrorTimes", function(r){
                vm.errorTimes=r.errorTimes;
            });
        }
    },
    created: function () {
        this.getLoginErrorTimes();
    }
});
</script>
</body>
</html>