|
@@ -4,7 +4,7 @@
|
|
|
:visible.sync="visible"
|
|
|
:append-to-body="true">
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px">
|
|
|
- <upload-component :title="'个人签名'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
|
|
|
+ <upload-component :title="'个人签名'" :accept="'.png,.jpeg,.jpg'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
|
|
|
</el-form>
|
|
|
<span slot="footer">
|
|
|
<el-button @click="visible = false">取消</el-button>
|
|
@@ -14,7 +14,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { clearLoginInfo } from '@/utils'
|
|
|
import { getMyInfo } from '@/api/my'
|
|
|
import UploadComponent from './modules/common/upload-component'
|
|
|
export default {
|
|
@@ -46,6 +45,14 @@
|
|
|
getMyInfo().then(({data}) => {
|
|
|
if (data && data.code === '200' && data.data) {
|
|
|
this.dataForm = data.data
|
|
|
+ this.fileList = []
|
|
|
+ data.data.attachList.forEach((item) => {
|
|
|
+ this.fileList.push({
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.url,
|
|
|
+ id: item.url
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
this.visible = true
|
|
@@ -55,15 +62,29 @@
|
|
|
},
|
|
|
// 表单提交
|
|
|
dataFormSubmit () {
|
|
|
+ let fList = this.fileList
|
|
|
+ if (!fList || fList.length === 0) {
|
|
|
+ this.$message.error('请上传文件')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (fList.length > 1) {
|
|
|
+ this.$message.error('只能上传一个附件')
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this.dataForm.attachList = []
|
|
|
+ for (let i = 0; i < fList.length; i++) {
|
|
|
+ this.dataForm.attachList.push({
|
|
|
+ fileName: fList[i].name,
|
|
|
+ url: fList[i].url
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl('/biz-service/user/password'),
|
|
|
+ url: this.$http.adornUrl('/biz-service/personal/setSignInfo'),
|
|
|
method: 'post',
|
|
|
- data: this.$http.adornData({
|
|
|
- 'password': this.dataForm.password,
|
|
|
- 'newPassword': this.dataForm.newPassword
|
|
|
- })
|
|
|
+ data: this.dataForm
|
|
|
}).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.$message({
|
|
@@ -72,11 +93,6 @@
|
|
|
duration: 1500,
|
|
|
onClose: () => {
|
|
|
this.visible = false
|
|
|
- this.$nextTick(() => {
|
|
|
- this.mainTabs = []
|
|
|
- clearLoginInfo()
|
|
|
- this.$router.replace({ name: 'login' })
|
|
|
- })
|
|
|
}
|
|
|
})
|
|
|
} else {
|