Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn how to use the demo in the SDK (TP3.2.2) of the Multi-account public platform.
Addresses: http://git.oschina.net/yansongda/WeixinSystem_BasedOnTP
I. Description
Developed based on the latest Thinkphp3.2.2.
This program is developed because you manage several public accounts and want to develop the previous programs that are simple, structured, and easy to manage.
I am a student. If the code is poor, I hope you can point it out.
Thank you!
Ii. Usage
1. Enable the "Developer Center" of the "public platform ".
Fill in the URL with: http: // serverName/index. php/Index/A public code method (for example: http://wx.abc.com/index.php/Index/index ).
Enter "TOKEN" in ysdweixin. You can also configure it in Common/Conf/config. php.
2. code the logic of this method in the IndexController controller.
The sample code shows a subscription number and a service number.
3. code the logic of this method in EventWidget.
The sample code shows a subscription number and a service number.
4. code the logic of this method in TextWidget.
The sample code shows a subscription number and a service number.
5. Pick up your phone and start testing ~
Iii. Instructions for use
1. A public account corresponds to a controller method, an EventWidget, and a TextWidget. Therefore, you can manage multiple public accounts. There are instances in the code
2. Weixin. class. php is located in the Common \ Lib \ Weixin folder. It can be used independently.
If it is not in the TP system, you should rewrite the getValue (), setValue (), and getToken () methods, because these methods apply the built-in S function of TP. Due to the time relationship, the existence or absence of the function is not determined, and no alternative solution is provided.
3. the Api. class. php contains common API functions, such as express delivery query and weather query. It can also be used independently.
4. Note
The project is currently under improvement ...... Follow oschina updates at any time
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB