diff --git a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamApplicationController.java b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamApplicationController.java index 7c4fcc7..f629c3f 100644 --- a/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamApplicationController.java +++ b/inspur-service/inspur-admin/src/main/java/com/inspur/web/controller/om/OmTeamApplicationController.java @@ -8,8 +8,12 @@ import javax.servlet.http.HttpServletResponse; import com.inspur.common.constant.OmConstants; import com.inspur.common.utils.StringUtils; +import com.inspur.common.utils.file.SftpUtils; import com.inspur.common.utils.uuid.IdUtils; import org.mybatis.logging.LoggerFactory; +import org.springframework.core.io.ByteArrayResource; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,7 +38,8 @@ import org.springframework.web.multipart.MultipartFile; public class OmTeamApplicationController extends BaseController { @Autowired private IOmTeamApplicationService omTeamApplicationService; - + @Autowired + private SftpUtils sftpUtils; /** * 用户查询团队注册申请列表 */ @@ -151,4 +156,16 @@ public class OmTeamApplicationController extends BaseController { out.write(bytes); } } + + /** + * 图片展示 + */ + @GetMapping("/show") + public ResponseEntity show(@RequestParam(value = "saveName", required = true) String saveName) { + byte[] bytes = omTeamApplicationService.downLoadFile(OmConstants.SAVE_PATH_SEPARATOR + sftpUtils.getBasePath() + OmConstants.SAVE_PATH_SEPARATOR + OmConstants.SAVE_PATH, saveName); + ByteArrayResource resource = new ByteArrayResource(bytes); + return ResponseEntity.ok() + .contentType(MediaType.IMAGE_JPEG) + .body(resource); + } } diff --git a/inspur-ui/src/views/order/collect/index.vue b/inspur-ui/src/views/order/collect/index.vue index 0d56b7f..65fefac 100644 --- a/inspur-ui/src/views/order/collect/index.vue +++ b/inspur-ui/src/views/order/collect/index.vue @@ -1654,13 +1654,13 @@ export default { upload: { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, - // TODO 上传的地址 - url: process.env.VUE_APP_BASE_API + "/common/upload", + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/om/application/upload/file", // 上传的图片地址 imageUrl: "", }, fileList: [], - prefix: process.env.VUE_APP_BASE_API, + prefix: process.env.VUE_APP_BASE_API + "/om/application/show?saveName=", path1: null, path2: null, formFeedback: {}, diff --git a/inspur-ui/src/views/order/dispatch/index.vue b/inspur-ui/src/views/order/dispatch/index.vue index efeffa7..682e731 100644 --- a/inspur-ui/src/views/order/dispatch/index.vue +++ b/inspur-ui/src/views/order/dispatch/index.vue @@ -1600,13 +1600,13 @@ export default { upload: { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, - // TODO 上传的地址 - url: process.env.VUE_APP_BASE_API + "/common/upload", + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/om/application/upload/file", // 上传的图片地址 imageUrl: "", }, fileList: [], - prefix: process.env.VUE_APP_BASE_API, + prefix: process.env.VUE_APP_BASE_API + "/om/application/show?saveName=", path1: null, path2: null, formFeedback: {}, diff --git a/inspur-ui/src/views/order/follow/index.vue b/inspur-ui/src/views/order/follow/index.vue index 57ad9e2..6213ef4 100644 --- a/inspur-ui/src/views/order/follow/index.vue +++ b/inspur-ui/src/views/order/follow/index.vue @@ -653,7 +653,7 @@ label="备注" prop="remark" > - { - console.log(file); - return file.response.fileName; - }) - .join(","); + // this.formFeedback.fileId = this.fileList + // .map((file) => { + // return file.response.data.saveName; + // }) + // .join(","); this.$modal.msgSuccess("上传成功"); }, handleRemove(file, fileList) { this.fileList = fileList; - this.formFeedback.fileId = this.fileList - .map((file) => { - return file.response.fileName; - }) - .join(","); - }, - handlePreview(file, fileList) { - console.log("--->>预览文件", file); + // this.formFeedback.fileId = this.fileList + // .map((file) => { + // return file.response.data.saveName; + // }) + // .join(","); }, + handlePreview(file, fileList) {}, // 备品备件相关 /** 查询备件基础维护列表 */ getSparePartsList() { diff --git a/inspur-ui/src/views/order/push/index.vue b/inspur-ui/src/views/order/push/index.vue index b76079c..5935819 100644 --- a/inspur-ui/src/views/order/push/index.vue +++ b/inspur-ui/src/views/order/push/index.vue @@ -1666,13 +1666,13 @@ export default { upload: { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, - // TODO 上传的地址 - url: process.env.VUE_APP_BASE_API + "/common/upload", + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/om/application/upload/file", // 上传的图片地址 imageUrl: "", }, fileList: [], - prefix: process.env.VUE_APP_BASE_API, + prefix: process.env.VUE_APP_BASE_API + "/om/application/show?saveName=", path1: null, path2: null, formFeedback: {}, diff --git a/inspur-ui/src/views/order/quotation/index.vue b/inspur-ui/src/views/order/quotation/index.vue index fa1b311..677f785 100644 --- a/inspur-ui/src/views/order/quotation/index.vue +++ b/inspur-ui/src/views/order/quotation/index.vue @@ -1642,13 +1642,13 @@ export default { upload: { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, - // TODO 上传的地址 - url: process.env.VUE_APP_BASE_API + "/common/upload", + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/om/application/upload/file", // 上传的图片地址 imageUrl: "", }, fileList: [], - prefix: process.env.VUE_APP_BASE_API, + prefix: process.env.VUE_APP_BASE_API + "/om/application/show?saveName=", path1: null, path2: null, formFeedback: {}, diff --git a/inspur-ui/src/views/order/record/index.vue b/inspur-ui/src/views/order/record/index.vue index 5a486a8..256f111 100644 --- a/inspur-ui/src/views/order/record/index.vue +++ b/inspur-ui/src/views/order/record/index.vue @@ -1643,13 +1643,13 @@ export default { upload: { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, - // TODO 上传的地址 - url: process.env.VUE_APP_BASE_API + "/common/upload", + // 上传的地址 + url: process.env.VUE_APP_BASE_API + "/om/application/upload/file", // 上传的图片地址 imageUrl: "", }, fileList: [], - prefix: process.env.VUE_APP_BASE_API, + prefix: process.env.VUE_APP_BASE_API + "/om/application/show?saveName=", path1: null, path2: null, formFeedback: {},