承接 changyuan/yii2-authclient 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

changyuan/yii2-authclient

Composer 安装命令:

composer require changyuan/yii2-authclient

包简介

yii2-authclient for qq weibo wechat

README 文档

README

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist changyuan/yii2-authclient

or add

"changyuan/yii2-authclient": "~2.1.0"

to the require section of your composer.json.

Usage

'components' => [
    'authClientCollection' => [
        'class' => 'yii\authclient\Collection',
        'clients' => [
            'weibo' => [
                'class' => 'changyuan\authclient\clients\Weibo',
                'clientId' => 'wb_key',
                'clientSecret' => 'wb_secret',
            ],
            'qq' => [
                'class' => 'changyuan\authclient\clients\QQ',
                'clientId' => 'qq_appid',
                'clientSecret' => 'qq_appkey',
            ],
            'wechat' => [
                'class' => 'changyuan\authclient\clients\Wechat',
                'clientId' => 'weixin_appid',
                'clientSecret' => 'weixin_appkey',
            ],
            'wechatmp' => [
                'class' => 'changyuan\authclient\clients\Wechat',
                'type' => 'mp',
                'clientId' => 'weixin_appid',
                'clientSecret' => 'weixin_appkey',
            ],
        ],
    ]
    // other components
]

in view

 //The first way in view:
 <?= yii\authclient\widgets\AuthChoice::widget([
    'baseAuthUrl' => ['site/auth']
 ]); ?>
 
 //The second way in view:
  <?php
  use yii\authclient\widgets\AuthChoice;
  ?>
  <?php $authAuthChoice = AuthChoice::begin([
      'baseAuthUrl' => ['site/auth']
  ]); ?>
  <ul>
  <?php foreach ($authAuthChoice->getClients() as $client): ?>
      <li><?= $authAuthChoice->clientLink($client) ?></li>
  <?php endforeach; ?>
  </ul>
  <?php AuthChoice::end(); ?>

参考

Q&A

Q: this error "Invalid auth state parameter." ?

A: remove sub class $this->removeState('authState');

统计信息

  • 总下载量: 109
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固