|
@@ -135,34 +135,22 @@
|
|
|
*/
|
|
|
getFileUrl: function (id) {
|
|
|
var _this = this;
|
|
|
- if(this.options.fileUrl){
|
|
|
- _this.rooting(z.ui.comm.getEntranceUrl(this.options.fileUrl));
|
|
|
- }
|
|
|
- // var currentFileSite = this.options.fileSite;
|
|
|
- // z.ui.jsonpAjax({
|
|
|
- // url: currentFileSite + "/FileInfo/getFileById",
|
|
|
- // data: {id: id, getUrl: true, browserType: distinguishBrowser()},
|
|
|
- // success: function (data, b, c) {
|
|
|
- // if (data && data.error_code) {
|
|
|
- // z.ui.alertWarning(data.msg, 1000);
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if(data.noSupport) {
|
|
|
- // if (data.fileName) {
|
|
|
- // z.ui.comm.downLoadFile(currentFileSite + "/FileInfo/getFileById?id=" + id, data.fileName);
|
|
|
- // }
|
|
|
- // _this.noSuportPreview();
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (data.isStreamFile) {
|
|
|
- // _this.rooting(data.fileUrl, data.fileSuffix);
|
|
|
- // } else {
|
|
|
- // _this.rooting(data.fileUrl.replace(/\+/g, "%20"));
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
+ var currentFileSite = this.options.fileSite;
|
|
|
+ z.ui.ajax({
|
|
|
+ url: currentFileSite + "/file/get-list?ids=" + id,
|
|
|
+ type: 'get',
|
|
|
+ data: {},
|
|
|
+ success: function (data, b, c) {
|
|
|
+ if(data.code !== 0){
|
|
|
+ z.ui.alertWarning(data.msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var file = data.data[0];
|
|
|
+ _this.rooting(file.url.replace(/\+/g, "%20"),null,file.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- rooting: function (fileUrl, fileSuffix) {
|
|
|
+ rooting: function (fileUrl, fileSuffix,fileName) {
|
|
|
if (!fileSuffix) {
|
|
|
fileSuffix = fileUrl.split('.')[fileUrl.split('.').length - 1];
|
|
|
}
|
|
@@ -206,6 +194,7 @@
|
|
|
break;
|
|
|
default:
|
|
|
this.noSuportPreview();
|
|
|
+ // z.ui.comm.downLoadFile(fileUrl, fileName);
|
|
|
break;
|
|
|
}
|
|
|
},
|