frontend\modules\user\controllers\SettingController::actionDisconnect PHP Method

actionDisconnect() public method

解除绑定第三方账号
public actionDisconnect ( $id ) : Response
$id
return yii\web\Response
    public function actionDisconnect($id)
    {
        /** @var UserAccount $account */
        $account = UserAccount::findOne(['id' => $id]);
        if ($account === null) {
            throw new NotFoundHttpException();
        }
        if ($account->user_id != \Yii::$app->user->id) {
            throw new ForbiddenHttpException();
        }
        $account->delete();
        return $this->redirect(['networks']);
    }