3 Star 0 Fork 0

实习团队 / monitor-fe

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

DEMO

仪表盘

仪表盘

用户管理

用户管理

阈值更新

阈值更新

1. 下载安装node

https://nodejs.org/dist/v12.18.2/node-v12.18.2-x64.msi

2. 安装vue环境

# 更换npm镜像
npm config set registry http://registry.npm.taobao.org
# 安装webpack
npm install webpack -g
# 安装vue-cli
npm install vue-cli -g

3. 构建项目

# 克隆项目到本地
git clone https://gitee.com/InternGroup/monitor-fe.git

# 进入项目目录
cd monitor-fe

# 安装依赖
npm install

4. 启动项目

启动模拟后台程序

在此下载相应平台的模拟程序并启动

启动前端项目
npm run dev

5. 前后端部署

打包前端项目
# 生产环境下打包
npm run build:prod

项目目录下生成dist文件夹

$ ls
favicon.png  index.html  static/
$ ls static/
css/  fonts/  img/  js/
安装nginx服务器

下载最新版本并安装,之后进入nginx根目录

# nginx目录结构
$ ls
conf/  contrib/  docs/  html/  logs/  nginx.exe*  temp/

清空nginx的html文件夹内所有内容,将上一步生成的dist目录下所有内容拷贝到nginx的html文件夹内。下一步修改nginx服务器配置:

修改nginx目录下conf文件夹内nginx.conf的server字段内容如下

server {
	# nginx服务器默认端口为80,可直接在浏览器输入localhost访问
    listen       80;
    server_name  localhost;

	location / {
        root   html;
        index  index.html index.htm;
	}

    # 后端服务的配置
    # 将所有 /api 的请求转发至后台服务器
    location /api/ {
        proxy_redirect off;
        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_pass http://localhost:8080/;
    }
}

然后将nginx安装路径添加至环境变量。

启动nginx服务
# 启动nginx
$ start nginx
# 查看nginx进程
$ tasklist /fi "imagename eq nginx.exe"
映像名称                       PID 会话名              会话#       内存使用
========================= ======== ================ =========== ============
nginx.exe                    12088 Console                    1     12,248 K
nginx.exe                     2452 Console                    1     12,608 K

启动好以后再将后台服务启动(上面提到的模拟程序或最终发布的jar包),浏览器输入localhost并回车,完成项目部署。

重启或关闭nginx服务
# 重启
$ nginx -s reload
# 关闭
$ nginx -s quit
MIT License Copyright (c) 2017-present PanJiaChen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/InternGroup/monitor-fe.git
git@gitee.com:InternGroup/monitor-fe.git
InternGroup
monitor-fe
monitor-fe
master

搜索帮助