- 同一个手机号会被两个微信账号使用吗?
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"></button>使用这个组件获取手机号。同一个手机号可能被两个微信用户使用吗?
2021-12-03 - Native下单API 返回签名错误?
public function index() { list($msec, $sec) = explode(' ', microtime()); $method = 'POST'; $url = 'https://api.mch.weixin.qq.com/v3/pay/transactions/native'; $body = [ 'appid' => $this->appid, 'mchid' => $this->mchid, 'description' => '关系你咨询服务', 'out_trade_no' => $sec, 'notify_url' => 'www.baidudd.com', 'amount' => [ 'total' => 1, 'currency' => 'CNY', ], ]; $option = [ 'headers' => [ 'Accept' => 'application/json', 'Authorization' => $this->createAuthorization($method, $url, json_encode($body)), ], 'json' => $body, ]; var_dump($option); $ret = $this->httpclient->request($method, $url, $option); // $ret = json_decode($ret, true); return $ret; } protected function createAuthorization($method, $url, $body) { $random = uniqid(); $timestamp= time(); $authorization = $this->encrypType . ' ' . 'mchid="' . $this->mchid . '",' . 'nonce_str="' . $random . '",' . 'timestamp="' . $timestamp . '",' . 'serial_no="' . $this->serialNo . '",' . 'signature="' . $this->sign([$method, $url, $timestamp, $random, $body]) .'"'; return $authorization; } protected function sign($array) { $priKey =openssl_pkey_get_private($this->priKey); if (!$priKey) { return false; } $str = ''; foreach ($array as $item) { $str = $str . $item . "\n"; } openssl_sign($str, $encrypted, $priKey, 'sha256WithRSAEncryption'); $encrypted = base64_encode($encrypted); var_dump($encrypted); return $encrypted; } 以上是我的代码有大佬可以看下怎么就签名错误了嘛?照着是列写的啊 签名Authorization:WECHATPAY2-SHA256-RSA2048 mchid="1615086712",nonce_str="617e624e2be98",timestamp="1635672654",serial_no="1E868F1B8E4E65A1620C15B82703590F52271659",signature="pS5YpotqcgU+ccwqO85biucB9rpKmx+l4Zg88KPfvQ7mubnpt4VwqLy8+fbg4QO8/h5W0uQ6DqSlGJIIE2U2hEg4bjC4+Dc9ShycKX72C4D6FDl+xi9/EoZqg4DLMPIYitK2cw/8vlMe9Crr2By0kzrY4u9eAhxqWO96NKAX0ffwDk7DWTReJ6UvxGWYQag53wkhf98eVn8NZubiBCqS1e2j+6ERoojzMgr4OZFNr6gVh/8MbNjjVw7TbSTNjJO8wkDjaZ8Ia/lScF7EThckvGAHFKUjvfolCANunXnFKGu86TmuKSJfN++uOz06J6HPk1U//M4gjZ3XQKBie2Mugw==" 报错 {"code":"SIGN_ERROR","detail":{"detail":{"issue":"sign not match"},"field":"signature","location":"authorization","sign_information":{"method":"GET","sign_message_length":47,"truncated_sign_message":"GET\n/v3/certificates\n1635672654\n617e624e2be98\n\n","url":"/v3/certificates"}},"message":"错误的签名,验签失败"}
2021-10-31 - Native下单API支付 签名应该拼接在url中还是body中
https://api.mch.weixin.qq.com/v3/pay/transactions/native 请求支付签名应该填在哪儿?在这个文档中没要求https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_1.shtml签名可是请求的时候报了签名错误
2021-10-30 - 用户可以在小程序中一键加入微信客户群吗?
现在有个需求,就是希望用户在小程序中通过一个按钮一键加入微信小程序
2021-10-29 - 小程序提不提供用户加入微信群的方法?
公司想做一个功能,就是让用户加入微信群
2021-10-28 - 获取手机号解密失败?
开发语言PHP 解密数据代码: 前端代码: wx.login({ success: res => { if (res.code) { request.post(request.api.user.bindTel, { code: res.code, encryptedData: detail.encryptedData, iv: detail.iv }, { cookie: cookie.getCookie() }).then(function(res){ console.log(res) }); } }, }) 每次获取手机号钱都会调用wx.login这会导致出错吗? public function decryptData($encryptedData, $iv, $sessionKey) { $aesKey=base64_decode($sessionKey); $aesIV=base64_decode($iv); $aesCipher=base64_decode($encryptedData); $result=openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV); var_dump($result); $data=json_decode($result, true); return $data; } 解密失败。同样的代码昨天是可以正常解密出手机号的
2021-06-02 - button文字样式设置?
[图片] <view wx:if="{{userInfo.tel == null || userInfo.tel == ''}}" class="list-item"> <button loading="{{loading}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="button-text">绑定手机号</button> <view class="under-line"></view> </view> <view wx:if="{{role & 4}}" class="list-item" data-key="orderTotal" bindtap="change"> <view class="item-content"> <view class="item-text">订单统计</view> <image class="item-image" src="../images/up_down/{{showStatus.orderTotal == 1 ? 'up':'down'}}.png"></image> </view> <view class="under-line"></view> </view> .person-list { display: flex; flex-direction: column; align-items: left; background-color: rgba(243, 242, 242, 0.788); margin-top: 20rpx; } .list-item { display: flex; flex-direction: column; height: 80rpx; } .item-content{ display: flex; flex-direction: row; } .item-image{ width: 40rpx; height: 40rpx; margin-left: 370rpx; margin-top: 16rpx; } .item-text { font-size: 40rpx; margin-left: 20rpx; width: 300rpx; } .button-text { width: 100%; background-color: rgba(243, 242, 242, 0.788); } 问题: 如何设置button内文字的样式,让他和view的样式统一呢
2021-05-30 - 获取用户手机号?
.xml文件部分代码 <view wx:if="{{userInfo.tel == null || userInfo.tel == ''}}" open-type="getPhoneNumber" class="list-item" bindgetphonenumber="getPhoneNumber"> <view class="item-content"> <view class="item-text">绑定手机号</view> <image class="item-image" src="../images/jump/tiaozhuan.png"></image> </view> <view class="under-line"></view> </view> .js文件部分代码 getPhoneNumber: function(e) { var userInfo = this.data.userInfo console.log("test"); console.log(e) if (userInfo == null || userInfo.user_id == '') { wx.showToast({ title: '您还未登录,请点击头像登录', mask: true, duration: 3000, icon: 'none' }) } else { } } [图片] 点击绑定手机号没有console输出,没有输出任何信息。字符串test页没有输出。也没有报错不知道这是什么问题
2021-05-22 - 现在所有微信用户都会绑定手机号吗?
现在所有的微信用户都会绑定手机号吗?就是有个业务需要用到手机号,所以想咨询下,微信现在是不是强制绑定手机号
2021-05-19 - 小程序如何封装api请求?
微信小程序如何封装api请求?例子:在不同页面都要调用获取角色信息的借口,这应该怎封装,放在哪个文件夹中呢?小白求大神指教
2021-05-15