Nginx负载均衡配置
Nginx 负载均衡配置 upstream hcon.com { server localhost:8081 weight=10; server localhost:8082 weight=2; server localhost:8083;}server { listen 80; server_name localhost; location / { proxy_pass http://hcon.com }}
Nginx Load Balancing Config
Basic upstream block with weighted round robin and proxy_pass usage.
WeChat Mini Program Location Permission Handling
Prompt user to re-authorize location in a WeChat Mini Program when permission was previously denied.
微信小程序 兼容用户拒绝获取位置权限 用户拒绝权限处理
微信小程序 兼容用户拒绝获取位置权限 用户拒绝权限处理 function getAuthor() { wx.getSetting({ success(res) { if (!res.authSetting['scope.userLocation']) { wx.openSetting({ success: (res) =>{ console.log(res) if (!res.authSetting['scope.userLocation']) { wx.showModal({ title: '温馨提醒', content: '需要获取您的地理位置才能使用小程序', cancelText: '不使用', ...
JS判断设备 检查手机系统 检测系统
JS 判断设备 检查手机系统 检测系统 if ( /AppleWebKit.*Mobile/i.test(navigator.userAgent) || /MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test( navigator.userAgent )) { if (window.location.href.indexOf("?mobile") < 0) { try { if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { window.location.href = "../m/index.html"; } else if (/iPad...
JS Detect Device and Platform via UserAgent
Legacy userAgent pattern matching to redirect mobile users; prefer feature detection today.
Responsive Viewport Meta Tag
Explanation of common viewport meta attributes for mobile responsive layout.