Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust_web
Project
Project
Details
Activity
Releases
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
张伯涛
cust_web
Commits
f01a9614
Commit
f01a9614
authored
Apr 25, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了上传逻辑
parent
25c28b46
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
22 deletions
+61
-22
opmArticle.js
src/api/contentManagement/opmArticle.js
+8
-0
index.vue
src/views/contentManagement/activity/info/index.vue
+13
-6
index.vue
src/views/contentManagement/banner/index.vue
+14
-6
index.vue
src/views/contentManagement/notice/info/index.vue
+13
-5
index.vue
src/views/operationsManagement/member/info/index.vue
+13
-5
No files found.
src/api/contentManagement/opmArticle.js
View file @
f01a9614
...
@@ -86,3 +86,11 @@ export function getOssUrl(id) {
...
@@ -86,3 +86,11 @@ export function getOssUrl(id) {
method
:
'GET'
method
:
'GET'
})
})
}
}
// oss查询图片路径
export
function
getUploadType
()
{
return
request
({
url
:
'/opmarticle/getUploadType'
,
method
:
'GET'
})
}
src/views/contentManagement/activity/info/index.vue
View file @
f01a9614
...
@@ -367,7 +367,7 @@ import { VueEditor } from 'vue2-editor'
...
@@ -367,7 +367,7 @@ import { VueEditor } from 'vue2-editor'
import
{
yesOrNo
,
enableOrDisable
}
from
'@/utils/allPageData'
import
{
yesOrNo
,
enableOrDisable
}
from
'@/utils/allPageData'
import
{
uploadLocal
,
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
uploadLocal
,
uploadPublic
}
from
'@/api/system/ossInfo'
import
'quill/dist/quill.core.css'
import
'quill/dist/quill.core.css'
import
{
getOssUrl
}
from
'@/api/contentManagement/opmArticle'
import
{
getOssUrl
,
getUploadType
}
from
'@/api/contentManagement/opmArticle'
import
axios
from
'axios'
import
axios
from
'axios'
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -437,7 +437,9 @@ export default {
...
@@ -437,7 +437,9 @@ export default {
rules
:
{
rules
:
{
startDateS
:
[],
startDateS
:
[],
endDateS
:
[]
endDateS
:
[]
}
},
// 上传类型
uploadType
:
'aliYun_direct'
}
}
},
},
computed
:
{
computed
:
{
...
@@ -455,7 +457,6 @@ export default {
...
@@ -455,7 +457,6 @@ export default {
}
}
return
match
return
match
})
})
console
.
log
(
'formattedDetails'
,
updatedHtml
)
return
updatedHtml
return
updatedHtml
}
}
},
},
...
@@ -471,6 +472,12 @@ export default {
...
@@ -471,6 +472,12 @@ export default {
this
.
setFormDefaults
()
this
.
setFormDefaults
()
},
},
methods
:
{
methods
:
{
// 获取上传类型
getUploadType
()
{
getUploadType
().
then
(
res
=>
{
this
.
uploadType
=
res
.
data
})
},
// 时间填写验证
// 时间填写验证
validateEndTime
(
rule
,
value
,
callback
)
{
validateEndTime
(
rule
,
value
,
callback
)
{
if
(
value
&&
this
.
form
.
startTime
)
{
if
(
value
&&
this
.
form
.
startTime
)
{
...
@@ -501,8 +508,8 @@ export default {
...
@@ -501,8 +508,8 @@ export default {
try
{
try
{
// 发起上传请求
// 发起上传请求
uploadPublic
(
formData
).
then
(
response
=>
{
uploadPublic
(
formData
).
then
(
response
=>
{
if
(
response
.
data
.
ossInfoId
!==
null
&&
response
.
data
.
ossInfoId
!==
''
&&
response
.
data
.
ossInfoId
!==
undefined
)
{
if
(
this
.
uploadType
===
'aliYun_direct'
)
{
// oss
上
传
// oss
客户端直
传
axios
({
axios
({
method
:
'PUT'
,
method
:
'PUT'
,
url
:
response
.
data
.
url
,
url
:
response
.
data
.
url
,
...
@@ -523,7 +530,7 @@ export default {
...
@@ -523,7 +530,7 @@ export default {
})
})
})
})
}
else
{
}
else
{
// 本地上传
// 本地上传
minio上传 oss服务端上传
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
const
businessId
=
response
.
data
.
businessId
const
businessId
=
response
.
data
.
businessId
// 更新 fileList,保存文件的 URL 和其他信息
// 更新 fileList,保存文件的 URL 和其他信息
...
...
src/views/contentManagement/banner/index.vue
View file @
f01a9614
...
@@ -194,7 +194,7 @@ import { addCmsBanner, delCmsBanner, getCmsBanner, listCmsBanner, updateCmsBanne
...
@@ -194,7 +194,7 @@ import { addCmsBanner, delCmsBanner, getCmsBanner, listCmsBanner, updateCmsBanne
import
{
enableOrDisable
,
typeField
}
from
'@/utils/allPageData'
import
{
enableOrDisable
,
typeField
}
from
'@/utils/allPageData'
import
commonField
from
'@/utils/commonField'
import
commonField
from
'@/utils/commonField'
import
{
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
getOssUrl
}
from
'@/api/contentManagement/opmArticle'
import
{
getOssUrl
,
getUploadType
}
from
'@/api/contentManagement/opmArticle'
import
axios
from
'axios'
import
axios
from
'axios'
export
default
{
export
default
{
name
:
'CmsBanner'
,
name
:
'CmsBanner'
,
...
@@ -247,7 +247,9 @@ export default {
...
@@ -247,7 +247,9 @@ export default {
{
required
:
true
,
message
:
'请输入权重'
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请输入权重'
,
trigger
:
'change'
}
]
]
}
},
// 上传类型
uploadType
:
'aliYun_direct'
}
}
},
},
computed
:
{
computed
:
{
...
@@ -257,9 +259,15 @@ export default {
...
@@ -257,9 +259,15 @@ export default {
},
},
created
()
{
created
()
{
this
.
getList
()
// 列表查询
this
.
getList
()
// 列表查询
this
.
getUploadType
()
},
},
methods
:
{
methods
:
{
/** 上传 */
// 获取上传类型
getUploadType
()
{
getUploadType
().
then
(
res
=>
{
this
.
uploadType
=
res
.
data
})
},
// 获取对应的分类名称
// 获取对应的分类名称
getTypeValue
(
type
)
{
getTypeValue
(
type
)
{
// 查找 type 对应的 value
// 查找 type 对应的 value
...
@@ -449,8 +457,8 @@ export default {
...
@@ -449,8 +457,8 @@ export default {
try
{
try
{
// 发起上传请求
// 发起上传请求
uploadPublic
(
formData
).
then
(
response
=>
{
uploadPublic
(
formData
).
then
(
response
=>
{
if
(
response
.
data
.
ossInfoId
!==
null
&&
response
.
data
.
ossInfoId
!==
''
&&
response
.
data
.
ossInfoId
!==
undefined
)
{
if
(
this
.
uploadType
===
'aliYun_direct'
)
{
// oss
上
传
// oss
客户端直
传
axios
({
axios
({
method
:
'PUT'
,
method
:
'PUT'
,
url
:
response
.
data
.
url
,
url
:
response
.
data
.
url
,
...
@@ -471,7 +479,7 @@ export default {
...
@@ -471,7 +479,7 @@ export default {
})
})
})
})
}
else
{
}
else
{
// 本地上传
// 本地上传
minio上传 oss服务端上传
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
const
businessId
=
response
.
data
.
businessId
const
businessId
=
response
.
data
.
businessId
// 更新 fileList,保存文件的 URL 和其他信息
// 更新 fileList,保存文件的 URL 和其他信息
...
...
src/views/contentManagement/notice/info/index.vue
View file @
f01a9614
...
@@ -165,7 +165,7 @@ import {
...
@@ -165,7 +165,7 @@ import {
import
{
VueEditor
}
from
'vue2-editor'
import
{
VueEditor
}
from
'vue2-editor'
import
{
yesOrNo
,
enableOrDisable
}
from
'@/utils/allPageData'
import
{
yesOrNo
,
enableOrDisable
}
from
'@/utils/allPageData'
import
{
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
getOssUrl
}
from
'@/api/contentManagement/opmArticle'
import
{
getOssUrl
,
getUploadType
}
from
'@/api/contentManagement/opmArticle'
import
'quill/dist/quill.core.css'
import
'quill/dist/quill.core.css'
import
axios
from
'axios'
import
axios
from
'axios'
export
default
{
export
default
{
...
@@ -244,7 +244,9 @@ export default {
...
@@ -244,7 +244,9 @@ export default {
rules
:
{
rules
:
{
startDateS
:
[],
startDateS
:
[],
endDateS
:
[]
endDateS
:
[]
}
},
// 上传类型
uploadType
:
'aliYun_direct'
}
}
},
},
computed
:
{
computed
:
{
...
@@ -277,6 +279,12 @@ export default {
...
@@ -277,6 +279,12 @@ export default {
this
.
setFormDefaults
()
this
.
setFormDefaults
()
},
},
methods
:
{
methods
:
{
// 获取上传类型
getUploadType
()
{
getUploadType
().
then
(
res
=>
{
this
.
uploadType
=
res
.
data
})
},
// 活动内容预览
// 活动内容预览
contentPreview
()
{
contentPreview
()
{
this
.
open
=
true
this
.
open
=
true
...
@@ -311,8 +319,8 @@ export default {
...
@@ -311,8 +319,8 @@ export default {
try
{
try
{
// 发起上传请求
// 发起上传请求
uploadPublic
(
formData
).
then
(
response
=>
{
uploadPublic
(
formData
).
then
(
response
=>
{
if
(
response
.
data
.
ossInfoId
!==
null
&&
response
.
data
.
ossInfoId
!==
''
&&
response
.
data
.
ossInfoId
!==
undefined
)
{
if
(
this
.
uploadType
===
'aliYun_direct'
)
{
// oss
上
传
// oss
客户端直
传
axios
({
axios
({
method
:
'PUT'
,
method
:
'PUT'
,
url
:
response
.
data
.
url
,
url
:
response
.
data
.
url
,
...
@@ -333,7 +341,7 @@ export default {
...
@@ -333,7 +341,7 @@ export default {
})
})
})
})
}
else
{
}
else
{
// 本地上传
// 本地上传
minio上传 oss服务端上传
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
const
businessId
=
response
.
data
.
businessId
const
businessId
=
response
.
data
.
businessId
// 更新 fileList,保存文件的 URL 和其他信息
// 更新 fileList,保存文件的 URL 和其他信息
...
...
src/views/operationsManagement/member/info/index.vue
View file @
f01a9614
...
@@ -581,7 +581,7 @@ import {
...
@@ -581,7 +581,7 @@ import {
import
{
getOptions
}
from
'@/utils/options'
import
{
getOptions
}
from
'@/utils/options'
import
{
getMemInfo
,
getPrivateInfo
,
updateMemInfo
}
from
'@/api/contentManagement/memInfo'
import
{
getMemInfo
,
getPrivateInfo
,
updateMemInfo
}
from
'@/api/contentManagement/memInfo'
import
{
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
uploadPublic
}
from
'@/api/system/ossInfo'
import
{
getOssUrl
}
from
'@/api/contentManagement/opmArticle'
import
{
getOssUrl
,
getUploadType
}
from
'@/api/contentManagement/opmArticle'
import
axios
from
'axios'
import
axios
from
'axios'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -752,7 +752,9 @@ export default {
...
@@ -752,7 +752,9 @@ export default {
],
],
showSecretData
:
true
,
showSecretData
:
true
,
memEducationUrl
:
''
,
memEducationUrl
:
''
,
memWorkUrl
:
''
memWorkUrl
:
''
,
// 上传类型
uploadType
:
'aliYun_direct'
}
}
},
},
computed
:
{
computed
:
{
...
@@ -815,6 +817,12 @@ export default {
...
@@ -815,6 +817,12 @@ export default {
this
.
setFormDefaults
()
this
.
setFormDefaults
()
},
},
methods
:
{
methods
:
{
// 获取上传类型
getUploadType
()
{
getUploadType
().
then
(
res
=>
{
this
.
uploadType
=
res
.
data
})
},
setFormDefaults
()
{
setFormDefaults
()
{
const
isOperation
=
this
.
isOperation
const
isOperation
=
this
.
isOperation
// 判断是新增、编辑还是查看
// 判断是新增、编辑还是查看
...
@@ -1055,8 +1063,8 @@ export default {
...
@@ -1055,8 +1063,8 @@ export default {
try
{
try
{
// 发起上传请求
// 发起上传请求
uploadPublic
(
formData
).
then
(
response
=>
{
uploadPublic
(
formData
).
then
(
response
=>
{
if
(
response
.
data
.
ossInfoId
!==
null
&&
response
.
data
.
ossInfoId
!==
''
&&
response
.
data
.
ossInfoId
!==
undefined
)
{
if
(
this
.
uploadType
===
'aliYun_direct'
)
{
//
oss上
传
//
客户端oss直
传
axios
({
axios
({
method
:
'PUT'
,
method
:
'PUT'
,
url
:
response
.
data
.
url
,
url
:
response
.
data
.
url
,
...
@@ -1077,7 +1085,7 @@ export default {
...
@@ -1077,7 +1085,7 @@ export default {
})
})
})
})
}
else
{
}
else
{
// 本地上传
// 本地上传
minio上传 oss服务端上传
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
getOssUrl
(
response
.
data
.
businessId
).
then
(
res1
=>
{
const
businessId
=
response
.
data
.
businessId
const
businessId
=
response
.
data
.
businessId
// 更新 fileList,保存文件的 URL 和其他信息
// 更新 fileList,保存文件的 URL 和其他信息
...
...
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