From 1e1d82fa7c60a19a5ab832b1fe43fe9421259361 Mon Sep 17 00:00:00 2001 From: moshangqi <2509678669@qq.com> Date: Fri, 1 Dec 2023 11:42:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background/core/chrome.ts | 10 +++++++--- src/components/AccountLayout/Login.module.less | 8 ++++++++ src/components/AccountLayout/Login.tsx | 12 ++++++++++++ src/components/AccountLayout/index.tsx | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/background/core/chrome.ts b/src/background/core/chrome.ts index 49d100fa..d98caebf 100644 --- a/src/background/core/chrome.ts +++ b/src/background/core/chrome.ts @@ -44,9 +44,13 @@ export default { tabs.query({ status: 'complete' }, res => { for (const tab of res) { if (tab.id) { - tabs.sendMessage(tab.id, message, res1 => { - resolve(res1); - }); + try { + tabs.sendMessage(tab.id, message, res1 => { + resolve(res1); + }); + } catch (e) { + // 吞掉抛错 + } } } }); diff --git a/src/components/AccountLayout/Login.module.less b/src/components/AccountLayout/Login.module.less index 1ab5708f..826e1ccd 100644 --- a/src/components/AccountLayout/Login.module.less +++ b/src/components/AccountLayout/Login.module.less @@ -8,6 +8,7 @@ border-left: 1px solid @border-color; background: @white; justify-content: center; + position: relative; .content { padding: 0 70px; @@ -48,4 +49,11 @@ } } } + + .closeWrapper { + position: absolute; + right: 16px; + top: 16px; + color: @text-color-secondary; + } } diff --git a/src/components/AccountLayout/Login.tsx b/src/components/AccountLayout/Login.tsx index a3f8881f..95f5744a 100644 --- a/src/components/AccountLayout/Login.tsx +++ b/src/components/AccountLayout/Login.tsx @@ -7,6 +7,9 @@ import { __i18n } from '@/isomorphic/i18n'; import LinkHelper from '@/isomorphic/link-helper'; import { VERSION } from '@/config'; import YuqueLogo from '@/assets/images/yuque-logo.png'; +import { isRunningInjectPage } from '@/core/uitl'; +import LarkIcon from '../LarkIcon'; +import Typography from '../Typography'; import styles from './Login.module.less'; interface ILoginProps { @@ -39,6 +42,15 @@ function Login(props: ILoginProps) { return (