update
This commit is contained in:
parent
b34cf3fc86
commit
db8f74f848
|
|
@ -237,7 +237,7 @@ label.checkbox_label span {
|
|||
</div>
|
||||
<div class="mtb20">
|
||||
<span class="panel_setp_span">应用密钥</span>
|
||||
<input type="text" class="bt-input-text" name="sync_app_sercet" value="" placeholder="应用密钥" />
|
||||
<input type="text" class="bt-input-text" name="sync_app_secret" value="" placeholder="应用密钥" />
|
||||
<a href="javascript:void();" target="_blank" class="btlink ml5">应用密钥</a>
|
||||
</div>
|
||||
<div class="mtb20">
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ function selectProgress(val){
|
|||
function initStep1(){
|
||||
var url = $('input[name="sync_url"]').val();
|
||||
var app_id = $('input[name="sync_app_id"]').val();
|
||||
var app_sercet = $('input[name="sync_app_sercet"]').val();
|
||||
maPost('step_one',{'url':url,'app_id':app_id,'app_sercet':app_sercet}, function(rdata){
|
||||
var app_secret = $('input[name="sync_app_secret"]').val();
|
||||
maPost('step_one',{'url':url,'app_id':app_id,'app_secret':app_secret}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
showMsg(rdata.msg,function(){
|
||||
if (rdata.status){
|
||||
|
|
@ -106,6 +106,7 @@ function initStep1(){
|
|||
function initStep2(){
|
||||
maPost('step_two',{}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
console.log(rdata);
|
||||
showMsg(rdata.msg,function(){
|
||||
if (rdata.status){
|
||||
selectProgress(2);
|
||||
|
|
@ -272,7 +273,8 @@ function initStep(){
|
|||
maPost('get_conf',{}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
$('input[name="sync_url"]').val(rdata.data['url']);
|
||||
$('input[name="sync_token"]').val(rdata.data['token']);
|
||||
$('input[name="sync_app_id"]').val(rdata.data['app_id']);
|
||||
$('input[name="sync_app_secret"]').val(rdata.data['app_secret']);
|
||||
});
|
||||
|
||||
$('.infoNext').click(function(){
|
||||
|
|
|
|||
|
|
@ -165,6 +165,22 @@ def upload_file():
|
|||
mw.writeLog('文件管理', msg)
|
||||
return mw.returnData(True, '上传成功!')
|
||||
|
||||
|
||||
# 上传文件
|
||||
@blueprint.route('/upload_segment', endpoint='upload_segment', methods=['POST'])
|
||||
@panel_login_required
|
||||
def upload_segment():
|
||||
path = request.form.get('path', '')
|
||||
name = request.form.get('name', '')
|
||||
size = request.form.get('size')
|
||||
start = request.form.get('start')
|
||||
dir_mode = request.form.get('dir_mode', '')
|
||||
file_mode = request.form.get('file_mode', '')
|
||||
b64_data = request.form.get('b64_data', '0')
|
||||
upload_files = request.files.getlist("blob")
|
||||
return file.uploadSegment(path,name,size,start,dir_mode,file_mode,b64_data,upload_files)
|
||||
|
||||
|
||||
# 修改文件名
|
||||
@blueprint.route('/mv_file', endpoint='mv_file', methods=['POST'])
|
||||
@panel_login_required
|
||||
|
|
|
|||
|
|
@ -18,15 +18,7 @@ import base64
|
|||
import core.mw as mw
|
||||
import thisdb
|
||||
|
||||
def uploadSegment():
|
||||
# 分段上传
|
||||
path = request.form.get('path', '')
|
||||
name = request.form.get('name', '')
|
||||
size = request.form.get('size')
|
||||
start = request.form.get('start')
|
||||
dir_mode = request.form.get('dir_mode', '')
|
||||
file_mode = request.form.get('file_mode', '')
|
||||
|
||||
def uploadSegment(path,name,size,start,dir_mode,file_mode,b64_data,upload_files):
|
||||
if not mw.fileNameCheck(name):
|
||||
return mw.returnData(False, '文件名中不能包含特殊字符!')
|
||||
|
||||
|
|
@ -50,12 +42,10 @@ def uploadSegment():
|
|||
return str(d_size)
|
||||
|
||||
f = open(save_path, 'ab')
|
||||
b64_data = request.form.get('b64_data', '0')
|
||||
if b64_data == '1':
|
||||
b64_data = base64.b64decode(args.b64_data)
|
||||
b64_data = base64.b64decode(b64_data)
|
||||
f.write(b64_data)
|
||||
else:
|
||||
upload_files = request.files.getlist("blob")
|
||||
for tmp_f in upload_files:
|
||||
f.write(tmp_f.read())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue