|
|
@@ -16,19 +16,14 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="显示名">
|
|
|
<el-input v-model="loginUser.screenName" style="width: 70%; padding-right: 10px" readonly />
|
|
|
- <el-button size="mini" type="info" @click="showUpdateDialog(1)">更新</el-button>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="邮箱">
|
|
|
- <el-input v-model="loginUser.email" style="width: 70%; padding-right: 10px" readonly />
|
|
|
- <el-button size="mini" type="info" @click="showUpdateDialog(2)">更新</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="手机">
|
|
|
<el-input v-model="loginUser.mobile" style="width: 70%; padding-right: 10px" readonly />
|
|
|
- <el-button size="mini" type="info" @click="showUpdateDialog(3)">更新</el-button>
|
|
|
+ <el-button size="mini" type="info" @click="showUpdateDialog(1)">更新</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="密码">
|
|
|
<el-input v-model="loginUser.mobile" style="width: 70%; padding-right: 10px" readonly />
|
|
|
- <el-button size="mini" type="info" @click="showUpdateDialog(4)">更新</el-button>
|
|
|
+ <el-button size="mini" type="info" @click="showUpdateDialog(2)">更新</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -71,11 +66,15 @@
|
|
|
<el-form ref="form" :model="loginUser" label-width="80px">
|
|
|
<el-form-item label="性别">
|
|
|
<el-input v-model="loginUser.mobile" style="width: 70%; padding-right: 10px" readonly />
|
|
|
- <el-button size="mini" type="info" @click="showUpdateDialog(5)">更新</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="签名">
|
|
|
- <el-input v-model="loginUser.signature" type="textarea" style="width: 70%; padding-right: 10px" readonly />
|
|
|
- <el-button size="mini" type="info" @click="showUpdateDialog(6)">更新</el-button>
|
|
|
+ <el-input
|
|
|
+ v-model="loginUser.signature"
|
|
|
+ type="textarea"
|
|
|
+ rows="3"
|
|
|
+ style="width: 70%;
|
|
|
+ padding-right: 10px"
|
|
|
+ readonly />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -86,78 +85,45 @@
|
|
|
<el-dialog
|
|
|
:title="updateTitle"
|
|
|
append-to-body
|
|
|
- :visible.sync="updateDialog"
|
|
|
+ :visible.sync="updateMobileDialog"
|
|
|
width="30%"
|
|
|
center
|
|
|
>
|
|
|
<el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; text-align: center">
|
|
|
- <el-card class="box-card">
|
|
|
- <div class="text item">
|
|
|
- <el-form :model="updateForm">
|
|
|
- <el-form-item>
|
|
|
- <el-input
|
|
|
- v-model="updateForm.content"
|
|
|
- type="text"
|
|
|
- clearable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click.native="onUpdate"
|
|
|
- >更新</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
- </el-row>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog
|
|
|
- :title="updateTitle"
|
|
|
- append-to-body
|
|
|
- :visible.sync="updateEmailDialog"
|
|
|
- width="30%"
|
|
|
- center
|
|
|
- >
|
|
|
- <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; text-align: center">
|
|
|
- <el-card class="box-card">
|
|
|
- <div class="text item">
|
|
|
- <el-form ref="form" :model="updateEmailForm" label-width="100px">
|
|
|
- <el-form-item label="邮箱/手机号" label-width="100px">
|
|
|
- <el-input
|
|
|
- v-model="updateEmailForm.principal"
|
|
|
- placeholder="请输入邮箱或手机号"
|
|
|
- style="width: 45%; padding-right: 10px"
|
|
|
- clearable
|
|
|
- />
|
|
|
- <el-button :disabled="isBtn" @click="sendVerifyCode">{{ code }}</el-button>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="验证码" label-width="90px">
|
|
|
- <el-input
|
|
|
- v-model="updateEmailForm.verifyCode"
|
|
|
- placeholder="请输入短信验证码"
|
|
|
- style="padding-right: 1px"
|
|
|
- clearable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="密码">
|
|
|
- <el-input
|
|
|
- v-model="updateEmailForm.credential"
|
|
|
- type="password"
|
|
|
- placeholder="请输入密码"
|
|
|
- style="padding-right: 1px"
|
|
|
- clearable
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click.native="updateUserEmail"
|
|
|
- >更新</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- </el-card>
|
|
|
+ <el-form ref="form" :model="updateMobileForm" label-width="100px">
|
|
|
+ <el-form-item label="邮箱/手机号" label-width="100px">
|
|
|
+ <el-input
|
|
|
+ v-model="updateMobileForm.principal"
|
|
|
+ placeholder="请输入邮箱或手机号"
|
|
|
+ style="width: 45%; padding-right: 10px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ <el-button :disabled="isBtn" @click="sendVerifyCode">{{ code }}</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="验证码" label-width="90px">
|
|
|
+ <el-input
|
|
|
+ v-model="updateMobileForm.verifyCode"
|
|
|
+ placeholder="请输入短信验证码"
|
|
|
+ style="padding-right: 1px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="密码">
|
|
|
+ <el-input
|
|
|
+ v-model="updateMobileForm.credential"
|
|
|
+ type="password"
|
|
|
+ placeholder="请输入密码"
|
|
|
+ style="padding-right: 1px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click.native="updateUserEmail"
|
|
|
+ >更新</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</el-row>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
@@ -217,7 +183,6 @@ import { userMixin } from 'assets/js/mixin'
|
|
|
import { updateAvatar } from '@/api/account'
|
|
|
import { getAuthedUser, updateAuthedUser } from '@/utils/auth'
|
|
|
import { getAvatarChannelInfo } from '@/api/file'
|
|
|
-import { updateUserProfile } from '@/api/user'
|
|
|
|
|
|
export default {
|
|
|
name: 'MyProfile',
|
|
|
@@ -234,15 +199,10 @@ export default {
|
|
|
coverUrl: null,
|
|
|
// ****************************************************************************************************************
|
|
|
loginUser: null,
|
|
|
- updateDialog: false,
|
|
|
updateType: 1,
|
|
|
updateTitle: '',
|
|
|
- updateForm: {
|
|
|
- type: 1,
|
|
|
- content: null
|
|
|
- },
|
|
|
- updateEmailDialog: false,
|
|
|
- updateEmailForm: {
|
|
|
+ updateMobileDialog: false,
|
|
|
+ updateMobileForm: {
|
|
|
principal: null,
|
|
|
verifyCode: null,
|
|
|
credential: null,
|
|
|
@@ -335,63 +295,27 @@ export default {
|
|
|
showUpdateDialog(type) {
|
|
|
if (type === 1) {
|
|
|
this.updateType = 1
|
|
|
- this.updateTitle = '更新用户显示名'
|
|
|
- this.updateDialog = true
|
|
|
+ this.updateTitle = '更新用户手机号'
|
|
|
+ this.updateMobileDialog = true
|
|
|
} else if (type === 2) {
|
|
|
this.updateType = 2
|
|
|
- this.updateTitle = '更新用户邮箱'
|
|
|
- this.updateEmailDialog = true
|
|
|
- } else if (type === 3) {
|
|
|
- this.updateType = 3
|
|
|
- this.updateTitle = '更新用户手机号'
|
|
|
- this.updateEmailDialog = true
|
|
|
- } else if (type === 4) {
|
|
|
- this.updateType = 4
|
|
|
this.updateTitle = '更新用户密码'
|
|
|
this.updatePasswordDialog = true
|
|
|
- } else if (type === 5) {
|
|
|
- this.updateType = 5
|
|
|
- this.updateTitle = '更新用户性别'
|
|
|
- this.updateDialog = true
|
|
|
- } else if (type === 6) {
|
|
|
- this.updateType = 6
|
|
|
- this.updateTitle = '更新用户签名'
|
|
|
- this.updateDialog = true
|
|
|
}
|
|
|
},
|
|
|
onUpdate() {
|
|
|
- updateUserProfile(this.updateForm).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.updateForm.content = null
|
|
|
- this.$notify.info({
|
|
|
- message: '用户资料已更新',
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$notify.warning({
|
|
|
- message: resp.msg,
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.$notify.error({
|
|
|
- message: error.message,
|
|
|
- duration: 3000
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- if (this.updateType === 2 || this.updateType === 3) {
|
|
|
- this.updateEmailDialog = false
|
|
|
+ if (this.updateType === 1) {
|
|
|
+ this.updateMobileDialog = false
|
|
|
} else {
|
|
|
- this.updateDialog = false
|
|
|
+ this.updatePasswordDialog = false
|
|
|
}
|
|
|
},
|
|
|
sendVerifyCode() {
|
|
|
this.$message.info('发送验证码')
|
|
|
},
|
|
|
updateUserEmail() {
|
|
|
- this.$message.info(this.updateEmailForm)
|
|
|
- this.updateEmailDialog = false
|
|
|
+ this.$message.info(this.updateMobileForm)
|
|
|
+ this.updateMobileDialog = false
|
|
|
},
|
|
|
updateUserPassword() {
|
|
|
this.$message.info(this.updatePasswordForm)
|