fix error type

This commit is contained in:
niuhuan 2021-10-27 16:29:19 +08:00
parent 3b5c358559
commit cd10de8e89
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
const ERROR_TYPE_NETWORK = "NETWORK_ERROR"; const ERROR_TYPE_NETWORK = "NETWORK_ERROR";
const ERROR_TYPE_PERMISSION = "PERMISSION_ERROR"; const ERROR_TYPE_PERMISSION = "PERMISSION_ERROR";
const ERROR_TYPE_TIME = "TIME_ERROR"; const ERROR_TYPE_TIME = "TIME_ERROR";
const ERROR_TYPE_UNDER_VIEW = "UNDER_VIEW_ERROR"; const ERROR_TYPE_UNDER_REVIEW = "UNDER_VIEW_ERROR";
// , 便 // , 便
String errorType(String error) { String errorType(String error) {
@ -21,8 +21,8 @@ String errorType(String error) {
if (error.contains("time is not synchronize")) { if (error.contains("time is not synchronize")) {
return ERROR_TYPE_TIME; return ERROR_TYPE_TIME;
} }
if (error.contains("under view")) { if (error.contains("under review")) {
return ERROR_TYPE_UNDER_VIEW; return ERROR_TYPE_UNDER_REVIEW;
} }
return ""; return "";
} }

View File

@ -30,7 +30,7 @@ class ContentError extends StatelessWidget {
case ERROR_TYPE_TIME: case ERROR_TYPE_TIME:
message = "请检查设备时间"; message = "请检查设备时间";
break; break;
case ERROR_TYPE_UNDER_VIEW: case ERROR_TYPE_UNDER_REVIEW:
message = "资源未审核或不可用"; message = "资源未审核或不可用";
break; break;
default: default: