import axios from '../request';

// 运营人员
export interface operateEntity {
  userName: string;
  accountNo: string;
  id: number;
  uid: string;
}
export interface loginEntity {
  accountNo: string;
  passWord: string;
  remember: boolean;
}

export class CommonAPI {
  static Login = (data: Pick<loginEntity, 'accountNo' | 'passWord'>): any => {
    return axios.post('userservlet/auth/platformLogin', {
      ...data,
      portType: 1,
    });
  };

  // 上传图片
  static commonUpload = (data: FormData) => {
    return axios.post('ossservlet/upload/osses', data);
  };

  // 上传图片
  static fileUpload = (data: FormData) => {
    return axios.post('ossservlet/upload/oss', data);
  };

  //  运营人员列表
  static operateList(operateName: string) {
    return axios.post('orderservlet/ordertask/listOperate', { operateName });
  }

  //  销售人员列表
  static getSaleList() {
    return axios.get('userservlet/useraccount/getSaleList');
  }
}
