|
@@ -15,9 +15,9 @@ export default {
|
|
|
url: url,
|
|
|
responseType: 'blob',
|
|
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
|
- }).then(async (res) => {
|
|
|
- const isLogin = await blobValidate(res.data);
|
|
|
- if (isLogin) {
|
|
|
+ }).then((res) => {
|
|
|
+ const isBlob = blobValidate(res.data);
|
|
|
+ if (isBlob) {
|
|
|
const blob = new Blob([res.data])
|
|
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
|
|
} else {
|
|
@@ -32,9 +32,9 @@ export default {
|
|
|
url: url,
|
|
|
responseType: 'blob',
|
|
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
|
- }).then(async (res) => {
|
|
|
- const isLogin = await blobValidate(res.data);
|
|
|
- if (isLogin) {
|
|
|
+ }).then((res) => {
|
|
|
+ const isBlob = blobValidate(res.data);
|
|
|
+ if (isBlob) {
|
|
|
const blob = new Blob([res.data])
|
|
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
|
|
} else {
|
|
@@ -49,9 +49,9 @@ export default {
|
|
|
url: url,
|
|
|
responseType: 'blob',
|
|
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
|
|
- }).then(async (res) => {
|
|
|
- const isLogin = await blobValidate(res.data);
|
|
|
- if (isLogin) {
|
|
|
+ }).then((res) => {
|
|
|
+ const isBlob = blobValidate(res.data);
|
|
|
+ if (isBlob) {
|
|
|
const blob = new Blob([res.data], { type: 'application/zip' })
|
|
|
this.saveAs(blob, name)
|
|
|
} else {
|