import request from "@/utils/request";
import {BASE, AUTH} from "@/api/apiGateway"

export function logout(data) {
	return request({
		url: `${AUTH}/auth/oauth/logout`,
        method: "post",
        data
	});
}

export function getUserInfo(token) {
	return request({
		url: `${AUTH}/user/info`,
		method: "get",
		params: { token }
	});
}

export function getPublicKey() {
	return request({
		url: `${AUTH}/auth/oauth/getPublicKey`,
		method: "get"
	});
}

export function login(data) {
	return request({
		url: `${AUTH}/auth/oauth/login`,
		method: "post",
		data
	});
}

export function sendCaptcha(data) {
    return request({
		url: `${AUTH}/auth/oauth/sendCaptcha`,
        method: "get",
        params: data
	});
}

export function forgetPwd(data) {
    return request({
		url: `/patient/basePatient/forgetPwd`,
        method: "post",
        params: data
	});
}

// 解密
export function getHwlyyDecrypt(data) {
    return request({
		url: `${AUTH}/auth/oauth/getHwlyyDecrypt`,
		method: "post",
		data
	});
}


export function imgCaptcha(params) {
  return request({
    url: `${AUTH}/auth/oauth/imgCaptcha`,
    method: 'get',
    params
  })
}


export function getShortMessage(params) {
	return request({
		url: `${AUTH}/auth/oauth/getShortMessage`,
		method: 'get',
		params
	})
}


export function captcha(data) {
	return request({
		url: `${AUTH}/auth/oauth/captcha`,
		method: 'post',
		data
	})
}



export function registerPatientAndLogin(data) {
	return request({
		url: `${AUTH}/auth/oauth/registerPatientAndLogin`,
        method: "post",
        data
	});
}

export function findPatientPw(data) {
	return request({
		url: `${AUTH}/auth/oauth/findPatientPw`,
        method: "post",
        data
	});
}
//注销账号    
export function deleteUser(data) {
	return request({
		url: `${BASE}/patient/deleteUser`,
        method: "post",
        data
	});
}
//获取居民定位
export function updLatLon(data) {
	return request({
		url: `${BASE}/patient/updLatLon`,
        method: "post",
        data
	});
}