Commit 75095b78 by pye52

修复部分二维码扫描异常的问题

parent 043dd808
...@@ -18,7 +18,6 @@ import com.bgycc.smartcanteen.utils.SmartCanteenUtils; ...@@ -18,7 +18,6 @@ import com.bgycc.smartcanteen.utils.SmartCanteenUtils;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -99,8 +98,8 @@ public class QRCodeViewModel extends ViewModel { ...@@ -99,8 +98,8 @@ public class QRCodeViewModel extends ViewModel {
JsonObject jsonObject; JsonObject jsonObject;
try { try {
jsonObject = JsonParser.parseString(scanData).getAsJsonObject(); jsonObject = JsonParser.parseString(scanData).getAsJsonObject();
} catch (JsonSyntaxException jse) { } catch (Exception e) {
LogUtils.e(TAG, "非法的指令格式: " + scanData); LogUtils.e(TAG, "非法的指令格式: " + scanData, e);
qrCodeState.postValue(new QRCodeState(QRCodeState.FAILED)); qrCodeState.postValue(new QRCodeState(QRCodeState.FAILED));
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment