diff --git a/plugins/pureftp/index.py b/plugins/pureftp/index.py
index bdce016f1..1a0fc0e29 100755
--- a/plugins/pureftp/index.py
+++ b/plugins/pureftp/index.py
@@ -214,6 +214,7 @@ def pftpAdd(username, password, path):
if not os.path.exists(path):
os.makedirs(path)
if mw.isAppleSystem():
+ # pass
os.system('chown ' + user + '.staff ' + path)
else:
os.system('chown www.www ' + path)
diff --git a/plugins/pureftp/js/ftp.js b/plugins/pureftp/js/ftp.js
index 87d4c605c..42afdfc6e 100755
--- a/plugins/pureftp/js/ftp.js
+++ b/plugins/pureftp/js/ftp.js
@@ -24,7 +24,6 @@ function ftpPost(method,args,callback){
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
return;
}
-
if(typeof(callback) == 'function'){
callback(data);
}
@@ -74,7 +73,7 @@ function ftpList(page, search){
content += '
状态 | ';
content += '根目录 | ';
content += '备注 | ';
- content += '操作(添加|端口) | ';
+ content += '操作(添加|端口) | ';
content += '';
content += '';
@@ -111,35 +110,20 @@ function ftpList(page, search){
/**
*添加FTP帐户
- * @param {Number} type 添加类型
*/
-function addFtp(type) {
- if (type == 1) {
- var loadT = layer.load({shade: true,shadeClose: false});
- var data = $("#ftpAdd").serialize();
- ftpPost('add_ftp', data, function(data){
- if (data.data == 'ok'){
- layer.msg('添加成功!', {icon: 1,time:3000});
- } else {
- layer.msg(rdata.data, {icon: 5,time:3000});
- }
- ftpList();
- layer.close(loadT);
- });
- return true;
- }
+function addFtp() {
var data = ftpAsyncPost('get_www_dir');
var defaultPath = data.data;
- var index = layer.open({
+ var indexFtp = layer.open({
type: 1,
- skin: 'demo-class',
area: '500px',
title: '添加FTP帐户',
closeBtn: 2,
shift: 5,
shadeClose: false,
- content: "",
+ yes:function(index,layero){
+ var loadT = layer.load({shade: true,shadeClose: false});
+ var data = $("#ftpAdd").serialize();
+ ftpPost('add_ftp', data, function(rdata){
+ layer.close(loadT);
+ layer.close(indexFtp);
+ if (rdata.data == 'ok'){
+ layer.msg('添加成功!', {icon: 1,time:3000});
+ } else {
+ layer.msg(rdata.data, {icon: 5,time:3000});
+ }
+
+ setTimeout(function(){ftpList();},2000);
+ });
+ return true;
+ },
});
$("#ftpUser").keyup(function(){