import httpClient from '@/services/http'
import { CommonFetchOptions } from '@/services/http/types'

/**
 * 获取验证码
 */
export function verifyCode(options: CommonFetchOptions<{ response: Model.VerifyCodeRsp; }> = {}) {
    return httpClient.commonRequest('/systemmanager/verifyCode', 'get', options)
}

/**
 * 用户登录
 */
export function login(options: CommonFetchOptions<{ request: Model.LoginReq; response: string; }>) {
    return httpClient.commonRequest('/login', 'post', options)
}

/**
 * 用户查询
 */
export function loginIn(options: CommonFetchOptions<{ request: Model.LoginInReq; response: Model.LoginInRsp; }>) {
    return httpClient.commonRequest('/systemmanager/loginIn', 'post', options)
}

/**
 * 修改密码
 */
export function updatePwd(options: CommonFetchOptions<{ request: Model.UpdatePwdReq; }>) {
    return httpClient.commonRequest('/systemmanager/updatePwd', 'post', options)
}

/**
 * token 校验
 */
export function checkToken(options: CommonFetchOptions = {}) {
    return httpClient.commonRequest('/common/checkToken', 'post', options)
}

/**
 * 获取菜单列表信息
 */
export function getMenus(options: CommonFetchOptions<{ response: Model.MenusRsp[]; }> = {}) {
    options.data = {
        menuType: 6
    }
    return httpClient.commonRequest('/funcmenulist/getMenus', 'get', options)
}

/**
 * 处理菜单列表信息
 */
export function dealMenus(options: CommonFetchOptions<{ request: Model.DealMenusReq; }>) {
    return httpClient.commonRequest('/funcmenulist/dealMenus', 'post', options)
}

/**
 * 删除菜单列表信息
 */
export function deleteMenus(options: CommonFetchOptions<{ request: Model.DeleteMenusReq; }>) {
    return httpClient.commonRequest('/funcmenulist/deleteMenus', 'post', options)
}

/**
 * 获取菜单列表信息
 */
export function getAllMenus(options: CommonFetchOptions<{ response: Model.MenusRsp[]; }> = {}) {
    options.data = {
        menuType: 6
    }
    return httpClient.commonRequest('/funcmenulist/getAllMenus', 'get', options)
}