From 33e114ffdd16b9c7b34d50928312eeb3b4acd759 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 7 Jan 2024 03:11:18 +0800 Subject: [PATCH] Update php.js --- plugins/php-yum/js/php.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/plugins/php-yum/js/php.js b/plugins/php-yum/js/php.js index 482aca9f0..cf3b06112 100755 --- a/plugins/php-yum/js/php.js +++ b/plugins/php-yum/js/php.js @@ -1,14 +1,3 @@ - -function str2Obj(str){ - var data = {}; - kv = str.split('&'); - for(i in kv){ - v = kv[i].split('='); - data[v[0]] = v[1]; - } - return data; -} - function phpPost(method, version, args,callback){ var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); @@ -18,7 +7,7 @@ function phpPost(method, version, args,callback){ req_data['version'] = version; if (typeof(args) == 'string'){ - req_data['args'] = JSON.stringify(str2Obj(args)); + req_data['args'] = JSON.stringify(toArrayObject(args)); } else { req_data['args'] = JSON.stringify(args); } @@ -46,7 +35,7 @@ function phpPostCallbak(method, version, args,callback){ args['version'] = version; if (typeof(args) == 'string'){ - req_data['args'] = JSON.stringify(str2Obj(args)); + req_data['args'] = JSON.stringify(toArrayObject(args)); } else { req_data['args'] = JSON.stringify(args); }