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 be165e1d
authored
Oct 10, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复 阿里云上传配置问题
1 parent
d87324ea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
vue3-lw-pc/src/api/common.js
vue3-lw-pc/src/components/Upload.vue
vue3-lw-pc/src/api/common.js
View file @
be165e1
...
@@ -52,11 +52,11 @@ export function upload(data) {
...
@@ -52,11 +52,11 @@ export function upload(data) {
}
}
// 获取cos配置
// 获取cos配置
export
function
getCosConfig
(
data
)
{
export
function
getCosConfig
(
params
)
{
return
request
({
return
request
({
url
:
'/file/get/config'
,
url
:
'/file/get/config'
,
params
:
data
,
params
,
}).
then
(({
data
})
=>
{
}).
then
(({
0
})
=>
{
let
res
=
{}
let
res
=
{}
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
res
[
key
]
=
decryptAES
(
data
[
key
])
res
[
key
]
=
decryptAES
(
data
[
key
])
...
...
vue3-lw-pc/src/components/Upload.vue
View file @
be165e1
...
@@ -148,23 +148,23 @@ export default {
...
@@ -148,23 +148,23 @@ export default {
created
()
{
created
()
{
getCosConfig
().
then
((
res
)
=>
{
getCosConfig
().
then
((
res
)
=>
{
this
.
cosConfig
=
res
this
.
cosConfig
=
res
console
.
log
(
this
.
cosConfig
)
//
console.log(this.cosConfig)
if
(
this
.
cosConfig
.
fileObject
==
'tencentOss'
)
{
if
(
res
.
fileObject
==
'tencentOss'
)
{
this
.
cosInstance
=
new
Cos
({
this
.
cosInstance
=
new
Cos
({
SecretId
:
res
.
secretId
,
SecretId
:
res
.
secretId
,
SecretKey
:
res
.
secretKey
,
SecretKey
:
res
.
secretKey
,
})
})
}
else
if
(
this
.
cosConfig
.
fileObject
==
'local'
)
{
}
else
if
(
res
.
fileObject
==
'local'
)
{
}
else
{
}
else
{
let
region
=
this
.
cosConfig
.
region
.
split
(
'//'
)[
1
]
// let region = res
.region.split('//')[1]
this
.
ossObj
=
new
OSS
({
this
.
ossObj
=
new
OSS
({
// yourRegion填写Bucket所在地域。Region填写为oss-cn-hangzhou。
// yourRegion填写Bucket所在地域。Region填写为oss-cn-hangzhou。
region
:
region
.
split
(
'.'
)[
0
],
region
:
re
s
.
re
gion
.
split
(
'.'
)[
0
],
// 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。
// 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。
accessKeyId
:
this
.
cosConfig
.
secretId
,
accessKeyId
:
res
.
secretId
,
accessKeySecret
:
this
.
cosConfig
.
secretKey
,
accessKeySecret
:
res
.
secretKey
,
// 填写Bucket名称。
// 填写Bucket名称。
bucket
:
this
.
cosConfig
.
bucketName
,
bucket
:
res
.
bucketName
,
})
})
}
}
})
})
...
...
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