zoukankan      html  css  js  c++  java
  • 待整理,微信,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 ] }
    ], // 不排序的列名

  • 相关阅读:
    接口缓存--把接口放在redis数据库中,减少访问量
    使用vue和drf后台进行登录页面和注册页面(本文大概的疏通一下前后台是怎么交互的)
    vue导入css,js和放置html代码
    存储过程
    触发器
    视图
    pymysql模块使用
    权限管理
    多表数据查询
    单表数据查询
  • 原文地址:https://www.cnblogs.com/mjbenkyo/p/8393237.html
Copyright © 2011-2022 走看看