summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2023-09-04 11:47:25 +0800
committerMole Shang <[email protected]>2023-09-04 11:48:33 +0800
commit9c17ef7377afe40a0d5f2515c85ef6509b4490d6 (patch)
treecb6431b12af00485cc4dcf2a8395a07abb42fde7
parenta7db8d9f1a6b781dc312bf2244b3b7efb159921c (diff)
downloadseu_wlan_login-9c17ef7377afe40a0d5f2515c85ef6509b4490d6.tar.gz
seu_wlan_login-9c17ef7377afe40a0d5f2515c85ef6509b4490d6.tar.bz2
seu_wlan_login-9c17ef7377afe40a0d5f2515c85ef6509b4490d6.zip
detect ret_code=1 as logged in
-rw-r--r--index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/index.js b/index.js
index 5a482e8..76f9866 100644
--- a/index.js
+++ b/index.js
@@ -33,7 +33,7 @@ const EPORTAL_API = "https://w.seu.edu.cn:802/eportal";
const parsedData = JSON.parse(match[1]);
if (parsedData.result == 1) {
console.log("Login success!");
- } else if (parsedData.result == 0 && parsedData.ret_code == 2) {
+ } else if (parsedData.result == 0 && (parsedData.ret_code == 1 || parsedData.ret_code == 2)) {
console.log("Already logged in!")
} else {
throw `Login failed.\nresponse JSON: ${match[1]}`;