import { GET,POST ,UPLOAD } from "@/utils/http";
import type { UserRequest } from "@/apis/types/user";

export async function getUserInfo(data:UserRequest){
    return GET('/api/auth/user',data)

}
export async function login(data:UserRequest){
    return POST('/api/auth/login',data)

}




export function upload(params: any) {
    const form = new FormData()
    Object.keys(params).map((item) => {
      form.append(item, params[item])
    })
    return POST('/upload', form, {
      cancelRepeatKey: `${Date.now}${Math.random()}`,
      headers: {
        'Content-Type': 'multipart/form-data',
      },
    })
  }
// 获取验证码
export function sendCode(data:UserRequest) {
    return POST('/api/auth/send_code',data)
  }


// 获取用户组织
export function getAccountCompany() {
    return GET('/api/backend/account/get_account_company')
}




// 选中组织
export function selectCompany(data) {
    return POST('/api/backend/account/select_company',data)
}

