|
@@ -11,10 +11,10 @@
|
|
|
ref="pwdform"
|
|
ref="pwdform"
|
|
|
label-width="200px">
|
|
label-width="200px">
|
|
|
<el-form-item label="当前登录密码 :"
|
|
<el-form-item label="当前登录密码 :"
|
|
|
- prop="pass"
|
|
|
|
|
|
|
+ prop="OldPassword"
|
|
|
required>
|
|
required>
|
|
|
<el-input type="password"
|
|
<el-input type="password"
|
|
|
- v-model="pwdform.pass"
|
|
|
|
|
|
|
+ v-model="pwdform.OldPassword"
|
|
|
auto-complete="off"></el-input>
|
|
auto-complete="off"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="新的登录密码 :"
|
|
<el-form-item label="新的登录密码 :"
|
|
@@ -25,10 +25,10 @@
|
|
|
auto-complete="off"></el-input>
|
|
auto-complete="off"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="确认新的登录密码 :"
|
|
<el-form-item label="确认新的登录密码 :"
|
|
|
- prop="checknewPass"
|
|
|
|
|
|
|
+ prop="NewPassword"
|
|
|
required>
|
|
required>
|
|
|
<el-input type="password"
|
|
<el-input type="password"
|
|
|
- v-model="pwdform.checknewPass"
|
|
|
|
|
|
|
+ v-model="pwdform.NewPassword"
|
|
|
auto-complete="off"></el-input>
|
|
auto-complete="off"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -44,6 +44,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import userApi from '@/api/setting/user'
|
|
import userApi from '@/api/setting/user'
|
|
|
|
|
+import { mapState } from 'vuex'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'userchangepwd',
|
|
name: 'userchangepwd',
|
|
|
data () {
|
|
data () {
|
|
@@ -51,7 +52,7 @@ export default {
|
|
|
if (value === '') {
|
|
if (value === '') {
|
|
|
callback(new Error('请输入新密码'))
|
|
callback(new Error('请输入新密码'))
|
|
|
} else {
|
|
} else {
|
|
|
- if (this.pwdform.checknewPass !== '') {
|
|
|
|
|
|
|
+ if (this.pwdform.NewPassword !== '') {
|
|
|
this.$refs.pwdform.validateField('checknewPass')
|
|
this.$refs.pwdform.validateField('checknewPass')
|
|
|
}
|
|
}
|
|
|
callback()
|
|
callback()
|
|
@@ -68,18 +69,19 @@ export default {
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
pwdform: {
|
|
pwdform: {
|
|
|
- pass: '',
|
|
|
|
|
|
|
+ OldPassword: '',
|
|
|
newpass: '',
|
|
newpass: '',
|
|
|
- checknewPass: ''
|
|
|
|
|
|
|
+ NewPassword: '',
|
|
|
|
|
+ UserName: ''
|
|
|
},
|
|
},
|
|
|
pwdrules: {
|
|
pwdrules: {
|
|
|
- pass: [
|
|
|
|
|
|
|
+ OldPassword: [
|
|
|
{ required: true, message: '请输入当前密码', trigger: 'blur' }
|
|
{ required: true, message: '请输入当前密码', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
newpass: [
|
|
newpass: [
|
|
|
{ validator: validatePass, trigger: 'blur' }
|
|
{ validator: validatePass, trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
- checknewPass: [
|
|
|
|
|
|
|
+ NewPassword: [
|
|
|
{ validator: validatePass2, trigger: 'blur' }
|
|
{ validator: validatePass2, trigger: 'blur' }
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
@@ -87,12 +89,18 @@ export default {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapState('d2admin/user', [
|
|
|
|
|
+ 'info'
|
|
|
|
|
+ ])
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
submitForm (formName) {
|
|
submitForm (formName) {
|
|
|
let _this = this
|
|
let _this = this
|
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
console.log(_this.pwdform, 'wang')
|
|
console.log(_this.pwdform, 'wang')
|
|
|
|
|
+ _this.pwdform.UserName = _this.info.name
|
|
|
userApi.userchangepwd(_this.pwdform)
|
|
userApi.userchangepwd(_this.pwdform)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
// response
|
|
// response
|
|
@@ -107,6 +115,7 @@ export default {
|
|
|
// this.pwdform.newpass = ''
|
|
// this.pwdform.newpass = ''
|
|
|
// this.pwdform.checknewPass = ''
|
|
// this.pwdform.checknewPass = ''
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ console.log(res)
|
|
|
_this.$message({
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
message: res.data.message
|
|
message: res.data.message
|