mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-02-10 10:51:58 +08:00
Compare commits
1 Commits
5d6255cfaa
...
65daf44885
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65daf44885 |
@@ -5,7 +5,6 @@
|
|||||||
:action="uploadFileUrl"
|
:action="uploadFileUrl"
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
:data="data"
|
|
||||||
:limit="limit"
|
:limit="limit"
|
||||||
:on-error="handleUploadError"
|
:on-error="handleUploadError"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
@@ -49,15 +48,6 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
// 值
|
// 值
|
||||||
value: [String, Object, Array],
|
value: [String, Object, Array],
|
||||||
// 上传接口地址
|
|
||||||
action: {
|
|
||||||
type: String,
|
|
||||||
default: "/file/upload"
|
|
||||||
},
|
|
||||||
// 上传携带的参数
|
|
||||||
data: {
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
// 数量限制
|
// 数量限制
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -88,7 +78,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
number: 0,
|
number: 0,
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + this.action, // 上传文件服务器地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传文件服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: "Bearer " + getToken(),
|
||||||
},
|
},
|
||||||
@@ -162,7 +152,7 @@ export default {
|
|||||||
// 上传失败
|
// 上传失败
|
||||||
handleUploadError(err) {
|
handleUploadError(err) {
|
||||||
this.$modal.msgError("上传文件失败,请重试");
|
this.$modal.msgError("上传文件失败,请重试");
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading()
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res, file) {
|
handleUploadSuccess(res, file) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
:on-success="handleUploadSuccess"
|
:on-success="handleUploadSuccess"
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
:data="data"
|
|
||||||
:limit="limit"
|
:limit="limit"
|
||||||
:on-error="handleUploadError"
|
:on-error="handleUploadError"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
@@ -49,15 +48,6 @@ import { getToken } from "@/utils/auth";
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
value: [String, Object, Array],
|
value: [String, Object, Array],
|
||||||
// 上传接口地址
|
|
||||||
action: {
|
|
||||||
type: String,
|
|
||||||
default: "/file/upload"
|
|
||||||
},
|
|
||||||
// 上传携带的参数
|
|
||||||
data: {
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
// 图片数量限制
|
// 图片数量限制
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -86,7 +76,7 @@ export default {
|
|||||||
dialogImageUrl: "",
|
dialogImageUrl: "",
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
hideUpload: false,
|
hideUpload: false,
|
||||||
uploadImgUrl: process.env.VUE_APP_BASE_API + this.action, // 上传的图片服务器地址
|
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: "Bearer " + getToken(),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user