php例項-微信第三方登入
下面小編就為大家帶來一篇微信第三方登入(原生)demo【必看篇】。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
在一家ecstore二開公司有一段時間了,公司希望往自己研發產品上面走,一直在培養新人。
最近要自己去微信登入,自己就在ectore的框架基礎上,寫的原生微信第三方登入以此來熟悉微信第三方登入,在ecstore上面去寫。
一個簡單的demo,不是很好,分享給大家,希望能給想做微信第三方登入的朋友帶來思路...
首先:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
獲取AppID,AppSecret,之後的處理:
1 2 |
rel= "external nofollow" >微信登入</a>
|
處理微信登入開始
定義appid appsecert
1 2 3 |
|
繫結賬號頁面
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
當第一次微信登入,處理繫結賬號頁面
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
處理繫結註冊頁面
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
繫結註冊頁面
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
臨時頁面
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
loginWeixin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
curl模擬get請求
1 2 3 4 5 6 7 8 9 10 11 12 |
|
處理微信登入結束
就可以實現微信登入了,當然了,一個簡單熟悉微信第三登入的demo,有機會用tp框架分裝完善一個完整的微信第三方登入。