| | |
| | | stateCodeDic["NETWORK_ERROR"] = StringId.FailedRequestServer; |
| | | //数据异常 |
| | | stateCodeDic["DATA_EXCEPTION"] = StringId.DataExceptionPleaseTryAgain; |
| | | |
| | | //与服务器通讯失败 |
| | | stateCodeDic[StateCode.NETWORK_ERROR] = StringId.FailedRequestServer; |
| | | //数据异常 |
| | | stateCodeDic[StateCode.DATA_EXCEPTION] = StringId.DataExceptionPleaseTryAgain; |
| | | #region 基础服务 新错误码 2020-12-07 |
| | | //系统繁忙~请稍后再试~ |
| | | stateCodeDic["1"] = StringId.SystemIsBusy; |
| | |
| | | stateCodeDic["10017"] = StringId.RegistrationFailedPleaseTryAgain; |
| | | ////租户不存在 |
| | | //stateCodeDic["10018"] = StringId.10018; |
| | | //密码连续输错次数已达到10次,用户已被锁定,请次日0点后再登陆 |
| | | //密码错误次数过多,账号被锁定! |
| | | stateCodeDic["10019"] = StringId.AccountLoginLock; |
| | | |
| | | //没有权限 |
| | | stateCodeDic["10105"] = StringId.PermissionDenied; |
| | | //验证码已经发送 |
| | |
| | | /// <param name="statuCode"></param> |
| | | /// <param name="isTipStyle"></param> |
| | | /// <param name="tipStr">补充的错误提示</param> |
| | | public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "") |
| | | public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "",bool showAllMsg = true) |
| | | { |
| | | try |
| | | { |
| | |
| | | if (mes == null) return; |
| | | if (!string.IsNullOrEmpty(tipStr)) |
| | | { |
| | | mes = tipStr + "\n" + mes; |
| | | if (showAllMsg) |
| | | { |
| | | mes = tipStr + "\n" + mes; |
| | | }else |
| | | { |
| | | mes = tipStr; |
| | | } |
| | | } |
| | | if (isTipStyle) |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Alert("", mes, Language.StringByID(StringId.Close)).Show(); |
| | | new Alert("", mes+$" \r\nCode:{statuCode}", Language.StringByID(StringId.Close)).Show(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | var success = new HttpServerRequest().RefreshToken(); |
| | | if (success) { |
| | | if (success == StateCode.SUCCESS) { |
| | | Utlis.WriteLine("RefreshToken success"); |
| | | } |
| | | } |
| | |
| | | public class StateCode |
| | | { |
| | | /// <summary> |
| | | /// 网络请求异常 |
| | | /// APP自定义错误码 |
| | | /// </summary> |
| | | public const string NETWORK_ERROR = "-1"; |
| | | /// <summary> |
| | | /// 数据解析错误 |
| | | /// APP自定义错误码 |
| | | /// </summary> |
| | | public const string DATA_EXCEPTION = "-2"; |
| | | /// <summary> |
| | | /// 请求成功的状态码 |
| | | /// </summary> |
| | | public const string SUCCESS = "0"; |
| | |
| | | /// 账号不存在的错误码 |
| | | /// </summary> |
| | | public const string ACCOUNT_NOT_EXIST = "10010"; |
| | | /// <summary> |
| | | /// 登录锁定,密码错误次数过多 |
| | | /// 密码输入错误超过10次,请30分钟后重试! |
| | | /// </summary> |
| | | public const string AccountLoginLock = "10019"; |
| | | |
| | | |
| | | |
| | | } |