# ROS-Web **Repository Path**: stryear/ros-web ## Basic Information - **Project Name**: ROS-Web - **Description**: 移动机器人网页前端与后端 - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 2 - **Created**: 2024-06-05 - **Last Updated**: 2025-10-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ROS-Web #### 介绍 移动机器人网页前端与后端 #### 前端图片展示 ![输入图片说明](images2024.png) ![输入图片说明](images52.png) ![输入图片说明](images234.png) #### 安装教程 1. mysql 2. nodejs #### 使用说明 1. 启动mysql 2. npm run serve 启动后端服务 3. npm run dev 启动前端页面 #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### MySQL 1. mysql -u cs -p 2. CREATE DATABASE online_ros; 3. USE online_ros; 4. SOURCE /path/to/online_ros.sql; #### 上传代码 1. git add . 2. git commit -m '提交信息' 3. git push origin master #### nginx配置 ```conf upstream flask { server 127.0.0.1:5000; } server { listen 4000 default_server; # listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; # root /var/www/; # Add index.php to the list if you are using PHP # index index.html index.htm; server_name _; location / { root /var/www/dist/; index index.html index.htm; # 用于配合前端路由为h5模式使用,防止刷新404 https://router.vuejs.org/zh/guide/essentials/history-mode.html#nginx try_files $uri $uri/ /index.html; } # 第一个代理后端地址(vite.config.ts里叫 /api,这里也要保持一致) location /api { # 如果后端在本地比如127.0.0.1或者localhost请解开下面的rewrite注释即可 rewrite ^.+api/?(.*)$ /$1 break; # 这里填写后端地址(后面一定不要忘记添加 / ) proxy_pass http://127.0.0.1:3333/; proxy_set_header Host $host; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect default; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; } location /map { alias /home/cs/map; autoindex on; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; } location /upload { #alias /home/cs/upload/; 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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; proxy_pass http://flask; } # pass PHP scripts to FastCGI server # #location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } ```