| | |
| | |
|
| | | export default {
|
| | | name(name, isDelete = true) {
|
| | | var url = baseURL + "/common/download?fileName=" + encodeURI(name) + "&delete=" + isDelete
|
| | | var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete
|
| | | axios({
|
| | | method: 'get',
|
| | | 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, decodeURI(res.headers['download-filename']))
|
| | | this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
| | | } else {
|
| | | this.printErrMsg(res.data);
|
| | | }
|
| | | })
|
| | | },
|
| | | resource(resource) {
|
| | | var url = baseURL + "/common/download/resource?resource=" + encodeURI(resource);
|
| | | var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource);
|
| | | axios({
|
| | | method: 'get',
|
| | | 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, decodeURI(res.headers['download-filename']))
|
| | | this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
| | | } else {
|
| | | this.printErrMsg(res.data);
|
| | | }
|
| | |
| | | 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 {
|