# tnbapp ElementUI 的模板框架来自[这个项目](https://github.com/phk422/videoproject-vue) master 分支的 c93506a7 版本 tnbapp 模块 - / > 主站 - /my > 用户帐号 - /mall > 商城 - /exam > 考试系统 - /disk > 网盘 - /cam > 摄像头 ## 依赖 - os:Linux - node:18 ## 后端接口 vue.config.js 文件中配置服务接口地址: ``` devServer: { port: 8000, // 项目的端口号 // 跨域代理配置 proxy: { '/api': { target: 'http://localhost:8888', //这里是接口地址,接口地址联系作者获取 ws: true,//是否代理websockets changeOrigin: true, // 设置同源 默认false,是否需要改变原始主机头为目标URL pathRewrite: { '^/api': '' } } } } ``` ## 构建部署 ### 安装依赖 ``` npm --registry http://registry.npm.taobao.org i ``` ### 启动服务 ``` npm run serve ``` > 启动服务后打开浏览器,访问 http://localhost:8000 ### 项目打包 ``` npm run build ``` > 使用 .env.production 文件中的配置 > > 构建后生成的结果在 dist 目录中 ## Nginx 配置 ``` server { listen 8080; access_log off; root /opt/webroot; location / { try_files $uri $uri/ /index.html; } } ``` > root 指令的路径指向 dist 目录的绝对路径