mybricks-app-pc-cdm
v1.1.75
Published
PC云组件
Downloads
222
Keywords
Readme
安装依赖
npm i && cd pages && npm i
启动项目
启动服务端: npm run dev:be
启动客户端: cd pages && npm run dev
访问地址
在客户端 webpack 配置配置 proxy,代理到目标的线上环境 pages/scripts/webpack.dev.ts
在目标环境新建一个 PC 页面,得到 id xxx
访问: http://localhost:8080/?id=xxx
webpack 配置参考(代理到 test 环境):
config = {
devServer: {
static: path.resolve(__dirname, "../templates"),
proxy: [
{
context: ["/api/pccdm/publish"],
target: "http://localhost:9002",
secure: false,
changeOrigin: true,
},
{
context: ["/paas/api/user/signed"],
target: "https://test.mybricks.world/mybricks-app-pcspa/",
secure: false,
changeOrigin: true,
bypass: function (req) {
const { url } = req;
if (url.startsWith("/public/") || url.startsWith("/css")) {
return url;
}
},
},
{
context: ["/"],
target: "https://test.mybricks.world/",
secure: false,
changeOrigin: true,
bypass: function (req) {
const { url } = req;
if (url.startsWith("/public/") || url.startsWith("/css")) {
return url;
}
},
},
],
},
};