# pet-platform-web **Repository Path**: wus-team/pet-platform-web ## Basic Information - **Project Name**: pet-platform-web - **Description**: 萌宠平台-PC前端代码, 对应服务项目pet-platform-api - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-05-03 - **Last Updated**: 2025-03-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # console-admin > 车辆综合管理平台,基于 vue、vue-router、vuex、less、element-ui、axios 构建脚手架 ## 1、基础目录结构 ``` ├── devMock // 本地mock数据 ├── plop-templates // form、table模版文件 ├── public // 静态资源文件 ├── server // 基于node服务部署 └── src ├── api // 接口 ├── components // 公共组件 ├── demos // demo ├── plugins // 国际化 │ └── i18n ├── routes // 路由模块 ├── store // 数据控制模块 ├── themes // 主题及图片 │ ├── icons │ ├── images │ └── styles ├── utils // 公共方法 └── views // 业务及布局模块 └── layout ``` ## 2、项目配置 > 见`.env.*` 配置项,开发模式下只需配置`.env.development` - 注意: - 本地服务端口`VUE_APP_PORT` - 代理数量(默认只代理一个,需要更多,修改`vue.config.js`中的`proxy`配置项) - 接口服务地址`VUE_APP_SERVERPATH_CONSOLE` ## 3、开发注意 - 所有表单页面,需在`data`数据中初始化必填字段 - 通用列表表格页面,基于`components/table`组件做页面开发 ## 4、开发构建 - 安装依赖 ``` npm install ``` - 开发服务 ``` npm start or npm run dev ``` - 语法检测 ``` npm run lint ``` - 打包生成部署包(需先执行依赖安装). ``` npm run build ``` ## 5、服务部署 > nginx 部署 - 1、在工程根目录中,将`dist`目录下文件部署在`nginx`服务器`html`目录下. - 2、配置`nginx`代理 ``` // 在VUE_APP_BASEURLPATH为/console-admin,VUE_APP_ROUTEMODEL为history时, location /console-admin { try_files $uri $uri/ /console-admin/index.html; } location /api { proxy_pass http://ip:port /*线上框架后台服务域名及端口*/ } ``` - 3、重启`nginx` ``` nginx -s reload ``` > 自建 node 服务部署,node 版本 10.15.0+ ## 6、基于模版快速创建文件 ``` npm run create ``` ## 7、相关参考 - 组件编码规范 - See [Configuration Reference](https://cli.vuejs.org/config/).