|
@@ -1,7 +1,9 @@
|
|
|
<template>
|
|
|
<div class="login">
|
|
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
|
|
+ <!-- 点击转换二维码 -->
|
|
|
<img src="../assets/images/icon_dl_ewm@2x.png" v-if="stageType==1" @click="dhiwyrei" alt="" class="icon_rw">
|
|
|
+ <!-- 点击转换密码 -->
|
|
|
<img src="../assets/images/icon_dl_madl@2x.png" v-if="stageType==2" alt="" @click="bkue" class="icon_mim">
|
|
|
<h3 class="title"> 潜山市人口信息平台</h3>
|
|
|
<!-- <div v-if="statusFlag==2">
|
|
@@ -17,7 +19,7 @@
|
|
|
|
|
|
<div v-show="stageType==2" class="login-erw">
|
|
|
<h2 v-if="stageType==2" class="logerw_tit">
|
|
|
- 请搜索<pan style="color: red;">潜山数据资源小程序</pan>使用<span style="color: red;">小程序中扫码登录功能</span>,扫码快速登录
|
|
|
+ 请搜索<span style="color: red;">潜山数据资源小程序</span>使用<span style="color: red;">小程序中扫码登录功能</span>,扫码快速登录
|
|
|
</h2>
|
|
|
<p>请扫描下方的二维码</p>
|
|
|
<p>安全登录,防止盗号</p>
|
|
@@ -42,12 +44,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="stageType==1">
|
|
|
- <el-form-item prop="username">
|
|
|
+ <el-form-item prop="username" >
|
|
|
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
|
|
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="password">
|
|
|
+ <el-form-item prop="password" v-if='!xgmemberMe'>
|
|
|
<el-input
|
|
|
v-model="loginForm.password"
|
|
|
type="password"
|
|
@@ -58,7 +60,7 @@
|
|
|
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="code">
|
|
|
+ <el-form-item prop="code" v-if='!xgmemberMe'>
|
|
|
<el-input
|
|
|
v-model="loginForm.code"
|
|
|
auto-complete="off"
|
|
@@ -72,7 +74,27 @@
|
|
|
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="oldPassword" v-if='xgmemberMe'>
|
|
|
+ <el-input v-model="loginForm.oldPassword" type="password"
|
|
|
+ auto-complete="off"
|
|
|
+ placeholder="旧密码"
|
|
|
+ @keyup.enter.native="handleLogins" >
|
|
|
+ <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="newPassword" v-if='xgmemberMe'>
|
|
|
+ <el-input v-model="loginForm.newPassword" placeholder="新(数字、大小写字母、特殊符号且大于8位)" type="password" >
|
|
|
+ <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="confirmPassword" v-if='xgmemberMe'>
|
|
|
+ <el-input v-model="loginForm.confirmPassword" placeholder="确认新密码" type="password" @blur="cpass">
|
|
|
+ <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
|
|
+ <el-checkbox v-model="xgmemberMe" @change=" xgmes " style="margin:0px 0px 25px 25px;">修改密码</el-checkbox>
|
|
|
<el-form-item style="width:100%; margin-bottom: 42px;">
|
|
|
<div class="medTitle">
|
|
|
快捷登录
|
|
@@ -101,7 +123,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item style="width:100%;margin-bottom: 0;">
|
|
|
+ <el-form-item style="width:100%;margin-bottom: 0;" v-if='!xgmemberMe'>
|
|
|
<el-button
|
|
|
:loading="loading"
|
|
|
size="medium"
|
|
@@ -116,7 +138,23 @@
|
|
|
* 使用快捷登录,请先绑定第三方账号
|
|
|
</p>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item style="width:100%;margin-bottom: 0;" v-if='xgmemberMe'>
|
|
|
+ <el-button
|
|
|
+ :loading="loading"
|
|
|
+ size="medium"
|
|
|
+ type="primary"
|
|
|
+ style="width: 100%;background-color: #2865E1;height: 45px;"
|
|
|
+ @click.native.prevent="handleLogins"
|
|
|
+ >
|
|
|
+ <span v-if="!loading">确认修改</span>
|
|
|
+ <span v-else>修 改 中...</span>
|
|
|
+ </el-button>
|
|
|
+ <p class="div_p">
|
|
|
+ * 使用快捷登录,请先绑定第三方账号
|
|
|
+ </p>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
+
|
|
|
</el-form>
|
|
|
<!-- 底部 -->
|
|
|
<div class="el-login-footer">
|
|
@@ -139,9 +177,12 @@
|
|
|
decrypt
|
|
|
} from '@/utils/jsencrypt'
|
|
|
import {setToken} from '@/utils/auth'
|
|
|
+ import resetPwd from "./system/user/profile/resetPwd.vue";
|
|
|
+ import { updateUserPwds } from "@/api/system/user";
|
|
|
|
|
|
export default {
|
|
|
name: "Login",
|
|
|
+ components: { resetPwd },
|
|
|
data() {
|
|
|
return {
|
|
|
stageType: 1, //1密码登录 2扫码登录 3扫码成功
|
|
@@ -154,7 +195,10 @@
|
|
|
password: "",
|
|
|
rememberMe: false,
|
|
|
code: "",
|
|
|
- uuid: ""
|
|
|
+ uuid: "",
|
|
|
+ confirmPassword:undefined,
|
|
|
+ newPassword:undefined,
|
|
|
+ oldPassword:undefined
|
|
|
},
|
|
|
loginRules: {
|
|
|
username: [{
|
|
@@ -180,6 +224,8 @@
|
|
|
success_status: false, // 扫描成功 是否超时
|
|
|
setInSuccess_fn: '', // 扫码成功函数
|
|
|
setInSuccess_num: 0, // 扫码成功计时
|
|
|
+ bhsea:3,
|
|
|
+ xgmemberMe:false //修改密码
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -202,6 +248,23 @@
|
|
|
getCodeImg().then(res => {
|
|
|
this.codeUrl = "data:image/gif;base64," + res.img;
|
|
|
this.loginForm.uuid = res.uuid;
|
|
|
+ if( res.login_mode == 0){
|
|
|
+ //密码登录
|
|
|
+ this.stageType=1
|
|
|
+ this.bkue();
|
|
|
+ this.bhsea = 0
|
|
|
+ }else if(res.login_mode == 1){
|
|
|
+ //扫码登录
|
|
|
+ this.stageType=2
|
|
|
+ this.dhiwyrei();
|
|
|
+ this.bhsea = 1
|
|
|
+ }else if(res.login_mode == 2){
|
|
|
+ //混合登录
|
|
|
+ this.stageType=1
|
|
|
+ this.bkue();
|
|
|
+ this.bhsea = 2
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
two_fn() {
|
|
@@ -295,7 +358,11 @@
|
|
|
})
|
|
|
},
|
|
|
dhiwyrei(){
|
|
|
- this.stageType=2
|
|
|
+ if(this.bhsea == 0){
|
|
|
+ this.$message.error('请使用账号密码登录');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.stageType=2
|
|
|
this.getQecode()
|
|
|
},
|
|
|
getCookie() {
|
|
@@ -338,7 +405,81 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 修改密码
|
|
|
+ handleLogins(){
|
|
|
+ if(this.loginForm.username == ""){
|
|
|
+ this.$message.error('请输入账号');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.loginForm.oldPassword == undefined){
|
|
|
+ this.$message.error('请输入旧密码');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.loginForm.newPassword == undefined){
|
|
|
+ this.$message.error('请输入新密码');
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.loginForm.confirmPassword == undefined){
|
|
|
+ this.$message.error('请输入确认密码');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.loading = true;
|
|
|
+ let nhse={
|
|
|
+ userName:''
|
|
|
+ }
|
|
|
+ nhse.userName = this.loginForm.username
|
|
|
+ updateUserPwds(this.loginForm.oldPassword, this.loginForm.newPassword,this.loginForm.username).then(
|
|
|
+ response => {
|
|
|
+ console.log(response.msg,36)
|
|
|
+ if(response.msg == '操作成功'){
|
|
|
+ this.msgSuccess(response.msg);
|
|
|
+ this.xgmemberMe = false
|
|
|
+ this.getCode();
|
|
|
+ this.$set(this.loginForm,'password','')
|
|
|
+ this.$set(this.loginForm,'uuid','')
|
|
|
+ this.$set(this.loginForm,'rememberMe',false)
|
|
|
+ this.$set(this.loginForm,'code','')
|
|
|
+ this.$set(this.loginForm,'confirmPassword',undefined)
|
|
|
+ this.$set(this.loginForm,'oldPassword',undefined)
|
|
|
+ this.$set(this.loginForm,'newPassword',undefined)
|
|
|
+ // this.$set(this.loginForm,'username','')
|
|
|
+ }else{
|
|
|
+ this.$message.error(response.msg);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 确认密码失去焦点
|
|
|
+ cpass(){
|
|
|
+ if(this.loginForm.confirmPassword !== this.loginForm.newPassword){
|
|
|
+ this.$message.error('两次密码不一致');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 复选框选择修改密码
|
|
|
+ xgmes(){
|
|
|
+ if(this.xgmemberMe == false){
|
|
|
+ this.$set(this.loginForm,'confirmPassword',undefined)
|
|
|
+ this.$set(this.loginForm,'oldPassword',undefined)
|
|
|
+ this.$set(this.loginForm,'newPassword',undefined)
|
|
|
+ this.$set(this.loginForm,'username','')
|
|
|
+ }else{
|
|
|
+ this.$set(this.loginForm,'username','')
|
|
|
+ this.$set(this.loginForm,'password','')
|
|
|
+ this.$set(this.loginForm,'uuid','')
|
|
|
+ this.$set(this.loginForm,'rememberMe',false)
|
|
|
+ this.$set(this.loginForm,'code','')
|
|
|
+ }
|
|
|
+ },
|
|
|
bkue(){
|
|
|
+ // 点击转换成账号密码
|
|
|
+ if(this.bhsea == 1){
|
|
|
+ this.$message.error('请使用小程序扫码登录');
|
|
|
+ return
|
|
|
+ }
|
|
|
this.stageType =1
|
|
|
clearInterval(this.setInStatus)
|
|
|
}
|