diff --git a/plugins/mariadb/js/mariadb.js b/plugins/mariadb/js/mariadb.js index da19384e0..fe6a3d185 100755 --- a/plugins/mariadb/js/mariadb.js +++ b/plugins/mariadb/js/mariadb.js @@ -445,10 +445,9 @@ function syncToDatabase(type){ function setRootPwd(type, pwd){ if (type==1){ - var data = $("#mod_pwd").serialize(); - myPost('set_root_pwd', data, function(data){ + var password = $("#MyPassword").val(); + myPost('set_root_pwd', {password:password}, function(data){ var rdata = $.parseJSON(data.data); - // console.log(rdata); showMsg(rdata.msg,function(){ dbList(); $('.layui-layer-close1').click(); @@ -459,26 +458,23 @@ function setRootPwd(type, pwd){ var index = layer.open({ type: 1, - skin: 'demo-class', area: '500px', title: '修改数据库密码', closeBtn: 1, shift: 5, + btn:["提交","关闭"], shadeClose: true, - content: "
\ + content: "\
\ - root密码\ -
\ -
\ -
\ - \ - \ + root密码\ +
\ + \ +
\
\
", - }); - - $('#my_mod_close').click(function(){ - $('.layui-layer-close1').click(); + yes:function(){ + setRootPwd(1); + } }); } diff --git a/plugins/mysql/js/mysql.js b/plugins/mysql/js/mysql.js index d5b6ffc7f..d2fee0344 100755 --- a/plugins/mysql/js/mysql.js +++ b/plugins/mysql/js/mysql.js @@ -445,10 +445,9 @@ function syncToDatabase(type){ function setRootPwd(type, pwd){ if (type==1){ - var data = $("#mod_pwd").serialize(); - myPost('set_root_pwd', data, function(data){ + var password = $("#MyPassword").val(); + myPost('set_root_pwd', {password:password}, function(data){ var rdata = $.parseJSON(data.data); - // console.log(rdata); showMsg(rdata.msg,function(){ dbList(); $('.layui-layer-close1').click(); @@ -459,26 +458,23 @@ function setRootPwd(type, pwd){ var index = layer.open({ type: 1, - skin: 'demo-class', area: '500px', title: '修改数据库密码', closeBtn: 1, shift: 5, + btn:["提交","关闭"], shadeClose: true, - content: "
\ + content: "\
\ - root密码\ -
\ -
\ -
\ - \ - \ + root密码\ +
\ + \ +
\
\
", - }); - - $('#my_mod_close').click(function(){ - $('.layui-layer-close1').click(); + yes:function(){ + setRootPwd(1); + } }); }