import request from "@/utils/request";
import { useUserStore } from "@/store/user";

export default {
    get: function (params) {
        return request({
            url: "/qdport-zcgx/log/page",
            method: "get",
            params
        })
    },

    add: function (operateName, operateType) {
        return Promise.all([
            request({
                url: "/qdport-zcgx/log/save",
                method: "post",
                data: {
                    userId: useUserStore().userInfo.id,
                    loginName: useUserStore().userInfo.userName,
                    userName: useUserStore().userInfo.name,
                    operateName,
                    operateType
                }
            }).catch(() => ElMessage.warning("日志异常"))
        ])
    }
}