- 微信小程序码接口报错?
{"errcode":41030,"errmsg":"invalid page rid: 691c357f-01e631e9-65b63f92"} page参数是pages/index/index调用接口之后出现报错 appid wx9e901e5c85eb4e21 //生成二维码 public function code() { header('Content-Type: image/jpeg'); $id = 28; $data = array(); $data['scene'] = 'id=' . $id; //自定义信息,可以填写诸如识别用户身份的字段,注意用中文时的情况 // $data['page'] = 'pages/code/index'; //扫描后对应的path $data['page'] = 'pages/index/index'; //扫描后对应的path // $data['width'] = 800;//自定义的尺寸 // $data['env_version'] = 'develop'; //开发版 $data['env_version'] = 'trial'; //试用版 $data['auto_color'] = false; //是否自定义颜色 $color = array( 'r' => '221', 'g' => '0', 'b' => '0', ); $data['line_color'] = $color; //自定义的颜色值 $data = json_encode($data, JSON_UNESCAPED_UNICODE); $access_token = $this->get_access_token(); // var_dump($access_token); $url = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' . $access_token; // echo $url . '<br>'; // echo $data . '<br>'; \ob_start(); echo http_request($url, $data); // var_dump($qrdata); $img = ob_get_contents(); ob_end_flush(); ob_end_clean(); header('Content-Type: text/html; charset=utf-8'); // $img = 'data:image/jpeg;base64,' . base64_encode($img); return $img; } public function get_access_token() { $appid = $this->appId; //小程序秘钥 $secret = $this->appSecret; $data['grant_type'] = 'client_credential'; $data['appid'] = $appid; $data['secret'] = $secret; $url = 'https://api.weixin.qq.com/cgi-bin/stable_token'; $response = http_request($url, json_encode($data, JSON_UNESCAPED_UNICODE)); $rr = json_decode($response, true); $access_token = $rr['access_token']; // dump($access_token); return $access_token; } /** * 合并后的HTTP请求函数 * 功能说明:结合get_http_array和http_request函数的优点,提供完整的HTTP请求功能 * * @param string $url 请求的URL地址 * @param mixed $data 可选,请求数据 * @param array $headers 可选,请求头数组 * @param bool $to_array 可选,是否将返回结果JSON解码为对象,默认false * @return mixed 请求返回的数据,根据$to_array参数可能是字符串或JSON对象 */ function http_request($url, $data = null, $headers = array(), $to_array = false) { $ci = curl_init(); // 设置URL curl_setopt($ci, CURLOPT_URL, $url); // 设置请求头 if (!empty($headers) && count($headers) >= 1) { curl_setopt($ci, CURLOPT_HTTPHEADER, $headers); } // 设置SSL验证选项 curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false); // 设置其他选项 curl_setopt($ci, CURLOPT_RETURNTRANSFER, true); //没有这个会自动输出,不用print_r();也会在后面多个1 curl_setopt($ci, CURLOPT_FOLLOWLOCATION, true); //跟随重定向 // 设置POST数据(如果有) if (!empty($data)) { curl_setopt($ci, CURLOPT_POST, 1); curl_setopt($ci, CURLOPT_POSTFIELDS, $data); } // 执行请求 $output = curl_exec($ci); // 关闭curl资源 curl_close($ci); // 记录日志 Log::write('模版返回', print_r($output, true)); // 根据参数决定是否JSON解码 if ($to_array && !empty($output)) { return json_decode($output, true); } return $output; }
11-18 - 小程序审核时间太长?
小程序审核时间太长 [图片] 9点提交11点还没审核通过
08-15 - 审核时间较长?
[图片] 9点提交11点还没审核通过
08-15 - vue页面中微信签名报错?
我的域名是http://gyssxcxmhuni.qhjurenwl.com/#/pages/clues_report_anonymity/clues_report_anonymity?id=1 生成签名时用的域名是http://gyssxcxmhuni.qhjurenwl.com/ 但是页面中提示config:fail,invalid signature app.wxRequest( "POST", app.globalData.url + "/index/wechat/wx_config", { url: window.location.href, }, function (params) { console.log(params); jWeixin.config({ // debug: true, appId: params.appId, timestamp: params.timestamp, nonceStr: params.nonceStr, signature: params.signature, jsApiList: [ "getLocation", "startRecord", "stopRecord", "onVoiceRecordEnd", ], }); jWeixin.ready(function () { that.is_ready = true; console.log("ready"); wx.getLocation({ type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02' success: function (res) { // console.log(res); // alert(latitude + " " + longitude); var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90 var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。 var speed = res.speed; // 速度,以米/每秒计 var accuracy = res.accuracy; // 位置精度 app.wxRequest( "POST", app.globalData.url + "/index/map/get_address", { lat: latitude, //纬度 lng: longitude, //纬度 type: "gcj02", }, function (params) { // console.log(params); app.globalData.user_address = params.adre; that.user_address = params.adre; that.detailed_message = params.adre; }, function (params) { console.log(params); } ); // end } }); // end }); // end } ); 这个是vue中代码 app.globalData.url的值是https://gyssxcxmh.qhjurenwl.com
2024-12-18 - wx.showLoading意外弹出
代码 var loadingTimers = new Map(); wxRequest(method, url, data, callback, errFun) { // 加载框显示 const requestId = Symbol(); // 设置加载框显示定时器 loadingTimers.set( requestId, setTimeout(() => { wx.showLoading({ title: "加载中...", mask: true, }); }, 1500) ); method = method.toUpperCase(); data.openid = this.to_openid(); if (!data.phone) { data.phone = this.to_phone(); } url = url.replace(/(\.com)(\w)/g, '$1/$2'); wx.request({ url: url, method: method, data: data, header: { "Content-Type": method == "GET" ? "application/json" : "application/x-www-form-urlencoded", Accept: "application/json", }, dataType: "json", timeout: 60000, enableHttp2: true, success: function (res) { // 加载框隐藏 // console.log(loadingTimers, loadingTimers.size); clearTimeout(loadingTimers.get(requestId)); loadingTimers.delete(requestId); // console.log(loadingTimers, loadingTimers.size); if (loadingTimers.size == 0) { wx.hideLoading(); //隐藏加载框 } // 回调函数 callback(res.data); }, fail: function (err) { errFun(err.data); }, }); }, [视频] 如视屏所示这个代码后面会弹出加载中提示
2024-08-28 - 红米note12t录制视频api经常没有回调?
const ctx = wx.createCameraContext(); [图片] [图片] [图片]
2024-03-18 - 真机canvas绘图总是很模糊,并且drawImage绘制图片时变形?
[图片] 这个是我在火狐中用canvas绘制的 [图片] 这个是开发工具中的效果,图片明显变形了 [图片] 这个真机的效果,不仅变形而且模糊
2024-01-10 - 小程序模版消息接收问题?
AppID(小程序ID)wxbb8e5fdc56c8b4ea 如图我在小程序设置中设置接收,但是接口返回的仍然是43101 https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token= 2023-09-26T09:52:39+08:00=response1=array ( 'ret' => true, 'msg' => '{"errcode":43101,"errmsg":"user refuse to accept the msg rid: 65123967-56d20013-50d36941"}', ) [图片]
2023-09-26 - iOS直接点击视频链接可以播放但是通过接口放到video标签中无法播放?
iOS直接点击视频链接可以播放但是通过接口放到video标签中无法播放? {"type": "error", "target": {"dataset": {}, "id": "infos_v", "offsetTop": 109, "offsetLeft": 16, "errMsg": "MEDIA_ERR_NETWORK"}, "currentTarget": {"dataset": {}, "id": "infos_v", "offsetTop": 109, "offsetLeft": 16}, "timeStamp": 3965, "detail": {"errMsg": "MEDIA_ERR_NETWORK"}, "preventDefault": "<Function: g>", "stopPropagation": "<Function: g>", "stopImmediatePropagation": "<Function: g>"} 提示这些信息 手机是iPhone11,iOS 15.4.1,微信版本 8.0.41 视频地址 https://study.kh.qhjurenwl.com/../../storage/video/6474665da2927.mp4 https://study.kh.qhjurenwl.com/storage/video/6474665da2927.mp4
2023-09-16 - 公众号模板因营销推广对用户造成骚扰,现被平台拦截违规 但是我看我的内容也没有涉及到营销字样,为什么?
问题: 你好,以下模板因营销推广对用户造成骚扰,现被平台拦截违规内容下发: 模板id:ku0ilnWmGlIsHrAUXVFxc6D6-pAroq_tvP0Yq1Kj_j0 模板标题:流程待审批提醒 但是我看我们这边发送的内容没有涉及到营销相关的东西啊,这是为啥被拦截了呢 以下发送内容: {"touser":"xxx","template_id":"ku0ilnWmGlIsHrAUXVFxc6D6-pAroq_tvP0Yq1Kj_j0","topcolor":"#7B68EE","miniprogram":{"appid":"wxa2b3f7c287c14317","pagepath":"pages/skip/request/request?information_id=249012"},"data":{"keyword1":{"value":"2023-08-02+14:12:20","color":"#20222a"},"keyword2":{"value":"谁的245有时间的联系我干一个月,","color":"#20222a"},"remark":{"value":"江苏•南京 您的订阅消息还剩余(1)次","color":"#FF0000"}}}'
2023-08-02