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
e6eb9d10
Commit
e6eb9d10
authored
Jun 14, 2024
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增Base64文件上传
parent
0006a2e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
aliyun.ts
src/utils/upload/aliyun.ts
+37
-0
No files found.
src/utils/upload/aliyun.ts
View file @
e6eb9d10
...
...
@@ -78,6 +78,43 @@ class AliyunUpload {
return
''
}
}
/**
* Base64云盘上传
* filePath:文件保存路径
* parms:{
* isppt: '1',
* uid: token.value,//当前用户Ti肯
* gid: "",//云盘分组Id(没有就不传)
* basestr:"",//图片Base64,
* surl:""https://xx.xx.com/pptist/desgin/1716259237822.png",//原图片路径
* }
*/
static
UploadCloudDiskBase64
=
async
(
filePath
:
string
,
parms
:
any
)
=>
{
try
{
const
formData
=
new
FormData
();
if
(
parms
&&
parms
.
uid
)
formData
.
append
(
'parms'
,
JSON
.
stringify
(
parms
));
const
response
=
await
fetch
(
`
${
domainManager
().
UploadUrl
}
/Upload/UploadBase64ToALiOSS?filePath=
${
encodeURIComponent
(
filePath
)}
`
,
{
method
:
'POST'
,
body
:
formData
,
});
if
(
response
.
ok
)
{
let
result
=
await
response
.
text
()
let
datas
=
JSON
.
parse
(
result
)
if
(
datas
.
FilePath
)
return
'https://im.oytour.com'
+
datas
.
FilePath
else
{
ElMessage
.
warning
({
showClose
:
true
,
message
:
datas
.
Message
,
})
}
}
return
''
}
catch
(
error
)
{
return
''
}
}
}
export
default
AliyunUpload
\ No newline at end of file
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