|
@@ -28,9 +28,10 @@
|
|
<el-upload
|
|
<el-upload
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
:action="action"
|
|
:action="action"
|
|
|
|
+ :headers="getToken"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:on-success="handleAvatarSuccess"
|
|
:on-success="handleAvatarSuccess"
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
|
|
|
+ :before-upload="beforeUpload"
|
|
>
|
|
>
|
|
<img v-if="form.businessLicenseImage" :src="form.businessLicenseImage" class="avatar">
|
|
<img v-if="form.businessLicenseImage" :src="form.businessLicenseImage" class="avatar">
|
|
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
@@ -43,9 +44,10 @@
|
|
<el-upload
|
|
<el-upload
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
:action="action"
|
|
:action="action"
|
|
|
|
+ :headers="getToken"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:on-success="handleDoorwaySuccess"
|
|
:on-success="handleDoorwaySuccess"
|
|
- :before-upload="beforeAvatarUpload"
|
|
|
|
|
|
+ :before-upload="beforeUpload"
|
|
>
|
|
>
|
|
<img v-if="form.headpic" :src="form.headpic" class="avatar">
|
|
<img v-if="form.headpic" :src="form.headpic" class="avatar">
|
|
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
|
@@ -72,13 +74,11 @@
|
|
// 引入省市区组件,公共组件所在的路径
|
|
// 引入省市区组件,公共组件所在的路径
|
|
import City from '@/components/Ctiy'
|
|
import City from '@/components/Ctiy'
|
|
import { addNewClub, saveAddClubUser } from '@/api/club'
|
|
import { addNewClub, saveAddClubUser } from '@/api/club'
|
|
-import { uploadFile, getBase64 } from '@/api/other'
|
|
|
|
-// import { addNewClub } from '@/api/club'
|
|
|
|
export default {
|
|
export default {
|
|
components: { City },
|
|
components: { City },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- action: `${this.baseUrl}/mall/uploadFile/imageUpload`,
|
|
|
|
|
|
+ action: `${this.baseUrl}/formData/MultiPictareaddData`,
|
|
userID: this.$route.query.userID,
|
|
userID: this.$route.query.userID,
|
|
clubID: this.$route.query.clubID,
|
|
clubID: this.$route.query.clubID,
|
|
dialogImageUrl: '',
|
|
dialogImageUrl: '',
|
|
@@ -113,6 +113,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ getToken() {
|
|
|
|
+ return {
|
|
|
|
+ 'token': this.$store.getters.token
|
|
|
|
+ }
|
|
|
|
+ },
|
|
organizeID() {
|
|
organizeID() {
|
|
return this.$store.getters.organizeID
|
|
return this.$store.getters.organizeID
|
|
}
|
|
}
|
|
@@ -173,32 +178,14 @@ export default {
|
|
this.addList.townID = data.townid
|
|
this.addList.townID = data.townid
|
|
},
|
|
},
|
|
// 上传图标事件
|
|
// 上传图标事件
|
|
- handleAvatarSuccess(res, file) {
|
|
|
|
- getBase64(file.raw).then(res => {
|
|
|
|
- uploadFile({ imgStr: res }).then(response => {
|
|
|
|
- console.log(response)
|
|
|
|
- if (response.code === '1') {
|
|
|
|
- this.form.businessLicenseImage = response.data
|
|
|
|
- } else {
|
|
|
|
- this.$message.error('上传图片失败')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ handleAvatarSuccess(response, file) {
|
|
|
|
+ this.form.businessLicenseImage = response.data
|
|
},
|
|
},
|
|
- handleDoorwaySuccess(res, file) {
|
|
|
|
- getBase64(file.raw).then(res => {
|
|
|
|
- uploadFile({ imgStr: res }).then(response => {
|
|
|
|
- console.log(response)
|
|
|
|
- if (response.code === '1') {
|
|
|
|
- this.form.headpic = response.data
|
|
|
|
- } else {
|
|
|
|
- this.$message.error('上传图片失败')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ handleDoorwaySuccess(response, file) {
|
|
|
|
+ this.form.headpic = response.data
|
|
},
|
|
},
|
|
// 对上传图片的大小、格式进行限制
|
|
// 对上传图片的大小、格式进行限制
|
|
- beforeAvatarUpload(file) {
|
|
|
|
|
|
+ beforeUpload(file) {
|
|
const isJPG = file.type === 'image/jpeg'
|
|
const isJPG = file.type === 'image/jpeg'
|
|
const isJPG2 = file.type === 'image/jpg'
|
|
const isJPG2 = file.type === 'image/jpg'
|
|
const isPNG = file.type === 'image/png'
|
|
const isPNG = file.type === 'image/png'
|