File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
web/src/components/upload Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1313 <el-upload
1414 class =" image-uploader"
1515 :action =" `${path}/fileUploadAndDownload/upload`"
16+ :headers =" { 'x-token': token }"
1617 :show-file-list =" false"
1718 :on-success =" handleImageSuccess"
1819 :before-upload =" beforeImageUpload"
1920 :multiple =" false"
2021 >
21- <img v-if =" imageUrl" :src =" imageUrl" class =" image" />
22+ <img v-if =" imageUrl" :src =" path + imageUrl" class =" image" />
2223 <i v-else class =" el-icon-plus image-uploader-icon" ></i >
2324 </el-upload >
2425 </div >
2526</template >
2627<script >
2728const path = process .env .VUE_APP_BASE_API ;
29+ import { mapGetters } from " vuex" ;
2830import ImageCompress from " @/utils/image.js" ;
2931export default {
3032 name: " upload-image" ,
@@ -51,6 +53,9 @@ export default {
5153 path: path,
5254 };
5355 },
56+ computed: {
57+ ... mapGetters (" user" , [" userInfo" , " token" ]),
58+ },
5459 methods: {
5560 beforeImageUpload (file ) {
5661 let isRightSize = file .size / 1024 < this .fileSize ;
@@ -97,4 +102,4 @@ export default {
97102 height : 178px ;
98103 display : block ;
99104}
100- </style >
105+ </style >
You can’t perform that action at this time.
0 commit comments