Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
0d9fb8b5
Commit
0d9fb8b5
authored
Apr 18, 2025
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持文件&图片组件自定义地址&参数
parent
c6b0efcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
index.vue
ruoyi-ui/src/components/FileUpload/index.vue
+11
-1
index.vue
ruoyi-ui/src/components/ImageUpload/index.vue
+11
-1
No files found.
ruoyi-ui/src/components/FileUpload/index.vue
View file @
0d9fb8b5
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
: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"
...
@@ -48,6 +49,15 @@ export default {
...
@@ -48,6 +49,15 @@ export default {
props
:
{
props
:
{
// 值
// 值
value
:
[
String
,
Object
,
Array
],
value
:
[
String
,
Object
,
Array
],
// 上传接口地址
action
:
{
type
:
String
,
default
:
"/common/upload"
},
// 上传携带的参数
data
:
{
type
:
Object
},
// 数量限制
// 数量限制
limit
:
{
limit
:
{
type
:
Number
,
type
:
Number
,
...
@@ -79,7 +89,7 @@ export default {
...
@@ -79,7 +89,7 @@ export default {
number
:
0
,
number
:
0
,
uploadList
:
[],
uploadList
:
[],
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
,
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
,
uploadFileUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"/common/upload"
,
// 上传文件服务器地址
uploadFileUrl
:
process
.
env
.
VUE_APP_BASE_API
+
this
.
action
,
// 上传文件服务器地址
headers
:
{
headers
:
{
Authorization
:
"Bearer "
+
getToken
(),
Authorization
:
"Bearer "
+
getToken
(),
},
},
...
...
ruoyi-ui/src/components/ImageUpload/index.vue
View file @
0d9fb8b5
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
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,6 +50,15 @@ import { isExternal } from "@/utils/validate";
...
@@ -49,6 +50,15 @@ import { isExternal } from "@/utils/validate";
export
default
{
export
default
{
props
:
{
props
:
{
value
:
[
String
,
Object
,
Array
],
value
:
[
String
,
Object
,
Array
],
// 上传接口地址
action
:
{
type
:
String
,
default
:
"/common/upload"
},
// 上传携带的参数
data
:
{
type
:
Object
},
// 图片数量限制
// 图片数量限制
limit
:
{
limit
:
{
type
:
Number
,
type
:
Number
,
...
@@ -78,7 +88,7 @@ export default {
...
@@ -78,7 +88,7 @@ export default {
dialogVisible
:
false
,
dialogVisible
:
false
,
hideUpload
:
false
,
hideUpload
:
false
,
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
,
baseUrl
:
process
.
env
.
VUE_APP_BASE_API
,
uploadImgUrl
:
process
.
env
.
VUE_APP_BASE_API
+
"/common/upload"
,
// 上传的图片服务器地址
uploadImgUrl
:
process
.
env
.
VUE_APP_BASE_API
+
this
.
action
,
// 上传的图片服务器地址
headers
:
{
headers
:
{
Authorization
:
"Bearer "
+
getToken
(),
Authorization
:
"Bearer "
+
getToken
(),
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment