2 changed files with 125 additions and 2 deletions
@ -0,0 +1,108 @@ |
|||||
|
<template> |
||||
|
<el-dialog |
||||
|
class="sl" |
||||
|
title="修改密码" |
||||
|
:visible.sync="visible" |
||||
|
width="300px" |
||||
|
:append-to-body="true"> |
||||
|
<el-form :model="dataForm" :show-message="false" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> |
||||
|
<el-form-item label="账号"> |
||||
|
<span>{{ userName }}</span> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="IFS账号" prop="ifsUsername"> |
||||
|
<el-input v-model="dataForm.ifsUsername"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="IFS密码" prop="ifsPassword"> |
||||
|
<el-input type="password" v-model="dataForm.ifsPassword"></el-input> |
||||
|
</el-form-item> |
||||
|
|
||||
|
</el-form> |
||||
|
<span slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> |
||||
|
<el-button @click="visible = false">取消</el-button> |
||||
|
</span> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { clearLoginInfo } from '@/utils' |
||||
|
export default { |
||||
|
data () { |
||||
|
return { |
||||
|
visible: false, |
||||
|
dataForm: { |
||||
|
ifsUsername: '', |
||||
|
ifsPassword: '', |
||||
|
}, |
||||
|
dataRule: { |
||||
|
ifsUsername: [ |
||||
|
{ required: true, message: 'IFS账号不能为空', trigger: 'blur' } |
||||
|
], |
||||
|
ifsPassword: [ |
||||
|
{ required: true, message: 'IFS密码不能为空', trigger: 'blur' } |
||||
|
], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
userName: { |
||||
|
get () { return this.$store.state.user.name } |
||||
|
}, |
||||
|
mainTabs: { |
||||
|
get () { return this.$store.state.common.mainTabs }, |
||||
|
set (val) { this.$store.commit('common/updateMainTabs', val) } |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 初始化 |
||||
|
init () { |
||||
|
this.visible = true |
||||
|
this.$nextTick(() => { |
||||
|
this.$http({ |
||||
|
url: this.$http.adornUrl(`/sys/user/info/${this.$store.state.user.id}`), |
||||
|
method: 'get', |
||||
|
params: this.$http.adornParams() |
||||
|
}).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataForm.ifsUsername = data.user.ifsUsername |
||||
|
this.dataForm.ifsPassword = data.user.ifsPassword |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
// 表单提交 |
||||
|
dataFormSubmit () { |
||||
|
this.$refs['dataForm'].validate((valid) => { |
||||
|
let ifsUsername = this.dataForm.ifsUsername |
||||
|
let ifsPassword = this.dataForm.ifsPassword |
||||
|
if (!ifsUsername){ |
||||
|
this.$message.warning('IFS账号不能为空') |
||||
|
return |
||||
|
} |
||||
|
if (!ifsPassword){ |
||||
|
this.$message.warning('IFS密码不能为空') |
||||
|
return |
||||
|
} |
||||
|
if (valid) { |
||||
|
this.$http({ |
||||
|
url: this.$http.adornUrl('/sys/user/updateIfsPassWord'), |
||||
|
method: 'post', |
||||
|
data: { |
||||
|
'ifsUsername': this.dataForm.ifsUsername, |
||||
|
'ifsPassword': this.dataForm.ifsPassword |
||||
|
} |
||||
|
}).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.$message.success( '操作成功') |
||||
|
this.visible = false |
||||
|
} else { |
||||
|
this.$message.warning(data.msg) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue