From ad0cd570591e9592e4f54011930bf97d7e2e1887 Mon Sep 17 00:00:00 2001 From: jkhnfk Date: Sun, 1 May 2022 10:47:56 +0800 Subject: [PATCH] Update default.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持最新版本微信。 --- .../Contents/Scripts/default.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/WeChatTweak.lbaction/Contents/Scripts/default.js b/WeChatTweak.lbaction/Contents/Scripts/default.js index 4227c3d..07390e9 100644 --- a/WeChatTweak.lbaction/Contents/Scripts/default.js +++ b/WeChatTweak.lbaction/Contents/Scripts/default.js @@ -16,17 +16,25 @@ function run(string) { return []; } - return result.data.map(function (i) { - return { - title: i.m_nsRemark || i.m_nsNickName, - subtitle: i.m_nsNickName, - icon: i.wt_avatarPath || 'icon.png', + var arr=[]; + var jsonArr=result.data.items; + jsonArr.forEach(function (i) { + arr.push( { + title: i.title, + subtitle: i.subtitle, + icon: i.icon.path, action: "open", - actionArgument: i.m_nsUsrName - } + actionArgument: i.arg + }) }); + + + // return JSON.stringify(result.data); + return arr; + } function open(id) { + LaunchBar.hide() HTTP.get('http://localhost:48065/wechat/start?session=' + id); -} \ No newline at end of file +}