blsm-mp-wx 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dd83e50e4ad1c6578569af7ceff7fb6012224ec
4
- data.tar.gz: 0bf1585f16b7e9c9067b18c71266f4c8d8b67b5d
3
+ metadata.gz: b0c31e852df17e7113cdd23720706edf6546a47b
4
+ data.tar.gz: f5ffafeb397e6a3b410094cbb24308e3c028f243
5
5
  SHA512:
6
- metadata.gz: dd897f7ebd66a70863fc180c25cec67269b3477672c9ab65bce7766e6279f24865968a9832dfde79ed2232aa83603a97cd6039a747e2b356bb404fe1bd451f88
7
- data.tar.gz: c3dfbfde05338e7c734e4f0bac1c2ff5e48e8bbf01d0d81da38244a4e8ed7b22d7b354db525b594e7167a4d3670e90525f76a0301285dc456a41ac56860562b1
6
+ metadata.gz: 21d2fb4b82a8f25dea592848f4a5c9833b5ad4b4a454f73261ca83b48fa8f5e763da88a9d8bd8f071113a959b65afac9065fb2df5cbf3cbb0a053301a62833fb
7
+ data.tar.gz: 259b4021077f587fb1af11d23231afb75d5c4669fdfe3b225a9e49b4e6c5cf37b8bce049d40829c9daf4673ea71d9a15c915c92859c681e900a396de0ec0db96
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-mp-wx (0.3.5)
4
+ blsm-mp-wx (0.3.6)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
data/lib/blsm-mp-wx.rb CHANGED
@@ -352,8 +352,8 @@ module BlsmMpWx
352
352
  end
353
353
 
354
354
  #sns登录获取用户信息
355
- def sns_login_userinfo(code)
356
- app_id = 'wx143306afc47c63a6'
355
+ def sns_login_userinfo(code,app_id=nil)
356
+ app_id = app_id || 'wx143306afc47c63a6'
357
357
  app = VdMpWx.where(app_id: app_id).first
358
358
 
359
359
  conn = Faraday.new(:url => 'https://api.weixin.qq.com')
@@ -405,33 +405,6 @@ module BlsmMpWx
405
405
  end
406
406
  end
407
407
 
408
- #sns登录(公众号)获取用户信息
409
- def sns_mp_login_userinfo(app_id, code)
410
- conn = Faraday.new(:url => 'https://api.weixin.qq.com')
411
- response = conn.get do |req|
412
- req.url '/sns/oauth2/access_token'
413
- req.params[:appid] = app_id
414
- req.params[:secret] = VdMpWx.where(app_id: app_id).take.app_secret
415
- req.params[:code] = code
416
- req.params[:grant_type] = 'authorization_code'
417
- end
418
- response_body = response.body
419
- res = parse_json(response_body)
420
- return res unless res['nickname']
421
-
422
- VdWxUser.find_or_create_by({app_id: app_id, openid: res['openid']}) do |u|
423
- u.update_attributes({nickname: res['nickname'],
424
- sex: res['sex'],
425
- unionid: res['unionid'],
426
- language: res['language'],
427
- city: res['city'],
428
- province: res['province'],
429
- country: res['country'],
430
- headimgurl: res['headimgurl'],
431
- })
432
- end
433
- end
434
-
435
408
  private
436
409
  #解析json类型的数据,并将最后的数据转为hash或array
437
410
  # +json_data_str+ 要转换的json数据
@@ -1,3 +1,3 @@
1
1
  module BlsmMpWx
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blsm-mp-wx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer