dotpen_vue/README.md

92 lines
3.2 KiB
Markdown
Raw Normal View History

2018-02-10 05:27:57 +00:00
## renren-fast-vue
2018-04-15 13:21:16 +00:00
- renren-fast-vue基于vue、element-ui构建开发实现[renren-fast](https://gitee.com/renrenio/renren-fast)后台管理前端功能,提供一套更优的前端解决方案
2018-04-01 12:50:32 +00:00
- 定制主题风格通过scss变量统一一站式定制
2018-03-07 14:33:00 +00:00
- 前后端分离通过token进行数据交互可独立部署
2018-03-07 14:39:50 +00:00
- 发布时支持动态配置CDN静态资源切换新旧版本
2018-03-07 14:33:00 +00:00
- 演示地址:[fast.demo.renren.io](http://fast.demo.renren.io) (账号密码admin/admin)
2018-02-10 05:29:19 +00:00
2018-04-01 12:39:51 +00:00
![demo-screenshot_01](https://github.com/daxiongYang/renren-fast-vue/blob/master/screenshot_01.png)
![demo-screenshot_02](https://github.com/daxiongYang/renren-fast-vue/blob/master/screenshot_02.png)
![demo-screenshot_03](https://github.com/daxiongYang/renren-fast-vue/blob/master/screenshot_03.png)
2018-01-29 13:59:04 +00:00
2018-04-15 13:21:16 +00:00
## 更新日志
每个版本的详细更改都记录在[release notes](https://github.com/daxiongYang/renren-fast-vue/releases)中。
2018-02-09 05:48:07 +00:00
## 开发
2018-03-07 14:33:00 +00:00
> 无法正常预览项目效果时,请先检查是否正常安装依赖,再查看启动服务是否存在报错
2018-02-09 05:48:07 +00:00
```bash
# 克隆项目
2018-02-10 03:27:36 +00:00
git clone https://github.com/daxiongYang/renren-fast-vue.git
2018-02-09 05:48:07 +00:00
2018-03-07 14:33:00 +00:00
# 安装依赖(优先使用)
2018-01-29 13:59:04 +00:00
npm install
2018-03-07 14:33:00 +00:00
# 安装依赖(下载较慢时使用)
npm install --registry=https://registry.npm.taobao.org
2018-01-29 13:59:04 +00:00
2018-03-08 09:17:26 +00:00
#上述2种【安装依赖】无法正常时请尝试删除node_modules文件夹后使用cnpm安装
# 第一步
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 第二步
cnpm install
2018-02-09 05:48:07 +00:00
# 启动服务
2018-01-29 13:59:04 +00:00
npm run dev
2018-02-09 05:48:07 +00:00
```
2018-01-29 13:59:04 +00:00
2018-03-07 14:33:00 +00:00
- 开发时如何连接后台项目api接口
2018-03-07 14:39:50 +00:00
> 修改renren-fast-vue/static/config/index.js目录文件中window.SITE_CONFIG.baseUrl = '本地api接口请求地址'
2018-03-07 14:33:00 +00:00
- 开发时,如何解决跨域?
> 1. 修改renren-fast-vue/config/dev.env.js目录文件中OPEN_PROXY: true开启代理
> 2. 修改renren-fast-vue/config/index.js目录文件中proxyTable对象target: '代理api接口请求地址'
> 3. 重启本地服务
- 开发时如何提前配置CDN静态资源
2018-03-07 14:39:50 +00:00
> 修改renren-fast-vue/static/config/index-[qa/uat/prod].js目录文件中window.SITE_CONFIG.cdnUrl = '静态资源cdn地址' + window.SITE_CONFIG.staticFileName
2018-03-07 14:33:00 +00:00
2018-02-09 05:48:07 +00:00
## 发布
2018-03-07 14:33:00 +00:00
> 构建生成的资源文件保存在renren-fast-vue/dist目录下可通过config/index.js目录文件修改相关配置信息
2018-02-09 05:48:07 +00:00
```bash
# 构建生产环境(默认)
2018-01-29 13:59:04 +00:00
npm run build
2018-02-09 05:48:07 +00:00
# 构建测试环境
npm run build --qa
# 构建验收环境
npm run build --uat
# 构建生产环境
npm run build --prod
```
2018-03-07 14:33:00 +00:00
- 构建生成后,发布需要上传哪些文件?
2018-03-07 14:39:50 +00:00
> renren-fast-vue/dist目录下180307静态资源由当前日期动态生成文件夹名、config配置文件、index.html
2018-03-07 14:33:00 +00:00
- 构建生成后如何动态配置CDN静态资源
2018-03-07 14:39:50 +00:00
> 修改renren-fast-vue/dist/config/index.js目录文件中window.SITE_CONFIG.cdnUrl = '静态资源cdn地址' + window.SITE_CONFIG.staticFileName
2018-03-07 14:33:00 +00:00
- 构建生成后,如何动态切换新旧版本?
2018-03-07 14:39:50 +00:00
> 修改renren-fast-vue/dist/config/index.js目录文件中window.SITE_CONFIG.staticFileName = '180307静态资源文件夹名称'
2018-03-07 14:33:00 +00:00
2018-02-09 05:48:07 +00:00
## 其他
``` bash
2018-01-29 13:59:04 +00:00
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
2018-02-09 05:48:07 +00:00
```