login.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import Service from '../lib/service'
  2. class LoginService extends Service {
  3. constructor () {
  4. super()
  5. }
  6. //登录
  7. async Login (params = {}) {
  8. let res = await this.postAll("Host80","/custom/login", params);
  9. return res
  10. }
  11. //登出
  12. async Logout (params = {}) {
  13. let res = await this.postAll("Host80","/custom/logout", params);
  14. return res
  15. }
  16. //注册
  17. async Register (params = {}, config = {}) {
  18. let res = await this.postAll("Host80","/custom/register", params, config);
  19. return res
  20. }
  21. //发送邮件验证
  22. async Code (params = {}) {
  23. let res = await this.postAll("Host80","/custom/register/send/code", params);
  24. return res
  25. }
  26. //当前国家编码
  27. async CodeById (params = {}) {
  28. let res = await this.postAll("Host80","/country/getCodeByIp", params);
  29. return res
  30. }
  31. // 获取登录信息
  32. async CustomLoginInfo (params = {}) {
  33. let res = await this.postAll("Host80","/custom/info", params);
  34. return res
  35. }
  36. //语言切换
  37. async switchLanguage (params = {}) {
  38. let res = await this.postAll("Host80","/custom/switch/lang", params);
  39. return res
  40. }
  41. //忘记密码发送邮件
  42. async forgetPwd (params = {}) {
  43. let res = await this.postAll("Host80","/custom/update/password/send/email", params);
  44. return res
  45. }
  46. //忘记密码
  47. async forgetPwdUpdate (params = {}) {
  48. let res = await this.postAll("Host80","/custom/update/email/password", params);
  49. return res
  50. }
  51. //trading密码重置
  52. async tradingPwdUpdate (params = {}) {
  53. let res = await this.postAll("Host80","/account/deal/password/reset/apply", params);
  54. return res
  55. }
  56. //客户文件列表
  57. async CustomFileList (params = {}) {
  58. let res = await this.postAll("Host80","/custom/file/list", params);
  59. return res
  60. }
  61. //浏览器语言
  62. async getLanguage (params = {}) {
  63. let res = await this.postAll("Host80","/custom/get/language", params);
  64. return res
  65. }
  66. //发送邮件验证
  67. async sendCode (params = {}) {
  68. let res = await this.post("/custom/send/code", params);
  69. return res
  70. }
  71. //登录验证方式
  72. async loginValid (params = {}) {
  73. let res = await this.post("/custom/login/valid", params);
  74. return res
  75. }
  76. }
  77. export default new LoginService