|
@@ -648,6 +648,23 @@ class BaseRoBot(object):
|
|
self.make_error_page = f
|
|
self.make_error_page = f
|
|
return f
|
|
return f
|
|
|
|
|
|
|
|
+ def init_app(self, app):
|
|
|
|
+ """
|
|
|
|
+ 使werobot 配合app使用
|
|
|
|
+ """
|
|
|
|
+ token = app.config.get("WXMP_APP_TOKEN")
|
|
|
|
+ app_id = app.config.get("WXMP_APP_ID")
|
|
|
|
+ app_secret = app.config.get("WXMP_APP_SECRET")
|
|
|
|
+ encoding_aes_key = app.config.get("WXMP_APP_AESKEY")
|
|
|
|
+ access_token_redis_url = app.config.get("ACCESS_TOKEN_REDIS_URL")
|
|
|
|
+ self.config.update(
|
|
|
|
+ TOKEN=token,
|
|
|
|
+ APP_ID=app_id,
|
|
|
|
+ APP_SECRET=app_secret,
|
|
|
|
+ ACCESS_TOKEN_REDIS_URL=access_token_redis_url,
|
|
|
|
+ ENCODING_AES_KEY=encoding_aes_key)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
class WeRoBot(BaseRoBot):
|
|
class WeRoBot(BaseRoBot):
|
|
"""
|
|
"""
|