|
@@ -0,0 +1,196 @@
|
|
|
+<template>
|
|
|
+ <div id="stulogin">
|
|
|
+ <div :style="'overflow:hidden; background: url(' + img.bg + ');background-size:cover;height:100vh;'" class="bg">
|
|
|
+ <div class="covers">
|
|
|
+ <el-row :span="24">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <div class="w_1200">
|
|
|
+ <el-col :span="22"><img style="width: 290px; height: 66px" :src="url"/></el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-col :span="6"><img style="width: 25px; height: 25px" :src="pic"/></el-col>
|
|
|
+ <el-col :span="18"><el-link type="primary">咨询帮助</el-link></el-col>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <div class="w_1200">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="14" class="mainLeft">
|
|
|
+ <el-row><span class="one">海阔凭鱼跃 · 天高任鸟飞</span></el-row>
|
|
|
+ <el-row class="two">
|
|
|
+ 覆盖:20个省200+高校 190万+毕业生 20万+单位入驻
|
|
|
+ </el-row>
|
|
|
+ <el-row class="three">帮助天下毕业生走稳求职第一步 </el-row>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="mainRight" v-if="loginType === 0">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="22" style="margin: 0 0 18px;">
|
|
|
+ <span class="tit_right">学生登录<span style="color: #ff4500;">(建议您使用谷歌浏览器)</span></span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" class="el-icon-full-screen" style="zoom:1.5" @click.native="loginType = 1"> </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form :model="form" :rules="rules" ref="form">
|
|
|
+ <el-form-item prop="account">
|
|
|
+ <el-col>
|
|
|
+ <el-input placeholder="学号" prefix-icon="el-icon-user-solid" v-model="form.account"></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="passwd">
|
|
|
+ <el-col>
|
|
|
+ <el-input
|
|
|
+ placeholder="密码(首次登陆密码为身份证密码后六位)"
|
|
|
+ prefix-icon="el-icon-lock"
|
|
|
+ v-model="form.passwd"
|
|
|
+ show-password
|
|
|
+ @keyup.enter.native="toSubmit"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ <el-col class="inp_sty">
|
|
|
+ <!-- <el-col :span="19" style="padding: 8px 0;"><el-checkbox v-model="checked">记住登陆账号</el-checkbox></el-col> -->
|
|
|
+ <el-col :span="5"><el-button type="success" class="login" @click="toSubmit">登录</el-button></el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col><el-link type="primary" class="login_tips" :underline="false">忘记登陆密码?</el-link></el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="mainRight" v-else>
|
|
|
+ <el-col :span="22" style="margin: 0 0 18px;">
|
|
|
+ <span class="tit_right">学生登录<span style="color: #ff4500;">(建议您使用谷歌浏览器)</span></span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" class="el-icon-s-platform" style="zoom:1.5" @click.native="loginType = 0"> </el-col>
|
|
|
+ <el-col :span="24" style="text-align:center;">
|
|
|
+ <span>微信扫码登录</span>
|
|
|
+ <qrcode :qrcode="qrcode" @toReturn="toReturn"></qrcode>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import qrcode from '@/components/qrcode.vue';
|
|
|
+import { mapActions, mapState } from 'vuex';
|
|
|
+const jwt = require('jsonwebtoken');
|
|
|
+export default {
|
|
|
+ name: 'stulogin',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ qrcode,
|
|
|
+ },
|
|
|
+ data: () => ({
|
|
|
+ img: {
|
|
|
+ bg: require('@/assets/stulogin.jpg'),
|
|
|
+ },
|
|
|
+ url: require('@/assets/logo.jpg'),
|
|
|
+ pic: require('@/assets/qq.jpg'),
|
|
|
+ checked: '',
|
|
|
+ form: {},
|
|
|
+ qrcode: '',
|
|
|
+ loginType: 0,
|
|
|
+ rules: {
|
|
|
+ account: [{ required: true, message: '请输入学号', trigger: 'blur' }],
|
|
|
+ passwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ created() {
|
|
|
+ this.initQrcode();
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['studLogin', 'createConnection', 'getWxtoken']),
|
|
|
+ toSubmit() {
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.submit();
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async submit(wxtoken) {
|
|
|
+ let data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ if (this.loginType === 0) {
|
|
|
+ data.account = `${data.account}@999991`;
|
|
|
+ } else {
|
|
|
+ data = { wxtoken: wxtoken };
|
|
|
+ }
|
|
|
+ let result = await this.studLogin({ type: this.loginType, data: data });
|
|
|
+ this.$message({
|
|
|
+ type: `${result.errcode}` === '0' ? 'success' : 'error',
|
|
|
+ message: `${result.errcode}` === '0' ? '登录成功' : 'result.errmsg',
|
|
|
+ });
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
+ sessionStorage.setItem('token', JSON.stringify(result.data));
|
|
|
+ let info = jwt.decode(result.data);
|
|
|
+ sessionStorage.setItem('user', JSON.stringify(result.data));
|
|
|
+ this.$router.push({ path: '/' });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async initQrcode() {
|
|
|
+ let result = await this.createConnection();
|
|
|
+ this.$set(this, `qrcode`, result);
|
|
|
+ },
|
|
|
+ async toReturn(msg) {
|
|
|
+ let result = await this.getWxtoken(this.qrcode);
|
|
|
+ this.submit(result);
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.w_1200 {
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 1200px;
|
|
|
+}
|
|
|
+.top {
|
|
|
+ height: 70px;
|
|
|
+ background: #fff;
|
|
|
+ opacity: 0.9;
|
|
|
+ border-top: 4px solid #44b569;
|
|
|
+}
|
|
|
+.mainLeft {
|
|
|
+ padding: 15% 0;
|
|
|
+}
|
|
|
+.mainRight {
|
|
|
+ height: 310px;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 32px 40px;
|
|
|
+ margin: 10% 0;
|
|
|
+ float: right;
|
|
|
+}
|
|
|
+.covers {
|
|
|
+ background: rgba(92, 91, 91, 0.1);
|
|
|
+}
|
|
|
+.one {
|
|
|
+ font-size: 30px;
|
|
|
+ color: #ffffff;
|
|
|
+}
|
|
|
+.two {
|
|
|
+ color: rgba(255, 255, 255, 0.6);
|
|
|
+ margin: 20px 0px;
|
|
|
+}
|
|
|
+.three {
|
|
|
+ color: rgba(255, 255, 255, 0.6);
|
|
|
+}
|
|
|
+/deep/.el-input__inner {
|
|
|
+ height: 55px;
|
|
|
+}
|
|
|
+.inp_sty {
|
|
|
+ padding: 5px 0;
|
|
|
+}
|
|
|
+.tit_right {
|
|
|
+ font-size: 18px !important;
|
|
|
+ margin-bottom: 18px;
|
|
|
+}
|
|
|
+.login_tips {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #808080;
|
|
|
+}
|
|
|
+</style>
|