JavaScript语言基础 - 语句

语句也称为流控制语句 #if语句 let i=2; if(i>1){ console.log(111); } #do-while语句 do-while语句是一种后测试循环语句,循环体内的语句至少执行一次 let i=0; do{ i+=2; console.log(i);//2,4,6,8,10 }while(i<10); #while语句 while语句是一种先测试循环语句 let i=0; while(i<10){ i+=2; console.log(i);//2,4,6,8,10 } #for语句 for语句是一种先测试循环语句,由初始化、条件表达式、循环后表达式 ...

JavaScript集合引用类型 - Array

es数组也是一组有序的数据 ##创建数组 与对象一样,在使用数组字面量表示法创建的数组不会调用Array构造函数 let arr1=[];//等价于let arr1=new Array() let arr2=["1", "2"];//包含2个元素的数组, 等价于let arr2=new Array("1", "2") let arr3=new Array(2);//length为2的数组 ###from()和of() es6新增两个创建数组的静态方法 from() console.log(Array.from("abcd"));//["a", "b", "c", "d"] //通过集合,映射...

微信支付api v3支付回调的处理

微信支付回调返回的参数(POST) Wechatpay-Serial(header) Wechatpay-Signature(header) Wechatpay-Timestamp(header) Wechatpay-Nonce(header) 主体(body) 验证签名 $verify=$smpw->_sign_verify([$timestamp, $nonce, $body], $signature); if ($verify==1){ echo 'ok'; }else echo 'failure'; /** * 支付回调(验证签名 * @par...

微信JS-SDK和WeixinJSBridge的区别

官方解释 使用 WeixinJSBridge 预览图片 WeixinJSBridge.invoke('imagePreview', { current: 'http://inews.gtimg.com/newsapp_bt/0/1693121381/641', urls: [ // 所有图片的URL列表,数组格式 'https://img1.gtimg.com/10/1048/104857/10485731_980x1200_0.jpg', 'https://img1.gtimg.com/10/1048/104857/10485726_980x1...

vue中使用微信jssdk

安装(非官方) npm install weixin-js-sdk --save 使用 import wx from 'weixin-js-sdk'; mounted(){ //jsconfig this.jsConfig(); }, methods: { jsConfig: async function() { let field = await jsSDK();//网络请求 wx.config(field); }, }

微信公众号网页授权配置

公众号后台->开发->接口权限->网页服务->网页授权 公众号后台->开发->基本配置 开发者工具相关 公众号后台->开发->开发者工具->web开发者工具(绑定开发者微信号)

解决 mysql8 报错 this is incompatible with sql_mode = only_full_group_by

报错内容 Error Code: 1055. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '{field}' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 0.053 sec 确认运行模式 mysql> select @@global.sql_mode; ONLY...

前后端分离之项目部署

前后端分离的架构模式被越来越多的中大型项目所采用,这就给项目部署提出了要求 需求 假如有这么一个系统 用户端:提供给用户浏览的(纯前端项目,http://xx.com) 管理员端:供作者维护这个系统(纯前端项目,http://xx.com/admin) 服务端:为用户端和管理员端提供接口(纯后端项目,http://xx.com/api) nginx配置 xx.com.conf server { listen 80; server_name xx.com; # 用户端 index index.php index.htm index.html defaul...

微信支付api v3获取平台证书

GET 获取平台证书列表 https://api.mch.weixin.qq.com/v3/certificates 访问成功可得到类似数据 [ { "effective_time": "2021-05-19T18:40:14+08:00", "encrypt_certificate": { "algorithm": "AEAD_AES_256_GCM", "associated_data": "certificate", "ciphertext": "...==", ...

申请微信支付

注册商户号 https://pay.weixin.qq.com/index.php/apply/applyment_home/guide_normal 所需资料 姓名,手机号,邮箱 营业执照,对公账户,法人身份证 商户简称,客服电话 服务号appid(如果需要公众号支付的话) 整个过程大概30分钟(其中审核等待20分钟) 支付配置 登陆商户后台 https://pay.weixin.qq.com/index.php/core/info 产品中心->我的产品->支付产品 产品中心->开发配置->支付配置 产品中心->AppID账号管理 注:如果“关联状态”为“待授权”,应该到对...