|
|
@@ -21,7 +21,15 @@
|
|
|
@click="viewImg(item)"
|
|
|
:style="{ width: size + 'rpx', height: size + 'rpx' }"
|
|
|
:mode="imgMode"
|
|
|
+ v-if="!prefixShow"
|
|
|
/>
|
|
|
+ <img
|
|
|
+ :src="`${constant.imgUrl}/${item}`"
|
|
|
+ @click="viewImg(item)"
|
|
|
+ :style="{ width: size + 'rpx', height: size + 'rpx' }"
|
|
|
+ :mode="imgMode"
|
|
|
+ v-if="prefixShow"
|
|
|
+ />
|
|
|
</li>
|
|
|
<li
|
|
|
v-if="showImgList.length < num && (multiple || showImgList.length == 0)"
|
|
|
@@ -114,7 +122,12 @@ export default {
|
|
|
isStorage: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 是否需要拼接路径 true 需要 false 不需要
|
|
|
+ prefixShow: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -187,8 +200,13 @@ export default {
|
|
|
picAdd({
|
|
|
...params
|
|
|
}).then(res => {
|
|
|
+ let imgArr
|
|
|
if (res.code === 1) {
|
|
|
- let imgArr = [res.data.url];
|
|
|
+ if(this.prefixShow) {
|
|
|
+ imgArr = [res.data.shortUrl]
|
|
|
+ } else {
|
|
|
+ imgArr = [res.data.url];
|
|
|
+ }
|
|
|
that.showImgList = [...that.showImgList, ...imgArr];
|
|
|
that.resultData = res.data;
|
|
|
this.$emit("currentUpload", imgArr);
|
|
|
@@ -202,8 +220,13 @@ export default {
|
|
|
uploadPic({
|
|
|
...params
|
|
|
}).then(res => {
|
|
|
+ let imgArr
|
|
|
if (res.code === 1) {
|
|
|
- let imgArr = [res.data.url];
|
|
|
+ if(this.prefixShow) {
|
|
|
+ imgArr = [res.data.shortUrl]
|
|
|
+ } else {
|
|
|
+ imgArr = [res.data.url];
|
|
|
+ }
|
|
|
that.showImgList = [...that.showImgList, ...imgArr];
|
|
|
that.resultData = res.data;
|
|
|
this.$emit("currentUpload", imgArr);
|