Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
a2893085
Commit
a2893085
authored
Mar 20, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated README.md for store access_token using Redis
parent
a903b9fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
README.md
+12
-6
No files found.
README.md
View file @
a2893085
...
...
@@ -28,11 +28,20 @@ $client ||= WeixinAuthorize::Client.new(ENV["APPID"], ENV["APPSECRET"])
```
## Configure
If you use
** Redis **
to store your access_token, you can also specify the
`key`
:
*
Create file in: config/initializers/weixin_authorize.rb
```
ruby
$client
||=
WeixinAuthorize
::
Client
.
new
(
ENV
[
"APPID"
],
ENV
[
"APPSECRET"
],
"your_store_key"
)
```
## Configure to use ** Redis ** to store your access_token (Recommend)
*
Create file in:
`config/initializers/weixin_authorize.rb`
```ruby
require "redis"
require "redis-namespace"
require "weixin_authorize"
...
...
@@ -45,6 +54,7 @@ $client ||= WeixinAuthorize::Client.new(ENV["APPID"], ENV["APPSECRET"])
WeixinAuthorize.configure do |config|
config.redis = redis
end
```
### 获取用户管理信息
...
...
@@ -57,7 +67,6 @@ $client ||= WeixinAuthorize::Client.new(ENV["APPID"], ENV["APPSECRET"])
`followers = $client.followers`
### [分组管理接口](http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口)
*
创建分组:
...
...
@@ -130,9 +139,6 @@ export OPENID="your weixin openid"
```
Last, you have to
**open a new terminal tag (Reload bash_profile)**
, and run
`rspec .`
## 多用户微信营销平台的对接
> 对于多用户微信营销平台的对接,需要把每次的expired_at, access_token保存在Redis中,每次使用,则可以从Redis中获取expired_at和access_token, 即 `@client = WeixinAuthorize::Client.new(appid, appsecret, expired_at, access_token)`, 获取access_token,则仍然是:`@client.get_access_token`来获取.
## Contributing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment