From e1efd254c4f7a4e2cbdf1908fb8b021e985d356d Mon Sep 17 00:00:00 2001 From: ylwdev Date: Tue, 23 Aug 2022 16:42:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmrc | 2 ++ doc/develop.md | 39 ++++++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..fb7538d --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass/ +registry=https://registry.npmmirror.com/ diff --git a/doc/develop.md b/doc/develop.md index 82325ce..eb29294 100644 --- a/doc/develop.md +++ b/doc/develop.md @@ -1,18 +1,43 @@ -# csdn-datav -2 +# 开发文档 + ## 环境准备 +#### git设置 +* *注意*:设置git提交的user.email与[CSDN账号邮箱](https://i.csdn.net/#/user-center/account) 保持一致,避免个人真实信息泄露 ```bash - # 大小写敏感 git config core.ignorecase false -# 修改NPM国内镜像加速 -npm config set registry https://registry.npmmirror.com/ - # 设置你git提交用户名/邮箱,注意本项目尽量不要带--global git config user.name "git用户名" git config user.emall "git邮箱" ``` -* *注意*:设置git提交的user.email与[CSDN账号邮箱](https://i.csdn.net/#/user-center/account) 保持一致,避免个人真实信息泄露 + +#### npm设置 +本项目中的.npmrc 文件已经设置NPM国内镜像源,等同于以下配置 +```bash +# 修改NPM国内镜像加速 +npm config set registry https://registry.npmmirror.com/ +``` +#### 设置本地开发环境host +由于用户头像图片服务器设置了域名防盗链,所以本地环境需要在*.csdn.net 域名下访问,避免开发环境头像不显示问题 +域名与与vue.config.js 配置保持一致 +``` +127.0.0.1 loc-csdn-datav.csdn.net +``` +云IDE环境注意做以下修改 + +1.找到vue.config.js 文件,修改devServer配置 +``` + devServer: { + allowedHosts:'all', + port: '3000', + headers: { + 'Access-Control-Allow-Origin': '*' + } + } +``` +2.配置端口映射,将3000端口映射为平台支持的其他端口范围 +3.通过云IDE的HOST访问 + ## 项目启动 ``` -- GitLab