Files
plugins/Sinauth/README.md
chorblack e75f275ef4
Some checks failed
定时更新GitHub源插件 / 自动更新GitHub插件 (push) Has been cancelled
Initial commit
2026-03-07 11:19:25 +08:00

40 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 新浪OAuth2登陆插件
基于最新新浪sae维护的sdk lib https://github.com/xiaosier/libweibo。
> 修正登录路径、面板兼容和数据库检测问题,更新文档。
实现功能:
* 新用户进入授权流程后,自动创建帐号并登陆
* 已登陆但未绑定过的用户进入授权流程后,会绑定当前帐号
* 已绑定过用户授权直接登陆
* 后台微信授权用户简易列表
安装插件后还需要进行一些设置。
第一步需要设定好微博开放平台的回调地址:
去微博开放平台打开你的应用,切换到“接口管理”|“授权机制”页面看到“OAuth2.0 授权设置”点击编辑设置相应url
授权回调页http://你的域名/sinauthCallback
取消授权回调页http://你的域名/sinauthCancel 这个暂时没有实现,不影响基本使用
建议启用路径重写否则上述url需要稍作调整加上入口文件。
第二步需要在模板中相应地方增加相应链接:
/app_path/usr/themes/default/sidebar.php
```php
<li class="last"><?php $this->user->sinauthAuthorizeIcon(); ?>
```
也可以在后台登陆页面加一个:
/app_path/admin/login.php
```php
<?php echo $user->sinauthAuthorizeIcon(); ?>&bull;
```