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
8576cd47
Commit
8576cd47
authored
May 20, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传图
parent
15ca1172
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
23 deletions
+15
-23
router.ts
src/router/router.ts
+7
-0
aliyun.ts
src/utils/upload/aliyun.ts
+2
-19
index.vue
src/views/Editor/Thumbnails/index.vue
+6
-4
No files found.
src/router/router.ts
View file @
8576cd47
...
...
@@ -158,6 +158,13 @@ const routes: RouteRecordRaw[] = [
title
:
'行程生成预览'
}
},
{
path
:
'/PreviewCover/:tempId(
\\
d+)'
,
component
:
()
=>
import
(
'@/views/Preview/PreviewCover.vue'
),
meta
:{
title
:
'预览封面'
}
},
{
path
:
'/play/:id(
\\
d+)/:logId(
\\
d+)/:status(
\\
d+)'
,
component
:
()
=>
import
(
'@/views/Editor/PlayView.vue'
),
...
...
src/utils/upload/aliyun.ts
View file @
8576cd47
import
{
domainManager
}
from
'@/utils/domainManager'
class
AliyunUpload
{
static
readonly
REGION
=
'oss-cn-chengdu'
static
readonly
ACCESS_KEY_ID
=
'LTAI5tFgqt1pwnoA35cigYTr'
static
readonly
ACCESS_KEY_SECRET
=
'wXPoEqJ7qLdvX9iBluIebhCPSzoemy'
static
readonly
BUCKET
=
'vt-im-bucket'
static
GetOSS
=
()
=>
{
const
OSS
=
require
(
'ali-oss'
);
//return new OSS
return
new
OSS
({
region
:
this
.
REGION
,
accessKeyId
:
this
.
ACCESS_KEY_ID
,
accessKeySecret
:
this
.
ACCESS_KEY_SECRET
,
bucket
:
this
.
BUCKET
})
}
static
UploadAsync
=
async
(
file
:
any
,
name
:
string
)
=>
{
try
{
let
path
=
"/Sale/Uploadvideo/"
const
formData
=
new
FormData
();
formData
.
append
(
'file'
,
file
);
const
response
=
await
fetch
(
`
${
domainManager
().
UploadUrl
}
/Upload/UploadToALiOSS?filePath=
${
path
}
`
,
{
const
response
=
await
fetch
(
`
${
domainManager
().
UploadUrl
}
/Upload/UploadToALiOSS?filePath=
${
encodeURIComponent
(
name
)
}
`
,
{
method
:
'POST'
,
body
:
formData
,
});
if
(
response
.
ok
){
let
result
=
await
response
.
text
()
let
datas
=
JSON
.
parse
(
result
)
return
datas
.
FilePath
return
'https://im.oytour.com'
+
datas
.
FilePath
}
return
''
}
catch
(
error
)
{
...
...
src/views/Editor/Thumbnails/index.vue
View file @
8576cd47
...
...
@@ -118,7 +118,8 @@ searchData.value = inject(injectKeyTemplate)
const
acquiesceLogo
=
ref
([
'https://im.oytour.com/pptist/static/logo1.png'
,
'https://im.oytour.com/pptist/static/logo2.png'
,
'https://im.oytour.com/pptist/static/logo3.png'
'https://im.oytour.com/pptist/static/logo3.png'
,
'https://im.oytour.com/pptist/static/logo4.png'
])
watch
(()
=>
slideIndex
.
value
,
()
=>
{
...
...
@@ -462,11 +463,13 @@ const GetTripTemplate = async () =>{
let
x
=
newSlides
[
i
]
let
index
=
null
x
.
elements
.
forEach
((
y
,
indexs
)
=>
{
// console.log(y.layerName=='logo','----logo'+i)
if
(
y
.
layerName
&&
y
.
layerName
==
'logo'
)
index
=
indexs
})
let
eles
=
x
.
elements
.
filter
(
y
=>
y
.
layerName
&&
y
.
layerName
==
'logo'
)
let
eles
=
x
.
elements
.
filter
(
y
=>
y
.
layerName
&&
y
.
layerName
.
indexOf
(
'logo'
)
!=-
1
)
let
newElements
=
await
ResolveTripLogoHandler
(
eles
,
i
)
x
.
elements
=
x
.
elements
.
concat
(
newElements
?.
elements
)
console
.
log
(
eles
.
length
,
'---'
)
if
(
index
>=
0
)
x
.
elements
.
splice
(
index
,
1
)
}
}
...
...
@@ -528,9 +531,8 @@ const ResolveTripLogoHandler = async (items:any, slideIndex:number) =>{
let
y
=
templateObj
[
i
]
let
tempSize
=
await
FileService
.
getImageSizeWithoutDownloading
(
templateObj
[
i
].
src
)
let
scale
=
tempSize
.
width
/
tempSize
.
height
if
(
scale
==
1
)
templateObj
[
i
].
src
=
acquiesceLogo
.
value
[
0
]
if
(
scale
>
1
)
templateObj
[
i
].
src
=
acquiesceLogo
.
value
[
2
]
if
(
scale
>
1
)
templateObj
[
i
].
src
=
acquiesceLogo
.
value
[
3
]
if
(
scale
<
1
)
templateObj
[
i
].
src
=
acquiesceLogo
.
value
[
1
]
if
(
tempNewSlide
){
tempNewSlide
.
elements
.
push
(...
templateObj
)
...
...
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