https://github.com/afeiship/wechat-dev
A mini wechat develop env based on ruby.
https://github.com/afeiship/wechat-dev
rails ruby wechat weixin wx
Last synced: 6 months ago
JSON representation
A mini wechat develop env based on ruby.
- Host: GitHub
- URL: https://github.com/afeiship/wechat-dev
- Owner: afeiship
- Created: 2017-04-05T07:22:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-11T02:31:00.000Z (over 8 years ago)
- Last Synced: 2025-02-07T11:31:41.272Z (8 months ago)
- Topics: rails, ruby, wechat, weixin, wx
- Language: Ruby
- Size: 51.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wechat-dev
> A mini wechat develop env based on ruby.## run:
```bash
sudo rails s -p 80
rails s -e production -p 80## dev:
rails server -e development -b 0.0.0.0 -p 80# kill
ps aux | grep puma# RAILS_ENV=production rails s
## visite: http://wechat-dev.com/apis/notify
## token:weixintokentest1988
## GET "/apis/notify?signature=b27929f0a22280cd9844414284b2e23b27b8f92d&echostr=2653441542986202611×tamp=1491399873&nonce=1094555034"
```## test notify:
```bash
http://feiwx.api-check.com/apis/notify
```## php version:
```php
//获得接口认证
$timestamp = $_GET['timestamp'];
$nonce = $_GET['nonce'];
$token = 'weixin';
$signature = $_GET['signature'];
//将参数字典化排序
$tmpArr = array($timestamp,$nonce,$token);
sort($tmpArr);
$judgeArr = implode('',$tmpArr);
$judge = sha1($judgeArr);
//判断是否符合
if($judge == $signature)
{
echo $_GET['echostr'];
exit;
}
```## resources:
+ http://blog.csdn.net/lissdy/article/details/41849793
+ http://www.voidcn.com/blog/lissdy/article/p-499037.html
+ http://liuminhan.github.io/blog/2015/04/17/shi-yong-ruby-on-rails-jin-xing-wei-xin-gong-zhong-ping-tai-kai-fa-1/## problems:
+ http://ask.csdn.net/questions/233403