replenish.ts 796 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * 补货员相关API
  3. */
  4. import { post, get } from '../utils/request';
  5. export interface LoginResponse {
  6. token: string;
  7. userInfo: any;
  8. }
  9. /**
  10. * 补货员微信静默登录
  11. * @param params { code: 微信登录凭证 }
  12. */
  13. export const loginByWechat = (params: { code: string }): Promise<LoginResponse> => {
  14. return post<LoginResponse>('/replenisher/login/wechat', params);
  15. };
  16. /**
  17. * 补货员扫码绑定微信
  18. * @param params { bindingCode: 绑定码, code: 微信登录凭证 }
  19. */
  20. export const bindWechat = (params: { bindingCode: string; code: string }): Promise<LoginResponse> => {
  21. return post<LoginResponse>('/replenisher/login/bind', params);
  22. };
  23. /**
  24. * 获取当前补货员信息
  25. */
  26. export const getMyInfo = (): Promise<any> => {
  27. return get('/replenisher/my-info');
  28. };