@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | public function actionDelete($id) |
| 84 | 84 | { |
| 85 | 85 | $this->findModel($id)->delete(); |
| 86 | - Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Delete success.')); |
|
| 86 | + Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Delete success.')); |
|
| 87 | 87 | return $this->redirect(['index']); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (($model = Attachment::findOne($id)) !== null) { |
| 120 | 120 | return $model; |
| 121 | 121 | } else { |
| 122 | - throw new NotFoundHttpException (Yii::t('yuncms', 'The requested page does not exist.')); |
|
| 122 | + throw new NotFoundHttpException(Yii::t('yuncms', 'The requested page does not exist.')); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | 'attributes' => [ |
| 71 | 71 | ActiveRecord::EVENT_BEFORE_INSERT => 'user_id' |
| 72 | 72 | ], |
| 73 | - 'value' => function ($event) { |
|
| 73 | + 'value' => function($event) { |
|
| 74 | 74 | return Yii::$app->user->id; |
| 75 | 75 | } |
| 76 | 76 | ], |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $variables = []; |
| 30 | 30 | $variables['volumes'] = Yii::$app->getFilesystem()->getFilesystems(); |
| 31 | 31 | |
| 32 | - print_r($variables);exit; |
|
| 32 | + print_r($variables); exit; |
|
| 33 | 33 | return $this->renderTemplate('settings/assets/volumes/_index', $variables); |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | \ No newline at end of file |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | { |
| 82 | 82 | if ($this->validate()) { |
| 83 | 83 | $user = $this->getUser(); |
| 84 | - if(AvatarHelper::save($user, $this->getOriginalImage())){ |
|
| 84 | + if (AvatarHelper::save($user, $this->getOriginalImage())) { |
|
| 85 | 85 | return true; |
| 86 | 86 | } else { |
| 87 | 87 | return false; |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $user = new User(); |
| 82 | 82 | $user->setScenario(User::SCENARIO_EMAIL_REGISTER); |
| 83 | 83 | $this->loadAttributes($user); |
| 84 | - if($user->createUser()){ |
|
| 84 | + if ($user->createUser()) { |
|
| 85 | 85 | return $user; |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | public function startBuffering($content) |
| 93 | 93 | { |
| 94 | 94 | $this->getHeaders() |
| 95 | - ->set('Surrogate-Control','BigPipe/1.0') |
|
| 95 | + ->set('Surrogate-Control', 'BigPipe/1.0') |
|
| 96 | 96 | ->set('X-Accel-Buffering', 'no'); |
| 97 | 97 | $this->data = $content; |
| 98 | 98 | $this->send(); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | if (empty($code)) { |
| 46 | 46 | $code = Yii::$app->security->generateRandomString(40); |
| 47 | 47 | } |
| 48 | - $attributes = Yii::$app->cache->getOrSet([self::CACHE_PREFIX, 'code' => $code], function ($cache) use ($code) { |
|
| 48 | + $attributes = Yii::$app->cache->getOrSet([self::CACHE_PREFIX, 'code' => $code], function($cache) use ($code) { |
|
| 49 | 49 | return [ |
| 50 | 50 | 'code' => $code, |
| 51 | 51 | 'msg' => Yii::t('yuncms', 'Please use App Scan QR code to login.'), |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | public $grantTypes = [ |
| 33 | 33 | 'authorization_code' => 'yuncms\oauth2\grant\types\Authorization', |
| 34 | 34 | 'refresh_token' => 'yuncms\oauth2\grant\types\RefreshToken', |
| 35 | - 'client_credentials' => 'yuncms\oauth2\grant\types\ClientCredentials',//个人账户密码 |
|
| 36 | - 'password' => 'yuncms\oauth2\grant\types\UserCredentials',//账户密码 |
|
| 37 | - 'wechat' => 'yuncms\oauth2\grant\types\WechatCredentials',//微信 |
|
| 38 | - 'qrcode' => 'yuncms\oauth2\grant\types\QRCode',//客户端扫码 |
|
| 35 | + 'client_credentials' => 'yuncms\oauth2\grant\types\ClientCredentials', //个人账户密码 |
|
| 36 | + 'password' => 'yuncms\oauth2\grant\types\UserCredentials', //账户密码 |
|
| 37 | + 'wechat' => 'yuncms\oauth2\grant\types\WechatCredentials', //微信 |
|
| 38 | + 'qrcode' => 'yuncms\oauth2\grant\types\QRCode', //客户端扫码 |
|
| 39 | 39 | // 'urn:ietf:params:oauth:grant-type:jwt-bearer' => 'yuncms\oauth2\grant\types\JwtBearer',//JWT 客户端签名 |
| 40 | 40 | ]; |
| 41 | 41 | |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | { |
| 149 | 149 | if ($this->_user === null) { |
| 150 | 150 | $client = $this->wechat->openOAuth; |
| 151 | - $client->useOpenId = false;//使用unionid |
|
| 151 | + $client->useOpenId = false; //使用unionid |
|
| 152 | 152 | $client->validateAuthState = false; |
| 153 | 153 | $token = $client->fetchAccessToken($this->code); |
| 154 | 154 | $tokenParams = $token->getParams(); |