Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
marketing
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marketing-web
marketing
Commits
09016b4a
Commit
09016b4a
authored
May 07, 2022
by
crushh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: dist
parent
c2abe350
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
index.js
src/utils/index.js
+1
-0
links.vue
src/views/game/common/links.vue
+1
-0
No files found.
src/utils/index.js
View file @
09016b4a
...
...
@@ -225,6 +225,7 @@ export const downloadFile = (fileName, content) => {
let
blob
=
base64ToBlob
(
content
);
//new Blob([content]);
let
evt
=
document
.
createEvent
(
'HTMLEvents'
);
evt
.
initEvent
(
'click'
,
true
,
true
);
//initEvent 不加后两个参数在FF下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为
fileName
=
fileName
.
replaceAll
(
'.'
,
'-'
);
aLink
.
download
=
fileName
;
aLink
.
href
=
URL
.
createObjectURL
(
blob
);
// aLink.dispatchEvent(evt);
...
...
src/views/game/common/links.vue
View file @
09016b4a
...
...
@@ -161,6 +161,7 @@ export default {
const
x
=
new
XMLHttpRequest
();
x
.
open
(
'GET'
,
url
,
true
);
x
.
responseType
=
'blob'
;
fileName
=
fileName
.
replaceAll
(
'.'
,
'-'
);
x
.
onload
=
function
(
e
)
{
const
blob
=
new
Blob
([
x
.
response
],
{
type
:
'image/png'
});
let
url
=
window
.
URL
.
createObjectURL
(
blob
);
...
...
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