|
|
|
@ -15,6 +15,10 @@ |
|
|
|
|
</div> |
|
|
|
|
<el-dropdown-menu slot="dropdown"> |
|
|
|
|
<el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item> |
|
|
|
|
<template v-else> |
|
|
|
|
<el-dropdown-item command="resetPw">修改密码</el-dropdown-item> |
|
|
|
|
<el-dropdown-item command="myDownload">我的下载</el-dropdown-item> |
|
|
|
|
</template> |
|
|
|
|
<el-dropdown-item command="logout">退出登录</el-dropdown-item> |
|
|
|
|
</el-dropdown-menu> |
|
|
|
|
</el-dropdown> |
|
|
|
@ -29,6 +33,24 @@ |
|
|
|
|
<img class="search" src="../../assets/img/search.png" alt="" @click="toSearch"> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" @close="closePassword" width="30%"> |
|
|
|
|
<el-form ref="passwordForm" label-width="60px"> |
|
|
|
|
<el-form-item label="原密码"> |
|
|
|
|
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="新密码"> |
|
|
|
|
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="新密码"> |
|
|
|
|
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button size="small" @click="passwordVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" type="primary" @click="editPassword">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
@ -45,6 +67,13 @@ export default { |
|
|
|
|
userName: '', |
|
|
|
|
isUser: false, |
|
|
|
|
showSetting: true, |
|
|
|
|
id: '', |
|
|
|
|
passwordVisible: false, |
|
|
|
|
passwordForm: { |
|
|
|
|
password: '', |
|
|
|
|
newPassword: '', |
|
|
|
|
reNewPassword: '' |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: { navbar }, |
|
|
|
@ -58,7 +87,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted(){ |
|
|
|
|
if(this.customer){ |
|
|
|
|
let customer = Boolean(atob(decodeURI(this.customer))) |
|
|
|
|
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true |
|
|
|
|
this.setCustomer(customer) |
|
|
|
|
} |
|
|
|
|
this.token && this.getUserInfo() |
|
|
|
@ -78,7 +107,7 @@ export default { |
|
|
|
|
this.showSetting = false |
|
|
|
|
} |
|
|
|
|
this.userName = userAccount.account |
|
|
|
|
|
|
|
|
|
this.id = userAccount.id |
|
|
|
|
this.setInfo({ |
|
|
|
|
avatar: userInfo.userAvatars, |
|
|
|
|
schoolId: userAccount.schoolId, |
|
|
|
@ -123,11 +152,40 @@ export default { |
|
|
|
|
userCommand(command){ |
|
|
|
|
if(command == 'person'){ |
|
|
|
|
this.$router.push('/setting/person') |
|
|
|
|
}else if(command == 'resetPw'){ |
|
|
|
|
this.showPassword() |
|
|
|
|
}else if(command == 'myDownload'){ |
|
|
|
|
this.$router.push('/setting/download') |
|
|
|
|
}else{ |
|
|
|
|
this.logout() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
showPassword() { |
|
|
|
|
this.passwordVisible = true |
|
|
|
|
}, |
|
|
|
|
editPassword() { |
|
|
|
|
if(!this.passwordForm.password) return util.warningMsg('请输入原密码') |
|
|
|
|
if(!this.passwordForm.newPassword) return util.warningMsg('请输入新密码') |
|
|
|
|
if(!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码') |
|
|
|
|
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg('请输入6位数以上的密码') |
|
|
|
|
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认') |
|
|
|
|
if(this.passwordForm.password === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致') |
|
|
|
|
|
|
|
|
|
let data = this.passwordForm |
|
|
|
|
data.accountId = this.id |
|
|
|
|
this.$post(this.api.examinePassword,data).then(res => { |
|
|
|
|
util.successMsg('修改成功') |
|
|
|
|
this.passwordVisible = false |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
closePassword() { |
|
|
|
|
this.passwordForm = { |
|
|
|
|
password: '', |
|
|
|
|
newPassword: '', |
|
|
|
|
reNewPassword: '' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|