import { request } from "../utils/request";

// 获取oauth token
export interface OauthTokenRequest {
  clientId: string;
  grant_type?: string;
  openIdCode?: string[];
  scope?: string;
  [property: string]: any;
}

export function oauthToken(args: OauthTokenRequest) {
  return request({
    url: "/auth/oauth2/token",
    method: "post",
    data: args,
  });
}

// 绑定用户手机号
export function bindUserPhone(args: any) {
  return request({
    url: "/hotelBiz/user/bindUserPhone",
    method: "post",
    data: args,
  });
}

// 检测用户是否绑定手机号
export function checkUserPhone(args: any) {
  return request({
    url: "/hotelBiz/user/checkUserHasBindPhone",
    method: "get",
    params: args,
  });
}

// 获取登录用户手机号
export function getLoginUserPhone(args: any) {
  return request({
    url: "/hotelBiz/user/getLoginUserPhone",
    method: "get",
    params: args,
  });
}

// 获取服务协议
export function getServiceAgreement(args: any) {
  return request({
    url: "/hotelBiz/mainScene/serviceAgreement",
    method: "get",
    params: args,
  });
}

// 获取隐私协议
export function getPrivacyAgreement(args: any) {
  return request({
    url: "/hotelBiz/mainScene/privacyPolicy",
    method: "get",
    params: args,
  });
}
