一. vscode+nodejs+npm安装
二. nodejs服务器开启
-
打开vscode - 终端 - 新建终端
-
进入json_server目录
cd D:\json_server
-
运行启动命令, 启动json-server服务器
npm run json:server
效果如下:
PS D:\json_server> npm run json:server
> [email protected] json:server
> json-server --watch --host 0.0.0.0 --routes route.json db.json
\{^_^}/ hi!
Loading db.json
Loading route.json
Done
Resources
http://0.0.0.0:3000/regappid
http://0.0.0.0:3000/gettoken
http://0.0.0.0:3000/post_ats_info
http://0.0.0.0:3000/post_fl_infos
http://0.0.0.0:3000/post_ats_status
http://0.0.0.0:3000/post_tos_info
http://0.0.0.0:3000/post_urgent_cmd
http://0.0.0.0:3000/pis
Other routes
/api/user/regappid -> /regappid
/api/system/gettoken -> /gettoken
/api/pis/post_ats_info -> /post_ats_info
/api/pis/post_fl_infos -> /post_fl_infos
/api/pis/post_ats_status -> /post_ats_status
/api/pis/post_tos_info -> /post_tos_info
/api/pis/post_urgent_cmd -> /post_urgent_cmd
Home
http://0.0.0.0:3000
Type s + enter at any time to create a snapshot of the database
Watching...
三. Qt项目运行
打开以下项目控制:
DEFINES += PROJECT_SHH1418_PLATFORM
../ui_qml/shanghai1418platform/init/qml.qrc
后端文件
platformshh1418setting # 软件设置
httppisc # 协议解析
metroplatformmsg # 存储数据
前端文件