This project is initialized with Ant Design Pro. Follow is the quick guide for how to use.
Install node_modules
:
npm install
or
yarn
Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
Scripts provided in package.json
. It's safe to modify or add additional script:
npm start
npm run build
npm run lint
You can also use script to auto fix some lint error:
npm run lint:fix
npm test
You can view full document on our official website. And welcome any feedback in our github.
1、git 下载代码后初始化项目
npm install
或者
yarn
2、找到 nginx 配置文件进行编辑
/usr/local/nginx/conf/nginx.conf
修改 location 配置项配置前端项目的位置,eg. /home/services/user-center-front。
location / {
root /home/services/user-center-front;
index index.html index.htm;
}
3、编辑全局映射文件,修改映射后端请求地址
./src/plugins/globalRequest.ts
将原有 http://localhost:8080 修改为部署后端的域名如:http://www.backend-user.com 或者其他端口地址。
4、前端代码重新编译,重新覆盖 dist 目录
5、重启 nginx
nginx -s reload
docker build
$ sudo docker build -t platform-user-frontend:v0.0.1 .
docker run
$ docker run -p 80:80 -d platform-user-frontend:v0.0.1
docker run -v
$ docker run -p 80:80 -v /data/platform/services/platform-user-backend:/usr/share/nginx/html -d platform-user-backend:v0.0.1