/*
 * @Description:: 请补充填写
 * @Version: 请配置版本号
 * @Author: 舟舟
 * @Date: 2022-06-25 23:00:38
 * @LastEditors: 舟舟
 * @LastEditTime: 2022-07-26 12:04:44
 * @FilePath: /ouicai_web_framework_vite_ep/src/api/backend/routine/AdminInfo.ts
 */
import createAxios from '/@/utils/axios'
import { sysOperationLog } from '/@/api/controllerUrls'

const controllerUrl = '/sysAccount/'
export const actionUrl = new Map([
    ['index', controllerUrl + 'adminInfo'],
    ['edit', controllerUrl + 'editAdmin'],
    ['log', sysOperationLog + 'index'],
])

export function index() {
    return createAxios({
        url: actionUrl.get('index'),
        method: 'get',
    })
}

export function log(filter: anyObj = {}): ApiPromise<TableDefaultData> {
    return createAxios({
        url: actionUrl.get('log'),
        method: 'get',
        params: filter,
    }) as ApiPromise
}

export function postData(data: anyObj) {
    return createAxios(
        {
            url: actionUrl.get('edit'),
            method: 'post',
            data: data,
        },
        {
            showSuccessMessage: true,
        }
    )
}
