# oce.im **Repository Path**: tommi85/oce.im ## Basic Information - **Project Name**: oce.im - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-08-29 - **Last Updated**: 2025-08-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # macc.amdin.vue ## 一、开发者前置工作 1. node 安装,建议安装 12.x 以上版本 node, 可以安装个 nvm,支持安装多个版本的 node,进行切换使用 2. 下载 vscode 编译器,安装 Vetur, Prettier - Code formatter, Color Highlight i18n Ally 插件 并设置 Prettier 为默认的格式化方式 3. 安装浏览器插件 Vue.js devtools ### 依赖安装 ``` yarn install ``` ### 启动开发环境 ``` yarn run serve ``` ### 启动开发环境 #### 国内 ``` npm run serve ``` #### 海外 ``` npm run serve-intl ``` ### 生成环境打包编译 #### 国内 ``` yarn run build ``` #### 海外 ``` yarn run build-intl ``` ### 整理和修复文件 ``` yarn run lint ``` ### 目录结构 ``` dist 生产代码目录 src 源代码目录 |-----assets 静态资源文件目录 |-----cache 缓存文件目录 |-----plugin vue自定义插件目录 |-----components 公共组件目录 |-----locales 本地化目录(国际化) |-----mixin 混淆配置文件目录 |-----project 项目目录(存放项目) |-----projectCommon 项目公共文件目录(存放各项目公用文件) |-----store 公共参数目录 |-----utils 工具方法目录 |-----view 公共视图目录 ``` ## 二、项目入口配置 配置文件 > project.config.js ```javascript module.exports = { adminx: { //项目名称,对应项目入口文件目录 template: 'public/index.html', //页面模板地址 filename: 'admin/index.html', //工程目录名称生成页面名称 title: '云端', //页面title }, }; ``` 入口目录 > src/project ## 三、router 配置 1.projectCommon/router 为工程公共的静态路由配置 2.各个子工程独有的路由放置在子工程的 router 目录下,如 adminx/router 2.1 adminx/router/async.js 处理后端返回的异步路由 2.2 adminx/router/selfRouter.js 为子工程独有的一些静态路由 2.3 adminx/router/index.js 将公共的静态路由,异步路由,和子工程独有的静态路由合并,并设置子工程的自己的路由守卫 2.4 路由配置提供 requireAuth 和 layout 属性 ```js meta: { requireAuth: true, //标识页面访问是否需要登录权限 layout: 'BOTH', //页面布局方式 //layout提供如下属性值: TOP_MENU:头部菜单+内容, LEFT_MENU:左侧菜单+内容, BOTH:头部菜单+左侧菜单+内容, WHOLE:内容满屏 }, ``` ## 四、store 配置 1.projectCommon/store 为工程公共的 store 配置 2.各个子工程独有的 store 放置在子工程的 store 目录下,如 adminx/store 2.1 adminx/store/index.js 合并公共的 store 和子工程独有的 store ## 五、调用接口 1.所有得 api 接口地址 全部写在 src/utils/api.js 2.调用接口方法文件 src/utils/httpRequest.js ```js import { requestHttp, maccApi } from '@utils/index'; async getGroupTree() { var data = { api: maccApi.GET_GROUP_TREE, method: 'GET', }; let res = await requestHttp(data) if (res && res.code == 0) { //TODO } else { //TODO } }, ``` ## 项目版本说明 vue-cli 4.5.x webpack 4.x vue 2.6.x