From 5bb9f75a56662a4e03ee10ec09b71ea57dd03cbc Mon Sep 17 00:00:00 2001 From: laurieryayoi <14360417+laurieryayoi@users.noreply.github.com> Date: Mon, 14 Jan 2019 02:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0TG=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/theme/material/css/index.css | 17 +++++++++++++++++ resources/views/material/index.tpl | 29 +++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/public/theme/material/css/index.css b/public/theme/material/css/index.css index d4cb6529..bcbceeb7 100755 --- a/public/theme/material/css/index.css +++ b/public/theme/material/css/index.css @@ -342,6 +342,23 @@ select { width: 80%; } +#code_number, +.tg-timeout { + padding: .6rem 1rem; + width: 100%; + font-size: 1.3em; +} + +.tg-timeout { + width: 80%; +} + +.qr-center img { + width: 70%; + height: 70%; + text-align: center; +} + @media screen and (min-width:35.5em) { .auth-sm a { min-width: 120px; diff --git a/resources/views/material/index.tpl b/resources/views/material/index.tpl index 1a1b7ba6..efbe811a 100755 --- a/resources/views/material/index.tpl +++ b/resources/views/material/index.tpl @@ -191,9 +191,6 @@ const tmp = new Vuex.Store({ SET_JINRISHICI (state,content) { state.globalConfig.indexMsg.jinrishici = content; }, - SET_TGAUTHNUMBER (state,content) { - Vue.set(state.globalConfig,'login_number',content); - } }, actions: { CALL_MSGR ({ commit,state },config) { @@ -394,18 +391,28 @@ const Login = { 确认登录 -
+

Telegram登录

Telegram OAuth一键登陆

正在载入 Telegram,如果长时间未显示请刷新页面或检查代理

-

或者添加机器人账号 @$[globalConfig.telegram_bot]$,发送下面的数字验证码给它 +

或者添加机器人账号 @$[globalConfig.telegram_bot]$,发送下面的数字/二维码验证码给它

-
-

$[globalConfig.login_number]$

+ +
+
+
+
+
+
$[globalConfig.login_number]$
+
+
+
+
验证方式已过期,请刷新页面后重试
+
`, @@ -415,6 +422,7 @@ const Login = { passwd: '', remember_me: false, isDisabled: false, + isTgtimeout: false, } }, methods: { @@ -485,6 +493,11 @@ const Login = { el.setAttribute('data-telegram-login', this.globalConfig.telegram_bot); el.setAttribute('data-auth-url', this.globalConfig.base_url + '/auth/telegram_oauth'); el.setAttribute('data-request-access', 'write'); + + let telegram_qrcode = 'mod://login/' + this.globalConfig.login_token; + let qrcode = new QRCode(document.getElementById("telegram-qr")); + qrcode.clear(); + qrcode.makeCode(telegram_qrcode); }, tgAuthTrigger(tid) { let callConfig = { @@ -513,7 +526,7 @@ const Login = { } }) } else if (r.data.ret == -1) { - tmp.commit('SET_TGAUTHNUMBER','此数字已经过期,请刷新页面后重试'); + this.isTgtimeout = true; } }) tid = setTimeout(()=>{