import request from "@/utils/request";
import {BASE_URL} from '@/config'

export const getUserInfo = () => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/getUserInfo`,
        params:{
            stage:3
        }
    });
}

export const updatePassword = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/user/resetMyPassword`,
        data:{
            ...data,
            stage:3
        }
    });
}


export const getUserList = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/getUserList`,
        params,
    });
}


//重置密码
export const resetPassword = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/resetPassword`,
        params,
    });
}

//删除用户
export const deleteUser = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/deleteUser`,
        params,
    });
}

//保存用户
export const saveUser = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/user/saveUser`,
        data,
    });
}


//获取区县列表下拉框
export const getDistrictSelect = () => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/getBaseDistrict`,
    });
}


//获取学校列表下拉框
export const getSchoolSelect = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/getBaseSchool`,
        params,
    });
}

export const getUserDetail = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/user/getUser`,
        params,
    });
};