From c29e7f846b97f313bf4685b8c9e3cdfbf8b38080 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sun, 16 Oct 2022 09:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcLive.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcLive.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/SrcLive.js b/SrcLive.js index ee5cd592..d607b4c1 100644 --- a/SrcLive.js +++ b/SrcLive.js @@ -128,12 +128,22 @@ function guanlidata(datalist) { return (a,b) => { a = a[attr]; b = b[attr]; - if(a < b){ - return rev * -1; - } - if(a > b){ - return rev * 1; + try{ + if(parseInt(a) < parseInt(b)){ + return rev * -1; + } + if(parseInt(a) > parseInt(b)){ + return rev * 1; + } + }catch(e){ + if(a < b){ + return rev * -1; + } + if(a > b){ + return rev * 1; + } } + return 0; } }