dahua.ts 673 B

123456789101112131415161718192021222324252627
  1. import request from '@/utils/request';
  2. import { BaseResponse } from './type';
  3. import { DA_HUA_URL_PREFIX } from '@/constants/constants';
  4. export interface DAHUALoginParams {
  5. userName: string;
  6. signature: string;
  7. randomKey: string;
  8. encryptType: 'MD5';
  9. clientType: 'winpc';
  10. pid: 2548;
  11. }
  12. export interface LoginResponse extends BaseResponse {
  13. token?: string;
  14. userId?: string | number;
  15. }
  16. export const DAHUALogin = (params: DAHUALoginParams) =>
  17. request<LoginResponse>('POST', {
  18. url: `${DA_HUA_URL_PREFIX}/videoService/accounts/authorize`,
  19. data: params,
  20. headers: {
  21. 'Content-Type': 'application/json',
  22. 'X-Subject-Token': '',
  23. },
  24. });