NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
一个用于在 AMH 内网页面自动加载本地 mock.js 的用户脚本(Userscript)。
document-start 时机注入,确保尽早加载该脚本会根据当前页面的协议自动选择加载不同的本地 mock 服务:
https://localhost:3366/mock.jshttp://localhost:3354/mock.js这样可以避免浏览器的混合内容(Mixed Content)安全限制。
直接从 OpenUserJS 安装: 点击这里安装
安装用户脚本管理器(选择其一):
脚本会在以下页面自动运行:
https://web.amh-group.com:8080/*http://web.amh-group.com:8080/*https://web.amh-group.com:3000/*http://web.amh-group.com:3000/*https://web.amh-group.com:10088/*http://web.amh-group.com:10088/*如果需要修改 mock.js 的地址或端口,可以编辑脚本中的以下部分:
const isHttps = window.location.protocol === 'https:';
script.src = isHttps ? 'https://localhost:3366/mock.js' : 'http://localhost:3354/mock.js';
确保你的本地 mock 服务运行在相应的端口:
localhost:3366localhost:3354# HTTPS 服务(端口 3366)
cd your-mock-project
npm run serve:https
# HTTP 服务(端口 3354)
cd your-mock-project
npm run serve:http
欢迎提交 Issue 和 Pull Request!
MIT License - 详见 LICENSE 文件
详见 CHANGELOG.md
Rating: 0