pull/109/head
Mr Chen 7 years ago
parent e87968aebc
commit 1d436c3cc5
  1. 11
      route/files.py
  2. 2
      static/js/files.js

@ -22,8 +22,12 @@ def index():
@files.route('/get_dir', methods=['POST']) @files.route('/get_dir', methods=['POST'])
def getDir(): def getDir():
path = request.form.get('path', '').encode('utf-8') path = request.form.get('path', '').encode('utf-8')
print path if not os.path.exists(path):
path = "/" path = '/'
import pwd
dirnames = []
filenames = []
info = {} info = {}
info['count'] = 10 info['count'] = 10
@ -85,4 +89,7 @@ def getDir():
n += 1 n += 1
except: except:
continue continue
data['DIR'] = sorted(dirnames)
data['FILES'] = sorted(filenames)
data['PATH'] = ""
return public.getJson(data) return public.getJson(data)

@ -568,7 +568,7 @@ function GetFiles(Path) {
GetFiles(p); GetFiles(p);
}); });
PathPlaceBtn(rdata.PATH); PathPlaceBtn(rdata.PATH);
}); },'json');
//setTimeout(function(){getCookie('path');},200); //setTimeout(function(){getCookie('path');},200);
} }
//统计选择数量 //统计选择数量

Loading…
Cancel
Save