response_code.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # coding:utf-8
  2. class RET:
  3. OK = "0"
  4. DBERR = "4001"
  5. NODATA = "4002"
  6. DATAEXIST = "4003"
  7. DATAERR = "4004"
  8. SESSIONERR = "4101"
  9. LOGINERR = "4102"
  10. PARAMERR = "4103"
  11. USERERR = "4104"
  12. ROLEERR = "4105"
  13. PWDERR = "4106"
  14. CPWDERR = "4107"
  15. MOBILEERR = "4108"
  16. REQERR = "4201"
  17. IPERR = "4202"
  18. THIRDERR = "4301"
  19. IOERR = "4302"
  20. SERVERERR = "4500"
  21. UNKOWNERR = "4501"
  22. NECESSARYPARAMERR = "4502"
  23. SMSCODERR = "4503"
  24. ALLOWERR = "4504"
  25. error_map = {
  26. RET.OK : u"成功",
  27. RET.DBERR : u"数据库查询错误",
  28. RET.NODATA : u"无数据",
  29. RET.DATAEXIST : u"数据已存在",
  30. RET.DATAERR : u"数据错误",
  31. RET.SESSIONERR : u"用户未登录",
  32. RET.LOGINERR : u"用户登录失败",
  33. RET.PARAMERR : u"参数错误",
  34. RET.USERERR : u"用户不存在或未激活",
  35. RET.ROLEERR : u"用户身份错误",
  36. RET.PWDERR : u"密码错误",
  37. RET.CPWDERR : u"密码不一致",
  38. RET.MOBILEERR : u"手机号错误",
  39. RET.REQERR : u"非法请求或请求次数受限",
  40. RET.IPERR : u"IP受限",
  41. RET.THIRDERR : u"第三方系统错误",
  42. RET.IOERR : u"文件读写错误",
  43. RET.SERVERERR : u"内部错误",
  44. RET.UNKOWNERR : u"未知错误",
  45. RET.NECESSARYPARAMERR : u"缺少必传参数",
  46. RET.SMSCODERR : u"短信验证码有误",
  47. RET.ALLOWERR : u"未勾选协议",
  48. }
  49. # coding:utf-8
  50. class RETCODE:
  51. OK = "0"
  52. IMAGECODEERR = "4001"
  53. THROTTLINGERR = "4002"
  54. NECESSARYPARAMERR = "4003"
  55. USERERR = "4004"
  56. PWDERR = "4005"
  57. CPWDERR = "4006"
  58. MOBILEERR = "4007"
  59. SMSCODERR = "4008"
  60. ALLOWERR = "4009"
  61. SESSIONERR = "4101"
  62. DBERR = "5000"
  63. EMAILERR = "5001"
  64. TELERR = "5002"
  65. NODATAERR = "5003"
  66. NEWPWDERR = "5004"
  67. REQERR = "4201"
  68. IPERR = "4202"
  69. THIRDERR = "4301"
  70. IOERR = "4302"
  71. SERVERERR = "4500"
  72. UNKOWNERR = "4501"
  73. err_msg = {
  74. RETCODE.OK : u"成功",
  75. RETCODE.IMAGECODEERR : u"图形验证码错误",
  76. RETCODE.THROTTLINGERR : u"访问过于频繁",
  77. RETCODE.NECESSARYPARAMERR : u"缺少必传参数",
  78. RETCODE.USERERR : u"用户名错误",
  79. RETCODE.PWDERR : u"密码错误",
  80. RETCODE.CPWDERR : u"密码不一致",
  81. RETCODE.MOBILEERR : u"手机号错误",
  82. RETCODE.SMSCODERR : u"短信验证码有误",
  83. RETCODE.ALLOWERR : u"未勾选协议",
  84. RETCODE.SESSIONERR : u"用户未登录",
  85. RETCODE.DBERR : u"数据错误",
  86. RETCODE.EMAILERR : u"邮箱错误",
  87. RETCODE.TELERR : u"固定电话错误",
  88. RETCODE.NODATAERR : u"无数据",
  89. RETCODE.NEWPWDERR : u"新密码数据",
  90. }