[update] 修改授权码
This commit is contained in:
@@ -10,12 +10,9 @@
|
|||||||
cancelText="关闭">
|
cancelText="关闭">
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form :form="form">
|
<a-form :form="form">
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:labelCol="labelCol"
|
:labelCol="labelCol"
|
||||||
:wrapperCol="wrapperCol"
|
:wrapperCol="wrapperCol"
|
||||||
@paste.native.capture.prevent="handleOperate"
|
|
||||||
autocomplete="new-password"
|
|
||||||
label="邮箱">
|
label="邮箱">
|
||||||
<a-input placeholder="请输入邮箱" :maxLength='50' disabled
|
<a-input placeholder="请输入邮箱" :maxLength='50' disabled
|
||||||
v-decorator="[ 'email', validatorRules.email]"/>
|
v-decorator="[ 'email', validatorRules.email]"/>
|
||||||
@@ -38,6 +35,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { postAction } from '../../api/manage'
|
import { postAction } from '../../api/manage'
|
||||||
|
import { getRSAPublicKey } from '../../api/login'
|
||||||
|
import { encrypt } from '../../utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UserAuthorizationCode',
|
name: 'UserAuthorizationCode',
|
||||||
@@ -69,30 +68,43 @@ export default {
|
|||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 16 }
|
sm: { span: 16 }
|
||||||
},
|
},
|
||||||
url: '',
|
url: '/home/modify',
|
||||||
username: null
|
model: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show(uname, uEmail) {
|
show(uname, uEmail, uId) {
|
||||||
|
this.form.resetFields()
|
||||||
if (!uname) {
|
if (!uname) {
|
||||||
this.$message.warning('当前系统无登录用户!')
|
this.$message.warning('当前系统无登录用户!')
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
this.username = uname
|
this.model = {
|
||||||
// this.getPublicKey()
|
id: uId,
|
||||||
this.form.resetFields()
|
email: uEmail
|
||||||
this.form.setFields({email: uEmail})
|
}
|
||||||
|
this.getPublicKey()
|
||||||
|
let timer = setTimeout(() => {
|
||||||
|
this.form.setFieldsValue({ email: this.model.email })
|
||||||
|
clearTimeout(timer)
|
||||||
|
timer = null
|
||||||
|
}, 0)
|
||||||
this.visible = true
|
this.visible = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getPublicKey() {
|
||||||
|
getRSAPublicKey().then(res => {
|
||||||
|
this.rsaPublicKey = res.result
|
||||||
|
})
|
||||||
|
},
|
||||||
handleOk() {
|
handleOk() {
|
||||||
const that = this
|
const that = this
|
||||||
// 触发表单验证
|
// 触发表单验证
|
||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
that.confirmLoading = true
|
that.confirmLoading = true
|
||||||
let params = Object.assign({}, values)
|
let params = Object.assign(this.model, values)
|
||||||
|
params.emailPassword = encrypt(this.rsaPublicKey, values.emailPassword)
|
||||||
console.log('修改授权码提交数据', params)
|
console.log('修改授权码提交数据', params)
|
||||||
postAction(this.url, params).then((res) => {
|
postAction(this.url, params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|||||||
@@ -235,7 +235,8 @@ export default {
|
|||||||
updateAuthorizationCode() {
|
updateAuthorizationCode() {
|
||||||
let username = this.userInfo().username
|
let username = this.userInfo().username
|
||||||
let userEmail = this.userInfo().email
|
let userEmail = this.userInfo().email
|
||||||
this.$refs.userAuthorizationCode.show(username, userEmail)
|
let uId = this.userInfo().id
|
||||||
|
this.$refs.userAuthorizationCode.show(username, userEmail, uId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user