| | |
| | | :model="loginForm" |
| | | label-width="0" |
| | | > |
| | | <!-- <el-form-item v-if="tenantMode" prop="tenantId"> |
| | | <el-input |
| | | @keyup.enter="handleLogin" |
| | | v-model="loginForm.tenantId" |
| | | auto-complete="off" |
| | | :placeholder="$t('login.tenantId')" |
| | | > |
| | | <template #prefix> |
| | | <i class="icon-quanxian" /> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> --> |
| | | <el-form-item prop="username"> |
| | | <el-input |
| | | @keyup.enter="handleLogin" |
| | | v-model="loginForm.username" |
| | | auto-complete="off" |
| | | :placeholder="$t('login.username')" |
| | | placeholder="请输入账号" |
| | | > |
| | | <template #prefix> |
| | | <i class="icon-yonghu" /> |
| | |
| | | :type="passwordType" |
| | | v-model="loginForm.password" |
| | | auto-complete="off" |
| | | :placeholder="$t('login.password')" |
| | | placeholder="请输入密码" |
| | | > |
| | | <template #suffix> |
| | | <i class="el-icon-view el-input__icon" @click="showPassword" /> |
| | |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="this.website.captchaMode" prop="code"> |
| | | <el-row :span="24"> |
| | | <el-col :span="16"> |
| | | <el-input |
| | | @keyup.enter="handleLogin" |
| | | v-model="loginForm.code" |
| | | auto-complete="off" |
| | | :placeholder="$t('login.code')" |
| | | > |
| | | <template #prefix> |
| | | <i class="icon-yanzhengma" /> |
| | | </template> |
| | | </el-input> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <div class="login-code"> |
| | | <img :src="loginForm.image" class="login-code-img" @click="refreshCode" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form-item> --> |
| | | <el-form-item> |
| | | <el-button |
| | | style="width: 100%;" |
| | | type="primary" |
| | | @click.prevent="handleLogin" |
| | | :class="this.registerMode ? 'login-submit' : 'btn-submit'" |
| | | >{{ $t('login.submit') }} |
| | | >登 录 |
| | | </el-button> |
| | | <!-- <el-button |
| | | v-if="this.registerMode" |
| | | type="danger" |
| | | @click.prevent="handleRegister" |
| | | class="register-submit" |
| | | >{{ $t('login.register') }} |
| | | </el-button> --> |
| | | </el-form-item> |
| | | <!-- <el-dialog title="用户信息选择" append-to-body v-model="userBox" width="350px"> |
| | | <avue-form :option="userOption" v-model="userForm" @submit="submitLogin" /> |
| | | </el-dialog> |
| | | <el-dialog title="用户信息注册" append-to-body v-model="registerBox" width="350px"> |
| | | <avue-form :option="registerOption" v-model="registerForm" @submit="submitRegister" /> |
| | | </el-dialog> --> |
| | | </el-form> |
| | | </template> |
| | | |
| | |
| | | handleLogin() { |
| | | this.$refs.loginForm.validate(valid => { |
| | | if (valid) { |
| | | const loading = this.$loading({ |
| | | lock: true, |
| | | text: '登录中,请稍后', |
| | | background: 'rgba(0, 0, 0, 0.7)', |
| | | }); |
| | | this.$store |
| | | .dispatch('LoginByUsername', this.loginForm) |
| | | const loading = this.$loading({ lock: true, text: '登录中,请稍后', background: 'rgba(0, 0, 0, 0.7)' }); |
| | | this.$store.dispatch('LoginByUsername', this.loginForm) |
| | | .then(() => { |
| | | if (this.website.switchMode) { |
| | | const deptId = this.userInfo.dept_id; |
| | | const roleId = this.userInfo.role_id; |
| | | if (deptId.includes(',') || roleId.includes(',')) { |
| | | this.loginForm.deptId = deptId; |
| | | this.loginForm.roleId = roleId; |
| | | this.userBox = true; |
| | | this.$store.dispatch('LogOut').then(() => { |
| | | loading.close(); |
| | | }); |
| | | return false; |
| | | } |
| | | } |
| | | loading.close(); |
| | | //加载工作流路由集 |
| | | this.loadFlowRoutes(); |
| | | this.$router.push(this.tagWel); |
| | | }) |
| | | .catch(err => { |