Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat-common
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
wechat-common
Commits
de795f63
Commit
de795f63
authored
Jan 14, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:解决报错
parent
21da8319
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
src/domains/basic-domain/upload.ts
+13
-13
No files found.
src/domains/basic-domain/upload.ts
View file @
de795f63
/*
* @Author: 吴文洁
* @Date: 2020-10-27 18:53:43
* @LastEditors:
吴文洁
* @LastEditTime: 202
0-12-21 17:42:22
* @LastEditors:
zhangleyuan
* @LastEditTime: 202
1-01-14 10:45:21
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -11,17 +11,17 @@ import Service from '@/common/js/service';
class
Upload
{
static
uploadBlobToOSS
(
Blob
:
any
,
name
:
string
,
dataType
:
string
=
'url'
)
{
const
{
instId
}
=
window
.
currentUserInstInfo
;
return
Service
.
MFS
(
'anon/mfs/webTokenWithAccessUrl'
,
{
instId
,
resourceName
:
name
,
}).
then
((
res
)
=>
{
const
signInfo
=
res
.
result
;
const
{
url
}
=
res
.
result
return
this
.
uploadBlobToNewOSS
(
Blob
,
name
,
signInfo
.
signatureVO
||
signInfo
).
then
(()
=>
{
return
dataType
===
'url'
?
url
:
signInfo
});
})
//
const { instId } = window.currentUserInstInfo;
//
return Service.MFS('anon/mfs/webTokenWithAccessUrl', {
//
instId,
//
resourceName: name,
//
}).then((res) => {
//
const signInfo = res.result;
//
const { url } = res.result
//
return this.uploadBlobToNewOSS(Blob, name, signInfo.signatureVO || signInfo).then(() => {
//
return dataType === 'url' ? url : signInfo
//
});
//
})
};
static
uploadBlobToNewOSS
(
Blob
:
any
,
name
:
string
,
signInfo
:
any
)
{
...
...
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