index.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { httpRequest } from '@/services/http'
  2. import { HttpRequest } from '@/services/http/interface'
  3. import { tradeServerRequest } from '@/services/socket/trade'
  4. import { TradeRequest } from '@/services/socket/trade/interface'
  5. /**
  6. * 用户登录
  7. */
  8. export function login(params: TradeRequest<Proto.LoginReq, Proto.LoginRsp>) {
  9. return tradeServerRequest('LoginReq', 'LoginRsp', params);
  10. }
  11. /**
  12. * 用户令牌校验
  13. */
  14. export function tokenCheck(params: TradeRequest<Proto.TokenCheckReq, Proto.TokenCheckRsp>) {
  15. return tradeServerRequest('TokenCheckReq', 'TokenCheckRsp', params);
  16. }
  17. /**
  18. * 查询登录ID
  19. */
  20. export function queryLoginId(params: HttpRequest<{ req: { username: string }, rsp: string }>) {
  21. return httpRequest('/User/GetLoginID', 'get', params);
  22. }
  23. /**
  24. * 查询登录账户配置信息
  25. */
  26. export function queryLoginData(params: HttpRequest<{ req: Ermcp.LoginQueryReq, rsp: Ermcp.LoginQueryRsp }>) {
  27. return httpRequest('/User/LoginQuery', 'get', params);
  28. }
  29. /**
  30. * 查询账户菜单
  31. */
  32. export function queryAccountMenu(params: HttpRequest<{ rsp: Ermcp.UserMenu[] }>) {
  33. return httpRequest('/account/menu', 'get', params);
  34. }
  35. /**
  36. * 查询资金账户信息
  37. */
  38. export function queryTaAccounts(params: HttpRequest<{ req: Ermcp.TaAccountsReq, rsp: Ermcp.TaAccountsRsp[] }>) {
  39. return httpRequest('/TaAccount/GetTaAccounts', 'get', params);
  40. }
  41. /**
  42. * 查询账户角色
  43. */
  44. export function queryAccountRole(params: HttpRequest<{ rsp: Ermcp.UserRole[] }>) {
  45. return httpRequest('/account/role', 'get', params);
  46. }