import request from '/@/utils/request';

/**
 * 获取Google验证器二维码
 * @returns 返回base64编码的二维码图片
 */
export function getGoogleCode() {
	return request({
		url: '/admin/google/getCode',
		method: 'post',
	});
}

/**
 * 绑定Google验证器
 * @param code 6位验证码
 * @returns 绑定结果
 */
export function bindingGoogle(code: string) {
	return request({
		url: '/admin/google/binding',
		method: 'get',
		params: { code },
	});
}

/**
 * 解绑Google验证器
 * @param pwd 登录密码
 * @returns 解绑结果
 */
export function unbindingGoogle(pwd: string) {
	return request({
		url: '/admin/google/unbinding',
		method: 'post',
		data: { pwd },
	});
}
