|
|
**仓库地址**
|
|
|
[http://git.yoho.cn/fe/yohobuy-portal-fe2](http://git.yoho.cn/fe/yohobuy-portal-fe2)
|
|
|
|
|
|
**本地开发**
|
|
|
|
|
|
测试账号: chengls aA123456@
|
|
|
|
|
|
由于在package.json的scripts标签中设置NODE_ENV时存在跨平台问题:
|
|
|
|
|
|
window: set NODE_ENV=
|
|
|
|
|
|
MAC: export NODE_ENV=
|
|
|
|
|
|
gulp-develop-server 默认环境变量为development
|
|
|
|
|
|
*基于现在代码*需要修改code/index.js中代码如下:
|
|
|
|
|
|
![image.png](https://cdn.nlark.com/yuque/0/2020/png/193477/1584516481215-733870c2-587f-48e7-9750-b60a068913f0.png#align=left&display=inline&height=378&name=image.png&originHeight=756&originWidth=1350&size=158284&status=done&style=none&width=675)
|
|
|
|
|
|
- nginx配置通过域名访问:
|
|
|
|
|
|
server_name不能为admin.portal.yohobuy.com,因为与java api访问域名相同造成api调用失败
|
|
|
|
|
|
```
|
|
|
|
|
|
upstream local_admin_portal_node {
|
|
|
server localhost:30012 weight=6 max_fails=2 fail_timeout=5s;
|
|
|
keepalive 100;
|
|
|
}
|
|
|
|
|
|
server {
|
|
|
listen 80;
|
|
|
server_name admin.test.portal.yohobuy.com;
|
|
|
location / {
|
|
|
proxy_redirect off;
|
|
|
proxy_pass http://local_admin_portal_node;
|
|
|
proxy_connect_timeout 300;
|
|
|
proxy_read_timeout 300;
|
|
|
proxy_send_timeout 300;
|
|
|
proxy_set_header Host $host;
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
proxy_set_header Accept-Encoding "gzip";
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
- locahost:30012访问绕过登陆
|
|
|
|
|
|
![image.png](https://cdn.nlark.com/yuque/0/2020/png/193477/1584517116545-f478a54f-c406-43ef-9491-7eee657edd3d.png#align=left&display=inline&height=123&name=image.png&originHeight=246&originWidth=1926&size=88165&status=done&style=none&width=963)
|
|
|
|
|
|
需要修改
|
|
|
|
|
|
|
|
|
**环境发布**
|
|
|
【测试环境】
|
|
|
|
|
|
IP: 192.168.102.49
|
|
|
|
|
|
user: root
|
|
|
|
|
|
password: eW9obzk2NDY=
|
|
|
|
|
|
path: /Data/code/yohobuy-portal-fe2
|
|
|
|
|
|
build: cd /Data/code/yohobuy-portal-fe2/code && npm run build && pm2 restart yohobuy-portal-fe
|
|
|
|
|
|
|
|
|
【灰度/生产环境】
|
|
|
|
|
|
IP: 192.168.102.210
|
|
|
|
|
|
user: root
|
|
|
|
|
|
password: 123456
|
|
|
|
|
|
build: cd /home/node
|
|
|
|
|
|
灰度环境 sh portal.sh gray
|
|
|
|
|
|
生产环境 sh portal.sh master |
|
|
\ No newline at end of file |
...
|
...
|
|