|
@@ -15,9 +15,9 @@ export default { |
|
@@ -15,9 +15,9 @@ export default { |
|
15
|
url: url,
|
15
|
url: url,
|
|
16
|
responseType: 'blob',
|
16
|
responseType: 'blob',
|
|
17
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
17
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
18
|
- }).then(async (res) => {
|
|
|
|
19
|
- const isLogin = await blobValidate(res.data);
|
|
|
|
20
|
- if (isLogin) {
|
18
|
+ }).then((res) => {
|
|
|
|
19
|
+ const isBlob = blobValidate(res.data);
|
|
|
|
20
|
+ if (isBlob) {
|
|
21
|
const blob = new Blob([res.data])
|
21
|
const blob = new Blob([res.data])
|
|
22
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
22
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
|
23
|
} else {
|
23
|
} else {
|
|
@@ -32,9 +32,9 @@ export default { |
|
@@ -32,9 +32,9 @@ export default { |
|
32
|
url: url,
|
32
|
url: url,
|
|
33
|
responseType: 'blob',
|
33
|
responseType: 'blob',
|
|
34
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
34
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
35
|
- }).then(async (res) => {
|
|
|
|
36
|
- const isLogin = await blobValidate(res.data);
|
|
|
|
37
|
- if (isLogin) {
|
35
|
+ }).then((res) => {
|
|
|
|
36
|
+ const isBlob = blobValidate(res.data);
|
|
|
|
37
|
+ if (isBlob) {
|
|
38
|
const blob = new Blob([res.data])
|
38
|
const blob = new Blob([res.data])
|
|
39
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
39
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
|
40
|
} else {
|
40
|
} else {
|
|
@@ -49,9 +49,9 @@ export default { |
|
@@ -49,9 +49,9 @@ export default { |
|
49
|
url: url,
|
49
|
url: url,
|
|
50
|
responseType: 'blob',
|
50
|
responseType: 'blob',
|
|
51
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
51
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
52
|
- }).then(async (res) => {
|
|
|
|
53
|
- const isLogin = await blobValidate(res.data);
|
|
|
|
54
|
- if (isLogin) {
|
52
|
+ }).then((res) => {
|
|
|
|
53
|
+ const isBlob = blobValidate(res.data);
|
|
|
|
54
|
+ if (isBlob) {
|
|
55
|
const blob = new Blob([res.data], { type: 'application/zip' })
|
55
|
const blob = new Blob([res.data], { type: 'application/zip' })
|
|
56
|
this.saveAs(blob, name)
|
56
|
this.saveAs(blob, name)
|
|
57
|
} else {
|
57
|
} else {
|