Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
fix some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
GCS-ZHN committed Jan 30, 2022
1 parent 912e1a9 commit 7010ffa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ powershell build.ps1 ## windows

## 更新记录
### v1.3.9
修复报错“从下列地区返回浙江格式错误”。
修复报错“从下列地区返回浙江格式错误”和代码优化

### v1.3.8
修复了打卡后,前端页面显示在境外的问题。实际上这并不影响打卡实际定位,但由于undefined和空字符串""在javascript中的不同,前端页面会显示在境外。
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gcszhn/autocard/service/ClockinService.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public ArrayList<NameValuePair> getOldInfo(String username, String password) {
ArrayList<NameValuePair> res = new ArrayList<>();
// 该部分模拟网页JS代码进行信息合并
try {
Pattern defPattern = Pattern.compile("var def = (\\{.+\\});");
Pattern defPattern = Pattern.compile("var def = (\\{.+?\\});", Pattern.DOTALL);
Matcher matcher = defPattern.matcher(page);
JSONObject defJsonObject = null;
if (matcher.find()) {
Expand All @@ -94,7 +94,7 @@ public ArrayList<NameValuePair> getOldInfo(String username, String password) {
} else {
return null;
}
Pattern oldInfoPattern = Pattern.compile("oldInfo: (\\{.+\\})");
Pattern oldInfoPattern = Pattern.compile("oldInfo: (\\{.+?\\}),\n");
matcher = oldInfoPattern.matcher(page);
JSONObject oldInfoJson = null;
if (matcher.find()) {
Expand Down

0 comments on commit 7010ffa

Please sign in to comment.