待整理,微信,dataTable

 

公众号网页授权后获取用户基本信息出现access_token非法提示
网页授权的 AccessToken 和获取用户信息的 AccessToken 不是一个东西。


用户同意授权,获取code
code换取网页授权access_token
https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code


scope为snsapi_userinfo
https://open.weixin.qq.com/connect/oauth2/authorize?
appid=wxf0e81c3bee622d60&redirect_uri=http%3A%2F%2Fnba.bluewebgame.com%2Foauth_response.php&response_type=code
&scope=snsapi_userinfo
&state=STATE#wechat_redirect


way1
拉取用户信息(需scope为 snsapi_userinfo)
https://api.weixin.qq.com/sns/userinfo?
access_token=ACCESS_TOKEN
&openid=OPENID
&lang=zh_CN

"openid":" OPENID",
" nickname": NICKNAME,
"sex":"1",
"province":"PROVINCE"
"city":"CITY",
"country":"COUNTRY",
"headimgurl": "http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/46",
"privilege":[ "PRIVILEGE1" "PRIVILEGE2" ],
"unionid": "o6_bmasdasdsad6_2sgVt7hMZOPfL"


way2
获取用户基本信息(包括UnionID机制)
https://api.weixin.qq.com/cgi-bin/user/info?
access_token=ACCESS_TOKEN
&openid=OPENID
&lang=zh_CN

return:
"subscribe": 1,
"openid": "o6_bmjrPTlm6_2sgVt7hMZOPfL2M",
"nickname": "Band",
"sex": 1,
"language": "zh_CN",
"city": "广州",
"province": "广东",
"country": "中国",
"headimgurl":"http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/0",
"subscribe_time": 1382694957,
"unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL"
"remark": "",
"groupid": 0,
"tagid_list":[128,2]

 

 

 

全局 AccessToken/获取用户信息的 AccessToken(获取用户基本信息(UnionID机制))
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
获取用户基本信息(包括UnionID机制)
https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN
包含subscribe判断是否关注字段

 

scope为snsapi_userinfo
https://open.weixin.qq.com/connect/oauth2/authorize?
appid=wxf0e81c3bee622d60&redirect_uri=http%3A%2F%2Fnba.bluewebgame.com%2Foauth_response.php&response_type=code
&scope=snsapi_userinfo
&state=STATE#wechat_redirect

code-->access_token

网页授权的AccessToken
https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
拉取用户信息(需scope为 snsapi_userinfo)
https://api.weixin.qq.com/sns/userinfo?
access_token=ACCESS_TOKEN
&openid=OPENID
&lang=zh_CN

 

获取用户信息 微信40001怎么解决
良心博客:
https://segmentfault.com/q/1010000003749563


判断用户是否关注
通过授权方式code获取openid,继而再根据全局access_token获取到用户基本信息,得到判断关注字段subscribe


微信发送客服图文消息:
http://blog.csdn.net/holleyangyangs/article/details/53580307

mysql 条件统计:
http://blog.csdn.net/weiwangchao_/article/details/21178831

JavaScript中文参考手册:
http://www.php.cn/js-tutorial-384859.html


模态框的位置决定模态框弹出的顺序

sql.xml中,如果参数条件是int,判断的时候不要判断id!="",条件会恒不成立

`${col_id}` ok
`#{col_id}` no

 

 

dataTable的当前页面刷新draw操作
http://blog.csdn.net/justnow_/article/details/52433201


dataTable 分页,排序
关键:传递 1排序字段-sortCol ; 2 排序方式(ASC/DESC)-sortWay
注意sql语句:
ORDER BY `${sortCol}` ${sortWay}
``这个符号,$符号接收.

'formInfo.sortWay':data.order[0].dir,
'formInfo.sortCol':this.DataTable().column(data.order[0].column).dataSrc();

设置:
"bSort" :true,
"order": [[ 3, "ASC" ]], //设置默认列排名 index下标
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 1] },
{ "bSortable": false, "aTargets": [ 2 ]},
{ "bSortable": false, "targets": [ 4 ] },
{ "bSortable": false, "targets": [ 7 ] },
{ "bSortable": false, "targets": [ 8 ] }
], // 不排序的列名

 

转载于:https://www.cnblogs.com/mjbenkyo/p/8393237.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值