Blame view

src/views/login/index.vue 6.17 KB
6d7bd862   梁保满   飞书bug
1
2
  // <template>
    <div class="login-container" v-loading="loading" element-loading-text="努力加载中...">
c1b532ad   梁保满   权限配置,路由基础设置
3
      <el-form
6d7bd862   梁保满   飞书bug
4
        v-if="!code && !dockkey"
c1b532ad   梁保满   权限配置,路由基础设置
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
        ref="loginForm"
        :model="loginForm"
        :rules="loginRules"
        class="login-form"
        auto-complete="on"
        label-position="left"
      >
        <!-- <img
          src="../../assets/images/logo.png"
          style="
            width: 120px;
            height: 120px;
            position: absolute;
            top: -250px;
            left: 190px;
          "
          alt
        /> -->
        <img
          src="../../assets/images/chiken.png"
          style="width: 428px; height: 142px; position: absolute; top: -142px"
          alt
        />
        <div class="title-container">
          <h3 class="title">欢迎使用教育云平台!</h3>
        </div>
  
        <el-form-item prop="username">
          <i class="fa fa-user" aria-hidden="true"></i>
          <el-input
            ref="username"
            v-model="loginForm.username"
            placeholder="请输入用户名"
            name="username"
            type="text"
            autofocus="autofocus"
            tabindex="1"
            maxlength="40"
            auto-complete="on"
          />
        </el-form-item>
  
        <el-form-item prop="password">
          <i class="fa fa-unlock-alt" aria-hidden="true"></i>
          <el-input
            :key="passwordType"
            ref="password"
            v-model="loginForm.password"
            :type="passwordType"
            placeholder="请输入登录密码"
            name="password"
            class="mima"
            maxlength="16"
            tabindex="2"
            auto-complete="on"
            @keyup.enter.native="submitForm"
          />
          <span class="show-pwd" @click="showPwd">
            <i
              class="fa"
              aria-hidden="true"
              :class="passwordType === 'password' ? 'fa-eye-slash' : 'fa-eye'"
            ></i>
          </span>
        </el-form-item>
        <el-button
          type="primary"
          style="
            width: 80%;
            display: block;
            margin: 0 auto;
            margin-bottom: 30px;
            margin-top: 10px;
          "
          round
          :disabled="!disableClick"
          @click.native.prevent="submitForm"
          >登录</el-button
        >
      </el-form>
    </div>
  </template>
  <script>
b21d90ef   梁保满   长水登录
88
  import { getURLParams } from "@/utils";
c1b532ad   梁保满   权限配置,路由基础设置
89
90
91
  export default {
    data() {
      return {
6d7bd862   梁保满   飞书bug
92
        loading:false,
c1b532ad   梁保满   权限配置,路由基础设置
93
94
95
        disableClick: true,
        passwordType: "password",
        loginForm: {
225a00b6   梁保满   飞书问题解决
96
97
          // username: "15911715665",
          // password: "Csiy88888",
8ea67428   梁保满   飞书bug
98
99
          // username: "13610050254",
          // password: "Pw050254#",
e823fb79   阿宝   集团管理员
100
101
          // username: "18332123505",
          // password: "Pw123505#",
8ea67428   梁保满   飞书bug
102
103
          username: "18687826606",
          password: "Pw826606#",
9309dc5d   梁保满   任课老师接口完成
104
105
106
107
          // username: "18946034886",
          // password: "Pw034886#",
          // username: "18893712576",
          // password: "Pw712576#",
6d7bd862   梁保满   飞书bug
108
109
110
111
          // username: "13247726488",
          // password: "726488",
          // username: "13319607658",
          // password: "Pw607658#",
c1b532ad   梁保满   权限配置,路由基础设置
112
113
114
        },
        loginRules: {
          username: [
ee6e7628   梁保满   备题组卷借口数据对接调整
115
            { required: true, message: "请输入用户账号", trigger: "blur" },
c1b532ad   梁保满   权限配置,路由基础设置
116
117
          ],
          password: [
ee6e7628   梁保满   备题组卷借口数据对接调整
118
119
            { required: true, message: "请输入账号密码", trigger: "blur" },
          ],
c1b532ad   梁保满   权限配置,路由基础设置
120
        },
13b58a42   梁保满   备题组卷部分前端页面基本完成
121
        url: "",
b21d90ef   梁保满   长水登录
122
123
        code: "",
        dockkey: "",
c1b532ad   梁保满   权限配置,路由基础设置
124
125
      };
    },
13b58a42   梁保满   备题组卷部分前端页面基本完成
126
127
    created() {
      this.url = this.$route.query?.url || "";
b21d90ef   梁保满   长水登录
128
129
130
      this.code = getURLParams("code") || localStorage.getItem("csCode") || "";
      this.dockkey = getURLParams("dockkey") || "";
      if (this.code || this.dockkey) {
6d7bd862   梁保满   飞书bug
131
        this.loading = true
8ea67428   梁保满   飞书bug
132
        this._LoginCheck();
b21d90ef   梁保满   长水登录
133
      }
13b58a42   梁保满   备题组卷部分前端页面基本完成
134
    },
c1b532ad   梁保满   权限配置,路由基础设置
135
136
137
138
139
140
141
142
143
144
145
146
    methods: {
      showPwd() {
        if (this.passwordType === "password") {
          this.passwordType = "";
        } else {
          this.passwordType = "password";
        }
        this.$nextTick(() => {
          this.$refs.password.focus();
        });
      },
      submitForm() {
c1b532ad   梁保满   权限配置,路由基础设置
147
148
149
150
151
152
153
154
        if (this.loginForm.username === "" || this.loginForm.password === "") {
          this.$message({
            showClose: true,
            message: "账号或密码不能为空",
            type: "error",
          });
          return false;
        } else {
ee6e7628   梁保满   备题组卷借口数据对接调整
155
          this.$store.dispatch("Login", { ...this.loginForm, url: this.url });
c1b532ad   梁保满   权限配置,路由基础设置
156
157
        }
      },
b21d90ef   梁保满   长水登录
158
159
160
      _LoginCheck() {
        this.$store.dispatch("CSLogin", this.code || this.dockkey);
      },
c1b532ad   梁保满   权限配置,路由基础设置
161
162
163
164
165
166
167
168
169
170
    },
    mounted() {},
  };
  </script>
  <style lang="scss">
  $bg: #283443;
  $dark_gray: #889aa4;
  $light_gray: #000;
  $cursor: #000;
  
ee6e7628   梁保满   备题组卷借口数据对接调整
171
172
  .login-container .el-input input {
    color: $cursor;
c1b532ad   梁保满   权限配置,路由基础设置
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
  }
  .login-container {
    width: 100%;
    height: 100vh;
    background: url("../../assets/images/login-bg.png") no-repeat;
    background-size: cover;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    .el-input {
      display: inline-block;
      height: 47px;
      width: 85%;
      input::-ms-reveal {
        display: none;
      }
      input {
        background: transparent;
        border: 0px;
        -webkit-appearance: none;
        border-radius: 0px;
ee6e7628   梁保满   备题组卷借口数据对接调整
195
        font-size: 16px;
c1b532ad   梁保满   权限配置,路由基础设置
196
        color: $light_gray;
6d7bd862   梁保满   飞书bug
197
        height: 48px;
9309dc5d   梁保满   任课老师接口完成
198
        line-height: 48px;
c1b532ad   梁保满   权限配置,路由基础设置
199
        caret-color: $cursor;
c1b532ad   梁保满   权限配置,路由基础设置
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
        &:-webkit-autofill {
          box-shadow: 0 0 0px 1000px #e5e5e5 inset !important;
          -webkit-text-fill-color: $cursor !important;
        }
      }
    }
  
    .el-form-item {
      border: 1px solid #e5e5e5;
      background: rgba(0, 0, 0, 0.1);
      border-radius: 5px;
      color: #454545;
    }
    .login-form {
      position: relative;
      width: 500px;
      height: 331px;
      max-width: 100%;
      padding: 30px 35px 0;
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      margin-top: 200px;
      box-sizing: border-box;
    }
  
    .tips {
      font-size: 14px;
      color: #fff;
      margin-bottom: 10px;
  
      span {
        &:first-of-type {
          margin-right: 16px;
        }
      }
    }
  
    .fa {
      padding: 5px 0px 6px 15px;
      color: $dark_gray;
      font-size: 20px;
    }
  
    .title-container {
      position: relative;
  
      .title {
        font-size: 24px;
        color: $light_gray;
        margin: 0px auto 40px auto;
        text-align: center;
        font-weight: bold;
      }
    }
  
    .show-pwd {
      position: absolute;
      right: 10px;
      top: 7px;
      font-size: 16px;
      color: $dark_gray;
      cursor: pointer;
      user-select: none;
    }
  }
  </style>