求版本敏感词优化
This commit is contained in:
@ -279,18 +279,13 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
|
||||
JSONObject responseObject = new JSONObject(string);
|
||||
boolean cast = responseObject.getBoolean("cast");
|
||||
String id = responseObject.getString("_id");
|
||||
String illegal = responseObject.getString("illegal");
|
||||
if (!TextUtils.isEmpty(illegal)) {
|
||||
Utils.toast(VoteActivity.this, "包含非法内容,请修改后重试");
|
||||
if (cast) {
|
||||
Utils.toast(VoteActivity.this, "投票成功");
|
||||
} else {
|
||||
if (cast) {
|
||||
Utils.toast(VoteActivity.this, "投票成功");
|
||||
if (isNewVote) {
|
||||
Utils.toast(VoteActivity.this, "已经存在相同的选项");
|
||||
} else {
|
||||
if (isNewVote) {
|
||||
Utils.toast(VoteActivity.this, "已经存在相同的选项");
|
||||
} else {
|
||||
Utils.toast(VoteActivity.this, "你已经投过了");
|
||||
}
|
||||
Utils.toast(VoteActivity.this, "你已经投过了");
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,7 +306,21 @@ public class VoteActivity extends BaseActivity implements SwipeRefreshLayout.OnR
|
||||
@Override
|
||||
public void onFailure(HttpException e) {
|
||||
super.onFailure(e);
|
||||
Utils.toast(VoteActivity.this, "提交失败");
|
||||
if (e != null && e.code() == 403) {
|
||||
try {
|
||||
String string = e.response().errorBody().string();
|
||||
JSONObject errorJson = new JSONObject(string);
|
||||
String detail = errorJson.getString("detail");
|
||||
if ("illegal".equals(detail)) {
|
||||
Utils.toast(VoteActivity.this, "包含非法内容,请修改后重试");
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Utils.toast(VoteActivity.this, "提交失败");
|
||||
}
|
||||
|
||||
waitDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user