Merge pull request #1 from tobiichi3227/patch-1

Enhance ip parse
This commit was merged in pull request #1.
This commit is contained in:
Moon
2023-11-19 00:41:20 +08:00
committed by GitHub

View File

@@ -57,15 +57,7 @@ function Appear() {
$('#btn').html('打卡成功');
// transform ip to four numbers
let p = 0;
let num = [0, 0, 0, 0];
for(let i = 0; i < ip.length; i++) {
if(ip[i] == '.') {
p++;
continue;
}
num[p] = num[p] * 10 + parseInt(ip[i]);
}
let num = ip.split(".").map(num => parseInt(num));
// some lengths
const goodLen = goodFortunes.length;