//域名
// const domain = window.location.host + "/api";
// const domain = "localhost:9971/";
const domain = window.location.host + "/api";

//端口
const port = null;

const path = "";

//路径
const root =
    window.location.protocol + "//" + domain + (port ? ":" + port : "") + path;

//接口
const api = {
    cms:{
        labels:`${root}/cms/labels`,
        articles:`${root}/cms/articles`,
        detail:`${root}/cms/detail`,
        subscribe:`${root}/cms/subscribe`,
        like:`${root}/cms/like`,
        collect:`${root}/cms/collect`,
        comment:`${root}/cms/comment`,
        listComments:`${root}/cms/listComments`,
        listVipMagazines:`${root}/cms/listVipMagazines`,
        categorys:`${root}/cms/categorys`,
        myCollectArticles:`${root}/cms/myCollectArticles`,
        mySubArticles:`${root}/cms/mySubArticles`,
        myLikeArticles:`${root}/cms/myLikeArticles`,
        myViewArticles:`${root}/cms/myViewArticles`,
        myCommentArticles:`${root}/cms/myCommentArticles`,
        banners:`${root}/cms/banners`,
    },
    mzUser:{
        login:`${root}/mzUser/login`,
        logout:`${root}/mzUser/logout`,
        register:`${root}/mzUser/register`,
        resetPassword:`${root}/mzUser/resetPassword`,
        sendVerifyCode:`${root}/mzUser/sendVerifyCode`,
        userinfo:`${root}/mzUser/userinfo`,
        perfectInfo:`${root}/mzUser/perfectInfo`,
        createVipOrder:`${root}/mzUser/createVipOrder`,
        confirmVipOrder:`${root}/mzUser/confirmVipOrder`,
        createProductOrder:`${root}/mzUser/createProductOrder`,
        confirmProductOrder:`${root}/mzUser/confirmProductOrder`,
        myVipSmOrders:`${root}/mzUser/myVipSmOrders`,
        myProductOrders:`${root}/mzUser/myProductOrders`,
        vipSmOrder:`${root}/mzUser/vipSmOrder`,
        uploadOrderPayPic:`${root}/mzUser/uploadOrderPayPic`,
        prodcutOrder:`${root}/mzUser/prodcutOrder`,
    },
    common:{
        uploadFile:`${root}/common/uploadFile`,
        vipSmeals:`${root}/common/vipSmeals`,
        simpleArticle:`${root}/common/simpleArticle`,
        productDetail:`${root}/common/productDetail`,
        banners:`${root}/common/banners`,
    }
};

export default Object.assign(
    {
        $base: {
            domain: domain,
            port: port,
            root: root
        }
    },
    api
);
