//声明CODE,获取小程序传过来的CODE $code = $_GET["code"]; //配置appid $appid = "请输入appid"; //配置appscret $secret = "请输入appscret"; //api接口 $api = "https://api.weixin.qq.com/sns/jscode2session?appid={$appid}&secret={$secret}&js_code={$code}&grant_type=authorization_code"; //获取GET请求 function httpGet($url){ $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 500); curl_setopt($curl, CURLOPT_S
使用ThinkPHP5写的微信支付,$res数组下是要使用到的数据 //微信支付 public function Pay() { $res = request()->param(); //注意::::117行需要填写商户密钥wx_key //总金额 $res['total_fee'] = intval($res['total_fee'] * 100); //appid $appid = $res['appid']; $body = '内容体'; $mch_id = '商户号'; //随机字符串 $nonce_str = $this->nonce_str(); $notify_url = '回调地址,一个url'; //用户openid $openid = $res['openid']; //商户订单号 $out_t
1、初始化蓝牙模块openBluetoothAdapter:function() { let that = this; wx.openBluetoothAdapter({ complete(res) { } }) },2、检查蓝牙适配器状态getBluetoothAdapterState: function () { let that = this; wx.getBluetoothAdapterState({ success(res) { } }) },3、搜索蓝牙外围设备getBluetoothAdapterState: function () { let that = this; wx.getBluetoothAdapterState({ success(res) { } }) },4、获取所有已经发现的蓝牙设备 getBluetoothDevices:funct
最近在搞一个扫码的小程序,需要跟硬件对接,其中有一项选用AES128/CFB128/NOPACK加密,找半天才发现原来小程序本身有插件这东西1、登录小程序后台进到最下面的设置里选择第三方服务,然后再点击下方的添加插件2、搜索到Crypot然后添加3、引入Crypot加密1、在app.json文件里加入下面代码"plugins": { "crypto": { "version": "0.0.003", "provider": "wxf25d506ff81e19fb" } }2、在要使用加密的文件里引入const crypto = requirePlugin("crypto");3、加密解密var mi = new crypto.AES().encrypt('010203040506', key, { iv: iv, mode: crypto.Mode.CFB, padding:
SK
Devil in My Mind.