|
@@ -1,62 +1,58 @@
|
|
|
<template>
|
|
|
- <div id="webLogin">
|
|
|
- <login-detail :form="form" @submitDate="submitnewLogin" :forms="forms" @submitDates="submitRegisters"></login-detail>
|
|
|
+ <div id="kjpdLogin">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="5" class="info"> </el-col>
|
|
|
+ <el-col :span="13" class="login">
|
|
|
+ <el-col :span="24" class="title">
|
|
|
+ 管理登录
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="form">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
|
|
+ <el-form-item label="房间号" prop="room_id">
|
|
|
+ <el-input v-model="form.room_id" placeholder="房间号"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="登录密码" prop="passwd">
|
|
|
+ <el-input v-model="form.passwd" placeholder="请输入登录密码" show-password></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
+ <el-button type="primary" @click="onSubmit">登录</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" class="info"> </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import loginDetail from '@/layout/login/webLogin.vue';
|
|
|
-import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
-const { mapActions: mapMarket } = createNamespacedHelpers('market');
|
|
|
-const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
|
|
|
-const { mapActions: login } = createNamespacedHelpers('login');
|
|
|
-
|
|
|
-expertsuser;
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: channel } = createNamespacedHelpers('channel');
|
|
|
export default {
|
|
|
- name: 'webLogin',
|
|
|
+ name: 'kjpdLogin',
|
|
|
props: {},
|
|
|
- components: { loginDetail },
|
|
|
- data: () => {
|
|
|
+ components: {},
|
|
|
+ data: function() {
|
|
|
return {
|
|
|
- // 个人
|
|
|
form: {},
|
|
|
- // 注册
|
|
|
- forms: {},
|
|
|
+ rules: {
|
|
|
+ room_id: [{ required: true, message: '请输入房间号', trigger: 'blur' }],
|
|
|
+ passwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
- ...mapMarket({ userFetch: 'fetch', userCreate: 'create', userUpdate: 'update' }),
|
|
|
- ...login({ toLogin: 'login' }),
|
|
|
- ...expertsuser({ expertsuserCreate: 'create' }),
|
|
|
- // 用户登录
|
|
|
- async submitnewLogin(form) {
|
|
|
- let res = await this.toLogin({ user: form });
|
|
|
+ ...channel({ toLogin: 'login' }),
|
|
|
+ async onSubmit() {
|
|
|
+ let data = this.form;
|
|
|
+ const res = await this.toLogin({ user: data });
|
|
|
if (res.uid) {
|
|
|
- if (res.role == '2') {
|
|
|
- this.$router.push('/market/index');
|
|
|
- } else {
|
|
|
- this.$router.push({ path: '/userCenter/index', query: { num: '1' } });
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 注册
|
|
|
- async submitRegisters({ data }) {
|
|
|
- if (data.role == '4' || data.role == '5') {
|
|
|
- let res = await this.userCreate(data);
|
|
|
- console.log(res.data);
|
|
|
- let msg = `注册成功,等待管理员审核,方可登录`;
|
|
|
- this.$checkRes(res, msg);
|
|
|
- } else if (data.role == '6') {
|
|
|
- let res = await this.expertsuserCreate(data);
|
|
|
- let msg = `注册成功,等待管理员审核,方可登录`;
|
|
|
- this.$checkRes(res, msg);
|
|
|
- } else if (data.role == '7') {
|
|
|
- data.status = '3';
|
|
|
- let res = await this.userCreate(data);
|
|
|
- let msg = `注册成功,等待管理员审核,方可登录`;
|
|
|
+ console.log(res);
|
|
|
+ // this.$router.push({ path: '/kjpdCenter/index', query: { num: '1' } });
|
|
|
}
|
|
|
- window.location.reload();
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -64,9 +60,6 @@ export default {
|
|
|
pageTitle() {
|
|
|
return `${this.$route.meta.title}`;
|
|
|
},
|
|
|
- redirect_uri() {
|
|
|
- return `${this.$route.query.redirect_uri}`;
|
|
|
- },
|
|
|
},
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -74,4 +67,21 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.info {
|
|
|
+ height: 800px;
|
|
|
+}
|
|
|
+.login {
|
|
|
+ padding: 15px 0;
|
|
|
+ .title {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 40px;
|
|
|
+ padding: 40px 0;
|
|
|
+ }
|
|
|
+ .form {
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|