diff --git a/yudao-ui-admin/src/components/FileUpload/index.vue b/yudao-ui-admin/src/components/FileUpload/index.vue index d19b7db91..84b7df236 100644 --- a/yudao-ui-admin/src/components/FileUpload/index.vue +++ b/yudao-ui-admin/src/components/FileUpload/index.vue @@ -28,7 +28,7 @@
  • - + {{ getFileName(file.name) }}
    @@ -72,11 +72,8 @@ export default { return { number: 0, uploadList: [], - baseUrl: process.env.VUE_APP_BASE_API, - uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 - headers: { - Authorization: "Bearer " + getAccessToken(), - }, + uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址 + headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部 fileList: [], }; }, @@ -121,8 +118,7 @@ export default { } const isTypeOk = this.fileType.some((type) => { if (file.type.indexOf(type) > -1) return true; - if (fileExtension && fileExtension.indexOf(type) > -1) return true; - return false; + return !!(fileExtension && fileExtension.indexOf(type) > -1); }); if (!isTypeOk) { this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); @@ -152,7 +148,8 @@ export default { }, // 上传成功回调 handleUploadSuccess(res) { - this.uploadList.push({ name: res.fileName, url: res.fileName }); + // edit by 芋道源码 + this.uploadList.push({ name: res.data, url: res.data }); if (this.uploadList.length === this.number) { this.fileList = this.fileList.concat(this.uploadList); this.uploadList = []; @@ -181,7 +178,7 @@ export default { for (let i in list) { strs += list[i].url + separator; } - return strs != '' ? strs.substr(0, strs.length - 1) : ''; + return strs !== '' ? strs.substr(0, strs.length - 1) : ''; } } }; diff --git a/yudao-ui-admin/src/views/system/oauth2/client/index.vue b/yudao-ui-admin/src/views/system/oauth2/client/index.vue index 31cf94142..f80c847ca 100755 --- a/yudao-ui-admin/src/views/system/oauth2/client/index.vue +++ b/yudao-ui-admin/src/views/system/oauth2/client/index.vue @@ -70,7 +70,8 @@ - + + @@ -104,10 +105,12 @@ import { createOAuth2Client, updateOAuth2Client, deleteOAuth2Client, getOAuth2Cl import ImageUpload from '@/components/ImageUpload'; import Editor from '@/components/Editor'; import {CommonStatusEnum} from "@/utils/constants"; +import FileUpload from "@/components/FileUpload"; export default { name: "OAuth2Client", components: { + FileUpload, ImageUpload, Editor, },