Skip to content

Commit

Permalink
✨ 优化配置框架及第三方登录选项模块
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Oct 21, 2022
1 parent e627b81 commit df9cef9
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 116 deletions.
2 changes: 1 addition & 1 deletion assets/dist/setting/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 47 additions & 47 deletions assets/dist/setting/index.js

Large diffs are not rendered by default.

171 changes: 104 additions & 67 deletions inc/setting/options/OptionOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,130 @@

namespace Puock\Theme\setting\options;

class OptionOAuth extends BaseOptionItem{
class OptionOAuth extends BaseOptionItem
{

function get_fields(): array
{
return [
'key' => 'oauth',
'label' => '第三方登录',
'icon'=>'dashicons-facebook',
'icon' => 'dashicons-facebook',
'fields' => [
[
'id' => '-',
'label' => '第三方登录回调地址提示',
'type' => 'info',
'infoType' => 'info',
'tips'=>'通用回调地址(callback url)为: <code>'.home_url().'/wp-admin/admin-ajax.php</code>'
'tips' => '通用回调地址(callback url)为: <code>' . home_url() . '/wp-admin/admin-ajax.php</code>'
],
[
'id' => 'oauth_qq',
'label' => 'QQ登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_qq_id',
'label' => 'QQ互联 APP ID',
'sdt' => '',
'showRefId' => 'oauth_qq',
],
[
'id' => 'oauth_qq_key',
'label' => 'QQ互联 APP KEY',
'sdt' => '',
'showRefId' => 'oauth_qq',
],
[
'id' => 'oauth_github',
'label' => 'Github登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_github_id',
'label' => 'Github Client ID',
'sdt' => '',
'showRefId' => 'oauth_github',
],
[
'id' => 'oauth_github_secret',
'label' => 'Github Client Secret',
'sdt' => '',
'showRefId' => 'oauth_github',
],
[
'id' => 'oauth_weibo',
'label' => '微博登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_weibo_key',
'label' => '微博 App Key',
'sdt' => '',
'showRefId' => 'oauth_weibo',
],
[
'id' => 'oauth_weibo_secret',
'label' => '微博 App Secret',
'sdt' => '',
'showRefId' => 'oauth_weibo',
'id' => '-',
'label' => 'QQ登录配置',
'type' => 'panel',
'open' => pk_is_checked('oauth_qq'),
'tips' => '<a target="_blank" href="https://wiki.connect.qq.com/%E7%BD%91%E7%AB%99%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B">申请步骤及说明</a>',
'children' => [
[
'id' => 'oauth_qq',
'label' => 'QQ登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_qq_id',
'label' => 'QQ互联 APP ID',
'sdt' => '',
'showRefId' => 'oauth_qq',
],
[
'id' => 'oauth_qq_key',
'label' => 'QQ互联 APP KEY',
'sdt' => '',
'showRefId' => 'oauth_qq',
],
]
],
[
'id' => 'oauth_gitee',
'label' => 'Gitee(码云)登录',
'type' => 'switch',
'sdt' => 'false',
'id' => '-',
'label' => 'Github登录配置',
'type' => 'panel',
'open' => pk_is_checked('oauth_github'),
'tips' => '<a target="_blank" href="https://www.ruanyifeng.com/blog/2019/04/github-oauth.html">申请步骤及说明</a>',
'children' => [
[
'id' => 'oauth_github',
'label' => 'Github登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_github_id',
'label' => 'Github Client ID',
'sdt' => '',
'showRefId' => 'oauth_github',
],
[
'id' => 'oauth_github_secret',
'label' => 'Github Client Secret',
'sdt' => '',
'showRefId' => 'oauth_github',
],
]
],
[
'id' => 'oauth_gitee_id',
'label' => 'Gitee(码云)Client ID',
'sdt' => '',
'showRefId' => 'oauth_gitee',
'id' => '-',
'label' => '微博登录配置',
'type' => 'panel',
'open' => pk_is_checked('oauth_weibo'),
'tips' => '<a target="_blank" href="https://open.weibo.com/wiki/%E7%BD%91%E7%AB%99%E6%8E%A5%E5%85%A5%E4%BB%8B%E7%BB%8D">申请步骤及说明</a>',
'children' => [
[
'id' => 'oauth_weibo',
'label' => '微博登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_weibo_key',
'label' => '微博 App Key',
'sdt' => '',
'showRefId' => 'oauth_weibo',
],
[
'id' => 'oauth_weibo_secret',
'label' => '微博 App Secret',
'sdt' => '',
'showRefId' => 'oauth_weibo',
],
]
],
[
'id' => 'oauth_gitee_secret',
'label' => 'Gitee(码云)Client Secret',
'sdt' => '',
'showRefId' => 'oauth_gitee',
'id' => '-',
'label' => 'Gitee登录配置',
'type' => 'panel',
'open' => pk_is_checked('oauth_gitee'),
'tips' => '<a target="_blank" href="https://gitee.com/api/v5/oauth_doc#/list-item-3">申请步骤及说明</a>',
'children' => [
[
'id' => 'oauth_gitee',
'label' => 'Gitee(码云)登录',
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'oauth_gitee_id',
'label' => 'Gitee(码云)Client ID',
'sdt' => '',
'showRefId' => 'oauth_gitee',
],
[
'id' => 'oauth_gitee_secret',
'label' => 'Gitee(码云)Client Secret',
'sdt' => '',
'showRefId' => 'oauth_gitee',
],
]
],
],
];
Expand Down
2 changes: 1 addition & 1 deletion inc/setting/options/OptionValidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function get_fields(): array
'type' => 'switch',
'sdt' => 'false',
'tips' => '图形验证码'
],
]
],
];
}
Expand Down

0 comments on commit df9cef9

Please sign in to comment.