|
|
@@ -4,7 +4,7 @@
|
|
|
<el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfix">
|
|
|
- <span>我的资料</span>
|
|
|
+ <span>我的帐号</span>
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
<el-form ref="form" :model="loginUser" label-width="80px">
|
|
|
@@ -26,8 +26,8 @@
|
|
|
<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-form-item>
|
|
|
- <el-form-item label="签名">
|
|
|
- <el-input v-model="loginUser.signature" type="textarea" style="width: 70%; padding-right: 10px" readonly />
|
|
|
+ <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-form-item>
|
|
|
</el-form>
|
|
|
@@ -61,6 +61,27 @@
|
|
|
</el-card>
|
|
|
</el-row>
|
|
|
</el-col>
|
|
|
+ <el-col :md="8" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
+ <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>我的资料</span>
|
|
|
+ </div>
|
|
|
+ <div class="text item">
|
|
|
+ <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-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
|
|
|
<el-dialog
|
|
|
:title="updateTitle"
|
|
|
@@ -69,27 +90,130 @@
|
|
|
width="30%"
|
|
|
center
|
|
|
>
|
|
|
- <el-row>
|
|
|
- <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
- <el-row>
|
|
|
- <el-form :inline="true" :model="updateForm">
|
|
|
+ <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 size="mini" type="warning" @click="onUpdate">更新</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click.native="onUpdate"
|
|
|
+ >更新</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
+ </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-row>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="updateTitle"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="updatePasswordDialog"
|
|
|
+ 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="updatePasswordForm" label-width="100px">
|
|
|
+ <el-form-item label="当前密码">
|
|
|
+ <el-input
|
|
|
+ v-model="updatePasswordForm.credential"
|
|
|
+ type="password"
|
|
|
+ placeholder="请输入当前密码"
|
|
|
+ style="padding-right: 1px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="新密码">
|
|
|
+ <el-input
|
|
|
+ v-model="updatePasswordForm.credential"
|
|
|
+ type="password"
|
|
|
+ placeholder="请输入新密码"
|
|
|
+ style="padding-right: 1px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="确认新密码">
|
|
|
+ <el-input
|
|
|
+ v-model="updatePasswordForm.credential"
|
|
|
+ type="password"
|
|
|
+ placeholder="请确认新密码"
|
|
|
+ style="padding-right: 1px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click.native="updateUserPassword"
|
|
|
+ >更新</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
</el-row>
|
|
|
</el-dialog>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { userMixin } from 'assets/js/mixin'
|
|
|
import { updateAvatar } from '@/api/account'
|
|
|
import { getAuthedUser, updateAuthedUser } from '@/utils/auth'
|
|
|
import { getAvatarChannelInfo } from '@/api/file'
|
|
|
@@ -97,6 +221,7 @@ import { updateUserProfile } from '@/api/user'
|
|
|
|
|
|
export default {
|
|
|
name: 'MyProfile',
|
|
|
+ mixins: [userMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
imgOssUrl: '',
|
|
|
@@ -115,6 +240,24 @@ export default {
|
|
|
updateForm: {
|
|
|
type: 1,
|
|
|
content: null
|
|
|
+ },
|
|
|
+ updateEmailDialog: false,
|
|
|
+ updateEmailForm: {
|
|
|
+ principal: null,
|
|
|
+ verifyCode: null,
|
|
|
+ credential: null,
|
|
|
+ captchaCode: null,
|
|
|
+ channel: 1,
|
|
|
+ plat: 2
|
|
|
+ },
|
|
|
+ updatePasswordDialog: false,
|
|
|
+ updatePasswordForm: {
|
|
|
+ principal: null,
|
|
|
+ verifyCode: null,
|
|
|
+ credential: null,
|
|
|
+ captchaCode: null,
|
|
|
+ channel: 1,
|
|
|
+ plat: 2
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -193,17 +336,28 @@ export default {
|
|
|
if (type === 1) {
|
|
|
this.updateType = 1
|
|
|
this.updateTitle = '更新用户显示名'
|
|
|
+ this.updateDialog = 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
|
|
|
}
|
|
|
- this.updateDialog = true
|
|
|
},
|
|
|
onUpdate() {
|
|
|
updateUserProfile(this.updateForm).then(resp => {
|
|
|
@@ -219,9 +373,29 @@ export default {
|
|
|
duration: 3000
|
|
|
})
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ this.$notify.error({
|
|
|
+ message: error.message,
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
})
|
|
|
|
|
|
- this.updateDialog = false
|
|
|
+ if (this.updateType === 2 || this.updateType === 3) {
|
|
|
+ this.updateEmailDialog = false
|
|
|
+ } else {
|
|
|
+ this.updateDialog = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sendVerifyCode() {
|
|
|
+ this.$message.info('发送验证码')
|
|
|
+ },
|
|
|
+ updateUserEmail() {
|
|
|
+ this.$message.info(this.updateEmailForm)
|
|
|
+ this.updateEmailDialog = false
|
|
|
+ },
|
|
|
+ updateUserPassword() {
|
|
|
+ this.$message.info(this.updatePasswordForm)
|
|
|
+ this.updatePasswordDialog = false
|
|
|
}
|
|
|
}
|
|
|
}
|