Skip to content

Commit

Permalink
txt预览以及后缀名截取bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shuyudao committed Apr 17, 2019
1 parent 3d197af commit befa8b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions page/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ function yulan() {
for(var i = 0 ; i < eye_watch.length ; i++){
eye_watch[i].onclick = function () {
var name = this.getAttribute('name');
var file_extension = name.substr(-3,3);
if (file_extension!='jpg'&&file_extension!='png'&&file_extension!='gif'&&file_extension!='jpeg'&&file_extension!='mp4'&&file_extension!='avi'&&file_extension!='xlsx'&&file_extension!='docx'&&file_extension!='pptx'&&file_extension!='mp3')
var index1=name.lastIndexOf(".");
var index2=name.length;
var file_extension=name.substring(index1+1,index2);
if (file_extension!='jpg'&&file_extension!='png'&&file_extension!='gif'&&file_extension!='jpeg'&&file_extension!='mp4'&&file_extension!='avi'&&file_extension!='xlsx'&&file_extension!='docx'&&file_extension!='pptx'&&file_extension!='mp3'&&file_extension!='txt')
{
mizhu.toast('抱歉此格式不支持预览', 3000);
$("#close_yulan").modal('close');
Expand Down

0 comments on commit befa8b8

Please sign in to comment.