Make a npm package by yourself. If you introduce it into the reducer of redux, you will report an error when you package it with webpack.

npm packet address

https://www.npmjs.com/package.

the code is as follows:

module.exports = {
    post: async function(url, headers, postBody) {
        const _self = this;
        var response = [];
        try {
            const response = await fetch(url, {
                method: "POST",
                headers: headers,
                body: postBody,
                mode: "cors",
                credentials: "include"
            })
            return await response.json();

        } catch (e) {
            console.log("Oops, error", e)
        }
    },
    get: async function(url, headers, postBody) {
        const _self = this;
        var response = [];
        try {
            const response = await fetch(url, {
                method: "GET",
                body: postBody,
                headers: headers,
                mode: "cors",
                credentials: "include"
            })
            return await response.json();

        } catch (e) {
            console.log("Oops, error", e)
        }
    }
}
Apr.30,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b22677-2b60b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b22677-2b60b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?