diff --git a/plugins/Social/Repositories/CustomerRepo.php b/plugins/Social/Repositories/CustomerRepo.php index f64a3233..9550f131 100644 --- a/plugins/Social/Repositories/CustomerRepo.php +++ b/plugins/Social/Repositories/CustomerRepo.php @@ -33,20 +33,20 @@ class CustomerRepo Providers\Douban::NAME, Providers\Facebook::NAME, Providers\FeiShu::NAME, - Providers\Figma::NAME, - Providers\GitHub::NAME, - Providers\Gitee::NAME, + // Providers\Figma::NAME, + // Providers\GitHub::NAME, + // Providers\Gitee::NAME, Providers\Google::NAME, Providers\Line::NAME, Providers\Linkedin::NAME, - Providers\OpenWeWork::NAME, + // Providers\OpenWeWork::NAME, Providers\Outlook::NAME, - Providers\QCloud::NAME, + // Providers\QCloud::NAME, Providers\QQ::NAME, - Providers\Taobao::NAME, - Providers\Tapd::NAME, + // Providers\Taobao::NAME, + // Providers\Tapd::NAME, Providers\WeChat::NAME, - Providers\WeWork::NAME, + // Providers\WeWork::NAME, Providers\Weibo::NAME, ]; diff --git a/plugins/Social/Static/image/alipay.png b/plugins/Social/Static/image/alipay.png new file mode 100644 index 00000000..11dda4bc Binary files /dev/null and b/plugins/Social/Static/image/alipay.png differ diff --git a/plugins/Social/Static/image/azure.png b/plugins/Social/Static/image/azure.png new file mode 100644 index 00000000..c621cf9a Binary files /dev/null and b/plugins/Social/Static/image/azure.png differ diff --git a/plugins/Social/Static/image/dingtalk.png b/plugins/Social/Static/image/dingtalk.png new file mode 100644 index 00000000..59d91831 Binary files /dev/null and b/plugins/Social/Static/image/dingtalk.png differ diff --git a/plugins/Social/Static/image/douban.png b/plugins/Social/Static/image/douban.png new file mode 100644 index 00000000..43c03f30 Binary files /dev/null and b/plugins/Social/Static/image/douban.png differ diff --git a/plugins/Social/Static/image/douyin.png b/plugins/Social/Static/image/douyin.png new file mode 100644 index 00000000..5d2fa99a Binary files /dev/null and b/plugins/Social/Static/image/douyin.png differ diff --git a/plugins/Social/Static/image/feishu.png b/plugins/Social/Static/image/feishu.png new file mode 100644 index 00000000..3764804c Binary files /dev/null and b/plugins/Social/Static/image/feishu.png differ diff --git a/plugins/Social/Static/image/figma.png b/plugins/Social/Static/image/figma.png new file mode 100644 index 00000000..207663ff Binary files /dev/null and b/plugins/Social/Static/image/figma.png differ diff --git a/plugins/Social/Static/image/github.png b/plugins/Social/Static/image/github.png new file mode 100644 index 00000000..9220963c Binary files /dev/null and b/plugins/Social/Static/image/github.png differ diff --git a/plugins/Social/Static/image/line.png b/plugins/Social/Static/image/line.png new file mode 100644 index 00000000..fcae00a5 Binary files /dev/null and b/plugins/Social/Static/image/line.png differ diff --git a/plugins/Social/Static/image/linkedin.png b/plugins/Social/Static/image/linkedin.png new file mode 100644 index 00000000..547415c6 Binary files /dev/null and b/plugins/Social/Static/image/linkedin.png differ diff --git a/plugins/Social/Static/image/wechat.png b/plugins/Social/Static/image/wechat.png new file mode 100644 index 00000000..0b9427fd Binary files /dev/null and b/plugins/Social/Static/image/wechat.png differ diff --git a/plugins/Social/Static/image/weibo.png b/plugins/Social/Static/image/weibo.png new file mode 100644 index 00000000..118f3af5 Binary files /dev/null and b/plugins/Social/Static/image/weibo.png differ diff --git a/plugins/Social/Views/admin/config.blade.php b/plugins/Social/Views/admin/config.blade.php index e843e07d..5ce653e0 100644 --- a/plugins/Social/Views/admin/config.blade.php +++ b/plugins/Social/Views/admin/config.blade.php @@ -37,9 +37,10 @@ @@ -151,6 +152,21 @@ } }, + computed: { + providers() { + let providers = @json(Plugin\Social\Repositories\CustomerRepo::allProviders()); + + providers.forEach(e => { + if (this.form.social.some(s => s.provider == e.code)) { + e.disabled = true; + } + }) + + + return providers; + } + }, + methods: { submit(form) { this.$refs[form].validate((valid) => { @@ -174,7 +190,10 @@ }, addRow() { - this.form.social.push({provider: this.source.providers[1].code, status: 1, key: '', secret: '', callback: `plugin/social/callbacks/${this.source.providers[1].code}`, sort_order: this.form.social.length}) + let providers = this.source.providers.filter(e => !this.form.social.some(s => s.provider == e.code)) + if (providers.length) { + this.form.social.push({provider: providers[0].code, status: 1, key: '', secret: '', callback: `plugin/social/callbacks/${this.source.providers[1].code}`, sort_order: this.form.social.length}) + } } } }) diff --git a/plugins/Social/Views/shop/Bootstrap.php b/plugins/Social/Views/shop/Bootstrap.php new file mode 100644 index 00000000..5fd6695c --- /dev/null +++ b/plugins/Social/Views/shop/Bootstrap.php @@ -0,0 +1,39 @@ + + * @created 2022-10-12 17:33:29 + * @modified 2022-10-12 17:33:29 + */ + +namespace Plugin\Social; + + +class Bootstrap +{ + public function boot() + { + $this->addSocialData(); + } + + /** + * 增加第三方登录方式 + */ + private function addSocialData() + { + add_filter('login.social.buttons', function ($buttons) { + $providers = plugin_setting('social.setting'); + if (empty($providers)) { + return $buttons; + } + + foreach ($providers as $provider) { + $buttons[] = view('Social::shop/social_button', ['provider' => $provider])->render(); + } + return $buttons; + }); + } +} diff --git a/plugins/Social/Views/shop/social_button.blade.php b/plugins/Social/Views/shop/social_button.blade.php index 61b0c536..91e6d32b 100644 --- a/plugins/Social/Views/shop/social_button.blade.php +++ b/plugins/Social/Views/shop/social_button.blade.php @@ -1,4 +1,4 @@ diff --git a/resources/beike/shop/default/css/login.scss b/resources/beike/shop/default/css/login.scss index 11416020..45fc52e9 100644 --- a/resources/beike/shop/default/css/login.scss +++ b/resources/beike/shop/default/css/login.scss @@ -40,6 +40,10 @@ body.page-login, body.page-forgotten { } } + .vr-wrap { + margin: 0 80px; + } + .login-wrap { @media (min-width: 768px) { display: flex; @@ -50,7 +54,6 @@ body.page-login, body.page-forgotten { border: none; @media (min-width: 768px) { width: 340px; - margin: 0 60px; } } } @@ -63,11 +66,12 @@ body.page-login, body.page-forgotten { margin-top: 0 !important; } + .vr-wrap { + margin: 0 60px; + } + .card { border: none; - @media (min-width: 768px) { - margin: 0 30px; - } } } @@ -96,7 +100,15 @@ body.page-login, body.page-forgotten { } .btn { - border-color: #ccc !important; + // border-color: #ccc !important; + color: #666; + + img { + // transform: translateY(-50%); + position: absolute; + left: 40px; + } + &:hover { background-color: #eee; } diff --git a/resources/lang/de/shop/login.php b/resources/lang/de/shop/login.php index 3ad96dcd..08de67df 100644 --- a/resources/lang/de/shop/login.php +++ b/resources/lang/de/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'Benutzer wurde deaktiviert', 'login_successfully' => 'erfolgreich angemeldet', 'register_success' => 'erfolgreich registriert', + 'third_party_logins' => 'erwähnenswert', ]; diff --git a/resources/lang/en/shop/login.php b/resources/lang/en/shop/login.php index acf5fd62..4e95f2ed 100644 --- a/resources/lang/en/shop/login.php +++ b/resources/lang/en/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'The customer is inactive!', 'login_successfully' => 'Login successfully!', 'register_success' => 'Registered successfully', + 'third_party_logins' => 'Third-party Login', ]; diff --git a/resources/lang/es/shop/login.php b/resources/lang/es/shop/login.php index 23a545cc..c67a3b62 100644 --- a/resources/lang/es/shop/login.php +++ b/resources/lang/es/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'El usuario está deshabilitado', 'login_successfully' => 'Inicio de sesión correcto', 'register_success' => 'registración exitosa', + 'third_party_logins' => 'vale la pena mencionar', ]; diff --git a/resources/lang/fr/shop/login.php b/resources/lang/fr/shop/login.php index 9f3aa454..36a7685a 100644 --- a/resources/lang/fr/shop/login.php +++ b/resources/lang/fr/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'L\'utilisateur est désactivé', 'login_successfully' => 'connexion réussie', 'register_success' => 'succès de l\'inscription', + 'third_party_logins' => 'à noter', ]; diff --git a/resources/lang/it/shop/login.php b/resources/lang/it/shop/login.php index f6f6a6a9..01e6d7a7 100644 --- a/resources/lang/it/shop/login.php +++ b/resources/lang/it/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'l\'utente è stato disabilitato', 'login_successfully' => 'login con successo', 'register_success' => 'registrato con successo', + 'third_party_logins' => 'Vale la pena citare', ]; diff --git a/resources/lang/ja/shop/login.php b/resources/lang/ja/shop/login.php index 35e43433..b752c9a9 100644 --- a/resources/lang/ja/shop/login.php +++ b/resources/lang/ja/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'ユーザーは無効です', 'login_successfully' => 'ログイン成功', 'register_success' => '登録完了', + 'third_party_logins' => '言及する価値がある', ]; diff --git a/resources/lang/ru/shop/login.php b/resources/lang/ru/shop/login.php index 4355cf91..dd38e14f 100644 --- a/resources/lang/ru/shop/login.php +++ b/resources/lang/ru/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => 'Пользователь отключен', 'login_successfully' => 'Успешный вход в систему', 'register_success' => 'Вы успешно зарегистрировались', + 'third_party_logins' => 'Стоит отметить', ]; diff --git a/resources/lang/zh_cn/shop/login.php b/resources/lang/zh_cn/shop/login.php index 9f173642..54410617 100644 --- a/resources/lang/zh_cn/shop/login.php +++ b/resources/lang/zh_cn/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => '用户已被禁用', 'login_successfully' => '登录成功', 'register_success' => '注册成功', + 'third_party_logins' => '第三方登录', ]; diff --git a/resources/lang/zh_hk/shop/login.php b/resources/lang/zh_hk/shop/login.php index 938f92b6..3c5dde4e 100644 --- a/resources/lang/zh_hk/shop/login.php +++ b/resources/lang/zh_hk/shop/login.php @@ -36,4 +36,5 @@ return [ 'customer_inactive' => '用戶已被禁用', 'login_successfully' => '登錄成功', 'register_success' => '註冊成功', + 'third_party_logins' => '第三方登錄', ]; diff --git a/themes/default/account/login.blade.php b/themes/default/account/login.blade.php index e04b3f3e..d37cccbd 100644 --- a/themes/default/account/login.blade.php +++ b/themes/default/account/login.blade.php @@ -41,7 +41,7 @@ @if($social_buttons)
-
第三方登录
+
{{ __('shop/login.third_party_logins') }}
@foreach($social_buttons as $button) {!! $button !!} @endforeach @@ -49,7 +49,7 @@ @endif
-
+