diff --git a/resources/views/malio/user/navbar.tpl b/resources/views/malio/user/navbar.tpl index 6c2a1a7a..0fabe5f7 100644 --- a/resources/views/malio/user/navbar.tpl +++ b/resources/views/malio/user/navbar.tpl @@ -86,7 +86,7 @@ {if $malio_config['enable_sidebar_button'] == true && $user->class >= $malio_config['telegram_group_class']}
- + 加入 Telegram 群组
diff --git a/resources/views/malio/user/scripts.tpl b/resources/views/malio/user/scripts.tpl index b09499c6..e4d2db59 100644 --- a/resources/views/malio/user/scripts.tpl +++ b/resources/views/malio/user/scripts.tpl @@ -1,4 +1,3 @@ - @@ -15,11 +14,29 @@ \ No newline at end of file + var isWeixin = function () { + var ua = navigator.userAgent.toLowerCase(); + return ua.match(/MicroMessenger/i) == "micromessenger"; + }; + if (isWeixin() == true) { + $('body').html('
不支持在微信内访问
请点击右上角菜单
选择浏览器打开
') + } + function joinTelegramGroup() { + {if $malio_config['force_user_to_bind_tg_when_join_group'] == true} + Swal.fire({ + title: '提示', + html: '加入群组之前需要在 我的账号 页面绑定 Telegram 账号,未绑定则无法加入群组。', + type: 'warning', + showCancelButton: true, + confirmButtonText: '确定加入', + cancelButtonText: '取消' + }).then((result) => { + if (result.value) { + window.open("{$malio_config['telegram_group']}") + } + }) + {else} + window.open("{$malio_config['telegram_group']}") + {/if} + } + \ No newline at end of file