Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
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
viitto
pptist
Commits
1f297b3b
Commit
1f297b3b
authored
Nov 30, 2023
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化上传行程特色图片
parent
efb102d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
domainManager.ts
src/utils/domainManager.ts
+4
-3
requestUpload.ts
src/utils/requestUpload.ts
+0
-2
index.vue
src/views/Editor/EditorHeader/index.vue
+19
-16
No files found.
src/utils/domainManager.ts
View file @
1f297b3b
export
const
domainManager
=
()
=>
{
export
const
domainManager
=
()
=>
{
const
locationName
=
window
.
location
.
hostname
const
locationName
=
window
.
location
.
hostname
console
.
log
(
window
.
location
.
hostname
,
'=====hostname'
)
const
obj
=
{
const
obj
=
{
domainUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.10.214/api/common/post"
,
domainUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.10.214/api/common/post"
,
//上传站点
//上传站点
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.10.214:8120"
,
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.10.214:8120"
,
//文件站点
//文件站点
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
"http://imgfile.oytour.com/"
:
'http://192.168.10.214:8130/
'
,
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://imgfile.oytour.com/"
:
'http://192.168.10.214:8130
'
,
}
}
return
obj
return
obj
}
}
\ No newline at end of file
src/utils/requestUpload.ts
View file @
1f297b3b
import
service
,
{
ApiResult
}
from
"../configs/axiosUpload"
;
import
service
,
{
ApiResult
}
from
"../configs/axiosUpload"
;
import
{
userStore
}
from
"@/store/user"
;
import
md5
from
"md5-ts"
;
export
interface
HttpResponse
{
export
interface
HttpResponse
{
status
:
number
status
:
number
...
...
src/views/Editor/EditorHeader/index.vue
View file @
1f297b3b
...
@@ -262,7 +262,7 @@ const SetTripTemplateConfig = async () => {
...
@@ -262,7 +262,7 @@ const SetTripTemplateConfig = async () => {
message
:
'操作成功'
,
message
:
'操作成功'
,
type
:
'success'
,
type
:
'success'
,
})
})
FeatureImgStore
.
setFeatureImg
([])
dataLoadingStore
.
setDataLoading
(
true
)
dataLoadingStore
.
setDataLoading
(
true
)
}
else
{
}
else
{
ElMessage
({
ElMessage
({
...
@@ -271,8 +271,10 @@ const SetTripTemplateConfig = async () => {
...
@@ -271,8 +271,10 @@ const SetTripTemplateConfig = async () => {
type
:
'warning'
,
type
:
'warning'
,
})
})
}
}
FeatureImgStore
.
setFeatureImg
([])
datas
.
loading
=
false
datas
.
loading
=
false
}
catch
(
error
)
{
}
catch
(
error
)
{
FeatureImgStore
.
setFeatureImg
([])
datas
.
loading
=
false
datas
.
loading
=
false
ElMessage
({
ElMessage
({
showClose
:
true
,
showClose
:
true
,
...
@@ -284,12 +286,6 @@ const SetTripTemplateConfig = async () => {
...
@@ -284,12 +286,6 @@ const SetTripTemplateConfig = async () => {
// 保存
// 保存
const
setTemplate
=
async
()
=>
{
const
setTemplate
=
async
()
=>
{
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
slides
.
value
))
let
arr
=
JSON
.
parse
(
JSON
.
stringify
(
slides
.
value
))
arr
.
forEach
(
x
=>
{
x
.
elements
.
forEach
(
y
=>
{
delete
y
.
TemplateList
delete
y
.
TemplateDataSource
})
})
if
(
ConfigId
.
value
&&
FeatureImg
.
value
.
length
>
0
){
if
(
ConfigId
.
value
&&
FeatureImg
.
value
.
length
>
0
){
FeatureImg
.
value
.
forEach
(
item
=>
{
FeatureImg
.
value
.
forEach
(
item
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -302,13 +298,21 @@ const setTemplate = async () =>{
...
@@ -302,13 +298,21 @@ const setTemplate = async () =>{
}
}
// console.log(JSON.stringify(slides.value),'----保存接口',queryObj.value)
// console.log(JSON.stringify(slides.value),'----保存接口',queryObj.value)
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
if
(
CoverImg
&&
CoverImg
.
value
)
queryObj
.
value
.
CoverImg
=
CoverImg
.
value
arr
.
forEach
(
x
=>
{
else
return
ElMessage
(
{
x
.
elements
.
forEach
(
y
=>
{
showClose
:
true
,
delete
y
.
TemplateList
message
:
'请生成封面图'
,
delete
y
.
TemplateDataSource
type
:
'warning'
,
})
})
})
if
(
CoverImg
&&
CoverImg
.
value
)
queryObj
.
value
.
CoverImg
=
CoverImg
.
value
else
{
mainStore
.
setToolbarState
(
ToolbarStates
.
EL_TEMPLATEDATA
)
return
ElMessage
({
showClose
:
true
,
message
:
'请生成封面图'
,
type
:
'warning'
,
})
}
if
(
queryObj
.
value
.
Title
==
''
||!
queryObj
.
value
.
LineId
||!
queryObj
.
value
.
LtId
if
(
queryObj
.
value
.
Title
==
''
||!
queryObj
.
value
.
LineId
||!
queryObj
.
value
.
LtId
||
queryObj
.
value
.
CoverImg
==
''
||
queryObj
.
value
.
CoverImg
==
''
||
queryObj
.
value
.
CountryName
==
''
||
queryObj
.
value
.
SeasonName
==
''
||
queryObj
.
value
.
CountryName
==
''
||
queryObj
.
value
.
SeasonName
==
''
...
@@ -346,10 +350,9 @@ const setTemplate = async () =>{
...
@@ -346,10 +350,9 @@ const setTemplate = async () =>{
// }
// }
// }
// }
}
}
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
arr
)
datas
.
loading
=
true
datas
.
loading
=
true
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
if
(
model
.
value
&&
userInfo
.
value
.
IsEditTripTemplate
==
1
){
queryObj
.
value
.
TempData
=
JSON
.
stringify
(
arr
)
await
SetTripTemplateSlide
()
await
SetTripTemplateSlide
()
}
else
if
(
ConfigId
.
value
){
}
else
if
(
ConfigId
.
value
){
await
SetTripTemplateConfig
()
await
SetTripTemplateConfig
()
...
@@ -366,7 +369,7 @@ const setFeatureImgList = async (url) => {
...
@@ -366,7 +369,7 @@ const setFeatureImgList = async (url) => {
let
path
=
`?fileType=1&fileLimit=5&&filePath=Feature/
${
ConfigId
.
value
}
_`
let
path
=
`?fileType=1&fileLimit=5&&filePath=Feature/
${
ConfigId
.
value
}
_`
let
Res
=
await
UploadService
.
UploadBase64Two
(
path
,
queryObj
);
let
Res
=
await
UploadService
.
UploadBase64Two
(
path
,
queryObj
);
if
(
Res
.
data
&&
Res
.
data
.
FilePath
)
{
if
(
Res
.
data
&&
Res
.
data
.
FilePath
)
{
datas
.
FeatureImgList
.
push
(
`
${
domainManager
().
ViittoFileUrl
}${
Res
.
data
.
FilePath
}
`
)
datas
.
FeatureImgList
.
push
(
`
${
domainManager
().
ViittoFileUrl
}
/
${
Res
.
data
.
FilePath
}
`
)
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
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