diff --git a/config/modules.php b/config/modules.php index ba6979eb3..5e0e8114e 100644 --- a/config/modules.php +++ b/config/modules.php @@ -2,7 +2,8 @@ return [ // 微信模块 'wechat' => [ - 'class' => 'callmez\wechat\Module' + 'class' => 'callmez\wechat\Module', + 'adminId' => [100, 101] // 这里填写管理员ID(拥有wechat最高管理权限) ], 'example' => [ // 微信扩展示例模块, 生产环境可删除 'class' => 'app\modules\example\Module', diff --git a/config/web.php b/config/web.php index 13f8fcb16..9fb00526f 100644 --- a/config/web.php +++ b/config/web.php @@ -17,6 +17,9 @@ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => 'oxTxC600X5DGRubG2mYdBMmC4MM0C-ZB', + 'parsers' => [ // angular.js 提交数据解析 + 'application/json' => 'yii\web\JsonParser', + ] ], 'cache' => [ 'class' => 'yii\caching\FileCache', diff --git a/modules/example/migrations/m150402_051920_initWechatData.php b/modules/example/migrations/m150402_051920_initWechatData.php index 891099f8d..78f6ed4d1 100644 --- a/modules/example/migrations/m150402_051920_initWechatData.php +++ b/modules/example/migrations/m150402_051920_initWechatData.php @@ -14,14 +14,12 @@ public function safeUp() $wechat = new Wechat; $wechat->setAttributes([ 'name' => '示例公众号', - 'hash' => 'shili', 'token' => 'lL2hcT4c41H3wL21Hlftlz4A4w22j12L', 'account' => 'example', 'original' => 'gh_example12345', 'type' => Wechat::TYPE_SUBSCRIBE, - 'app_id' => 'wxd8cce40cc50ce6c7', - 'app_secret' => '8e850dfed1befa106ea0bbe7cb67ad25', - 'encoding_type' => Wechat::ENCODING_COMPATIBLE, + 'key' => 'wxd8cce40cc50ce6c7', + 'secret' => '8e850dfed1befa106ea0bbe7cb67ad25', 'encoding_aes_key' => '8J4In8J3R3ppqWgQkCXhOvU1ZxaPFa5eSDZ8u3XNy45', 'avatar' => 'example_avatar.png', 'qrcode' => 'example_qr_code.png',