|
|
@ -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) |
|
|
|