// @ts-ignore
/* eslint-disable */
import request from '../request';

/** 二次认证 POST /auth/openSafe */
export async function openSafe(
	body: AuthAPI.OpenSafeCmd,
	options?: { [key: string]: any },
) {
	return request<AuthAPI.Response>('/auth/openSafe', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 账号密码登录接口 POST /auth/passwordLogin */
export async function passwordLogin(
	body: AuthAPI.PasswordLoginQry,
	options?: { [key: string]: any },
) {
	return request<AuthAPI.SingleResponseUserAuthVO>('/auth/passwordLogin', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}

/** 获取 redirectUrl POST /auth/sso/getRedirectUrl */
export async function getRedirectUrl(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: AuthAPI.getRedirectUrlParams,
	options?: { [key: string]: any },
) {
	return request<AuthAPI.SingleResponseString>('/auth/sso/getRedirectUrl', {
		method: 'POST',
		params: {
			...params,
		},
		...(options || {}),
	});
}

/** 返回SSO认证中心登录地址 POST /auth/sso/getSsoAuthUrl */
export async function getSsoAuthUrl(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: AuthAPI.getSsoAuthUrlParams,
	options?: { [key: string]: any },
) {
	return request<AuthAPI.SingleResponseString>('/auth/sso/getSsoAuthUrl', {
		method: 'POST',
		params: {
			...params,
		},
		...(options || {}),
	});
}

/** 当前是否登录 POST /auth/sso/isLogin */
export async function isLogin(options?: { [key: string]: any }) {
	return request<Record>('/auth/sso/isLogin', {
		method: 'POST',
		...(options || {}),
	});
}

/** 登出 POST /auth/sso/logout */
export async function logout(options?: { [key: string]: any }) {
	return request<AuthAPI.Response>('/auth/sso/logout', {
		method: 'POST',
		...(options || {}),
	});
}

/** 修改密码 POST /auth/updatePassword */
export async function updatePassword(
	body: AuthAPI.UpdatePasswordCmd,
	options?: { [key: string]: any },
) {
	return request<AuthAPI.Response>('/auth/updatePassword', {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json',
		},
		data: body,
		...(options || {}),
	});
}
