import config from "@/config";
import http from "@/utils/request";

export default {
    /** 小程序用户列表 adminapi/users/list */
    list: {
        url: `${config.API_URL}/users/list`,
        name: "用户列表",
        get: async function (params = {}) {
            return await http.get(this.url, params);
        },
    },
    setStatus: {
        url: `${config.API_URL}/users/set_status`,
        name: "用户状态",
        get: async function (id, status) {
            return await http.get(`${this.url}/${id}/${status}`);
        },
    },
    pwd: {
        url: `${config.API_URL}/user/passwd`,
        name: "-",
        post: async function (params) {
            return await http.post(this.url, params);
        },
    },
    batch: {
        url: `${config.API_URL}/user/batch`,
        name: "-",
        post: async function (params) {
            return await http.post(this.url, params);
        },
    },
    save: {
        url: `${config.API_URL}/user/save`,
        name: "-",
        post: async function (params) {
            return await http.post(this.url, params);
        },
    },
    state: {
        url: `${config.API_URL}/user/state`,
        name: "-",
        post: async function (params) {
            return await http.post(this.url, params);
        },
    },
    del: {
        url: `${config.API_URL}/user/del`,
        name: "-",
        post: async function (params) {
            return await http.post(this.url, params);
        },
    },
}