|
@@ -9,12 +9,12 @@
|
|
<div class="ms-title">后台管理系统</div>
|
|
<div class="ms-title">后台管理系统</div>
|
|
<el-form :model="form" :rules="rules" ref="login" label-width="0px" class="ms-content">
|
|
<el-form :model="form" :rules="rules" ref="login" label-width="0px" class="ms-content">
|
|
<el-form-item prop="username">
|
|
<el-form-item prop="username">
|
|
- <el-input v-model="form.tel" placeholder="请输入手机号">
|
|
|
|
|
|
+ <el-input v-model="form.code_phone" placeholder="请输入手机号">
|
|
<el-button slot="prepend" icon="el-icon-user"></el-button>
|
|
<el-button slot="prepend" icon="el-icon-user"></el-button>
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="password">
|
|
<el-form-item prop="password">
|
|
- <el-input type="password" placeholder="请输入密码" v-model="form.pwd">
|
|
|
|
|
|
+ <el-input type="password" placeholder="请输入密码" v-model="form.passwd">
|
|
<el-button slot="prepend" icon="el-icon-lock"></el-button>
|
|
<el-button slot="prepend" icon="el-icon-lock"></el-button>
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -33,7 +33,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
-const { mapActions: login } = createNamespacedHelpers('login');
|
|
|
|
|
|
+const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
|
|
export default {
|
|
export default {
|
|
metaInfo: { title: '登录' },
|
|
metaInfo: { title: '登录' },
|
|
name: 'login',
|
|
name: 'login',
|
|
@@ -50,16 +50,15 @@ export default {
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
- ...login(['login']),
|
|
|
|
|
|
+ ...adminLogin(['login']),
|
|
submitForm() {
|
|
submitForm() {
|
|
this.$refs.login.validate(async valid => {
|
|
this.$refs.login.validate(async valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- // let res = await this.login({ user: this.form });
|
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
|
- localStorage.setItem('user', JSON.stringify(this.form));
|
|
|
|
- this.$message.success('登录成功');
|
|
|
|
- this.$router.push('/homeIndex');
|
|
|
|
- // }
|
|
|
|
|
|
+ let res = await this.login({ user: this.form });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message.success('登录成功');
|
|
|
|
+ this.$router.push('/homeIndex');
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.$message.error('请输入账号和密码');
|
|
this.$message.error('请输入账号和密码');
|
|
console.log('error submit!!');
|
|
console.log('error submit!!');
|