axios CROS每次请求多一次options请求 axios CROS request two times every time
axios CROS每次请求多一次options请求case: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORSheader’s param except for the following Accept Accept-Language Content-Language Content-Type (需要注意额外的限制) DPR Downlink Save-Data Viewport-Width Widthother param make the request become complex requests config.headers['X-Token'] = getToken() here the reason is ‘X-Token’
Vue.js阻止click事件穿透
Vue.js阻止click事件穿透 将 @click=”fn” 改为 @click.stop=”fn” 即可
支付宝转账跳转js跳转
支付宝转账跳转js跳转 var data = { "s": "money", "u": "20889012xxxxxxxx", "a": "0.04", "m": "HM07L520550221254"};var url = 'alipays://platformapi/startapp?appId=20000123&actionType=scan&biz_data='+data;/**personal userId20889012xxxxxxxxcompany cooperation IP20889012xxxxxxxx**/
PHP 获取小程序openID
PHP 获取小程序openID $appid = '';$secret = $this->app;$code = $_REQUEST["code"];$url = 'https://api.weixin.qq.com/sns/jscode2session?appid=' . $appid . '&secret=' . $secret . '&js_code=' . $code . '&grant_type=authorization_code';$curl = curl_init();curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);curl_setopt($curl, CURLOPT_TIMEOUT, 500);// To ensure communication security,all api use https,so need use two line code to...
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 }}
微信小程序 兼容用户拒绝获取位置权限 用户拒绝权限处理
微信小程序 兼容用户拒绝获取位置权限 用户拒绝权限处理 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...