Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8ad0d1d1
authored
Mar 23, 2023
by
姜鹏凯
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
阿里云oss兼容
1 parent
3ce0764f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
linkwe-pc/src/components/UploadToCos.vue
linkwe-pc/src/components/UploadToCos.vue
View file @
8ad0d1d
...
@@ -131,7 +131,6 @@
...
@@ -131,7 +131,6 @@
created
()
{
created
()
{
getCosConfig
().
then
((
res
)
=>
{
getCosConfig
().
then
((
res
)
=>
{
this
.
cosConfig
=
res
this
.
cosConfig
=
res
console
.
log
(
this
.
cosConfig
)
if
(
this
.
cosConfig
.
fileObject
==
'tencentOss'
)
{
if
(
this
.
cosConfig
.
fileObject
==
'tencentOss'
)
{
this
.
cosInstance
=
new
Cos
({
this
.
cosInstance
=
new
Cos
({
SecretId
:
res
.
secretId
,
SecretId
:
res
.
secretId
,
...
@@ -209,19 +208,17 @@
...
@@ -209,19 +208,17 @@
this
.
$message
.
error
(
'存储空间正忙,请稍后再试'
)
this
.
$message
.
error
(
'存储空间正忙,请稍后再试'
)
return
return
}
}
let
name
=
`
/
${
dateFormat
(
date
,
'yyyy-MM-dd'
)}
/t
${
date
.
getTime
()}
-
${
uuid
()}${
format
}
`
let
name
=
`
${
dateFormat
(
date
,
'yyyy-MM-dd'
)}
/t
${
date
.
getTime
()}
-
${
uuid
()}${
format
}
`
try
{
try
{
const
data
=
await
this
.
ossObj
.
multipartUpload
(
name
,
file
,
{
const
data
=
await
this
.
ossObj
.
multipartUpload
(
name
,
file
,
{
progress
:
(
progressData
)
=>
{
progress
:
(
progressData
)
=>
{
console
.
log
(
progressData
)
this
.
percentage
=
progressData
*
100
this
.
percentage
=
progressData
.
percent
*
100
// this.speed = (progressData.speed / 1024 / 1024).toFixed(2)
this
.
speed
=
(
progressData
.
speed
/
1024
/
1024
).
toFixed
(
2
)
}
}
})
})
if
(
data
)
{
if
(
data
)
{
console
.
log
(
data
)
this
.
percentage
=
this
.
speed
=
0
this
.
percentage
=
this
.
speed
=
0
let
location
=
'https://'
+
data
.
Location
let
location
=
this
.
cosConfig
.
cosImgUrlPrefix
+
data
.
name
this
.
$emit
(
'upSuccess'
,
location
)
this
.
$emit
(
'upSuccess'
,
location
)
this
.
type
==
2
this
.
type
==
2
?
//获取视频第一帧画面
?
//获取视频第一帧画面
...
@@ -556,7 +553,7 @@
...
@@ -556,7 +553,7 @@
<circle
cx=
"50"
cy=
"50"
r=
"20"
fill=
"none"
class=
"path"
></circle>
<circle
cx=
"50"
cy=
"50"
r=
"20"
fill=
"none"
class=
"path"
></circle>
</svg>
</svg>
</div>
</div>
<div
class=
"cc"
style=
"margin-top: 35px;"
>
<div
class=
"cc"
style=
"margin-top: 35px;"
v-if=
"speed"
>
{{ speed + 'M/s' }}
{{ speed + 'M/s' }}
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment