From 20b513a8ec2d98d8149ccb42b7ec012a0f08f210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=B7=9E?= Date: Tue, 29 Jun 2021 17:52:26 +0800 Subject: [PATCH] =?UTF-8?q?'=E5=AE=8C=E6=88=90=E9=A1=B5=E9=9D=A2=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.ts | 6 ++-- src/pages/index.less | 3 -- src/pages/index.tsx | 5 ++- src/pages/sync/assets/sync.error.png | Bin 0 -> 399 bytes src/pages/sync/assets/sync.success.png | Bin 0 -> 490 bytes src/pages/sync/assets/syncing.png | Bin 0 -> 585 bytes src/pages/sync/index.tsx | 40 +++++++++++++++++++++-- src/pages/sync/sync.less | 42 +++++++++++++++++++++++++ 8 files changed, 85 insertions(+), 11 deletions(-) delete mode 100644 src/pages/index.less create mode 100644 src/pages/sync/assets/sync.error.png create mode 100644 src/pages/sync/assets/sync.success.png create mode 100644 src/pages/sync/assets/syncing.png create mode 100644 src/pages/sync/sync.less diff --git a/src/app.ts b/src/app.ts index bfea198..58a7a58 100644 --- a/src/app.ts +++ b/src/app.ts @@ -87,7 +87,7 @@ export const request: RequestConfig = { }; -export async function getInitialState() { +export async function getInitialState(): Promise<{ isLogin: boolean, fetchUserInfo: () => any, currentUser?: any }> { async function fetchUserInfo() { const res = await queryCurrent(); handleRequest(res) @@ -98,17 +98,19 @@ export async function getInitialState() { } // 如果是登录页面,不执行 - if (history.location.pathname !== '/login') { + if (history.location.pathname !== '/login' && history.location.pathname !== '/~docs') { const currentUser = await fetchUserInfo(); if(!currentUser) { logout(); } return { fetchUserInfo, + isLogin: !!currentUser, currentUser, }; } return { + isLogin: false, fetchUserInfo, }; } \ No newline at end of file diff --git a/src/pages/index.less b/src/pages/index.less deleted file mode 100644 index 586302b..0000000 --- a/src/pages/index.less +++ /dev/null @@ -1,3 +0,0 @@ -.title { - background: rgb(121, 242, 157); -} diff --git a/src/pages/index.tsx b/src/pages/index.tsx index ebdd169..21ebdba 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,9 +1,8 @@ import styles from './index.less'; +import { Redirect } from 'react-router'; export default function IndexPage() { return ( -
-

Page index

-
+ ); } diff --git a/src/pages/sync/assets/sync.error.png b/src/pages/sync/assets/sync.error.png new file mode 100644 index 0000000000000000000000000000000000000000..545254e622866834915df40aeb61a5415e750c16 GIT binary patch literal 399 zcmV;A0dW3_P)QEAwr_y1K8^d3N~7#6Vi(yw)R5u02-|X zAqgz3CU;~_0%6%*(Ay0&bMAceBShZ7ZB#6}C&;$Ka_AO#RrJ9i*QKV{nN5+Y(XLkK zR*L0Qi|zxND0pIz40842caPRut*;3j!sK$Xd_M05#VFjf7=NmzZDGJ z!wZYnqQ5Tq6nnY6Be~!+>NCh?sd;uFW6eCrm7N9vMh4cU=hi)tdYtCK4@yq9;OLzF zi0_G>OW$p@6)JH7d9thD3>^#YIKMzgdTyf+l;Q#mX4BeX0b}kHrZPwcAnXd_sOn83 zAWeb@$BH_roTNxdZlb`uf&rEio0v34fxxP`nG9H~w=sb67*iI>Uu=5w3gM(|;v$8P txK$PyDLhRQH&R!53isR&OhIPsU7n!;IjY#002ovPDHLkV1f=TuB-q6 literal 0 HcmV?d00001 diff --git a/src/pages/sync/assets/sync.success.png b/src/pages/sync/assets/sync.success.png new file mode 100644 index 0000000000000000000000000000000000000000..fb21d40476bf1811a368cba0f9944a4eef70d807 GIT binary patch literal 490 zcmVSJ&iW@;2D_Ibm zScus8@ivtKv9gK~H*YojW=?psYm{YQp*Y>WGxs<5+z&y`@e1G4Fm@bD`T)GHUSGg+ z2U>kyNoNZWL*&jF^f!_zm`||wEd;t2>}p9Af?nBXG-`$9P*%^8)N7N7^B=2tQ!lTy*l;M(Rx!Vj|wqYsR?Jr^K(9kbgXuw(D>?Q z_wCj7FpWuSrOqvpckcy-2=E(3i?c=cNOl28Re?nd-JR6Xp$QKF`31NRwN(Mv{{bXI zL$)Upst=Y+m9EKXNfKKrmJb1R)XCBT?j?xigCB{3<~QM@6`0jbc4ExW8>Czs7 zJKQAS%rC8^OOP@k|+X-kAz+eR7yYG=`5DV-%2{{l~Yb1gr zsa)fa%#fd#*bk^wApr&i9*$=d{pmt+qE?9jml?M>DB9Qr!VO8o0HW1OeuBt*_Y$M&f(SyncType.Syncing); return ( -
- 同步任务界面 +
+
+

同步任务

+ { + syncTypeList.map(({ type: iType, label, icon }) => ( +
setType(iType)}> + + {label} + 99+ +
+ )) + } +
+
+ 同步任务界面 +
+
) } \ No newline at end of file diff --git a/src/pages/sync/sync.less b/src/pages/sync/sync.less new file mode 100644 index 0000000..1f45335 --- /dev/null +++ b/src/pages/sync/sync.less @@ -0,0 +1,42 @@ +.sync { + display: flex; + flex-direction: row; + height: 100%; + .left { + flex: none; + width: 120px; + background-color: #fff; + h4 { + display: flex; + font-size: 12px; + color: rgba(0, 0, 0, 0.6); + padding-left: 12px; + line-height: 32px; + margin-bottom: 0; + span { display: block; transform: scale(0.83); } + } + .tab { + position: relative; + display: flex; + flex-direction: row; + align-items: center; + height: 40px; + padding: 0 4px 0 12px; + cursor: pointer; + opacity: 0.4; + border-right: 2px solid transparent; + &.active { + opacity: 1; + border-right-color: @primary-color; + background: rgba(120, 80, 255, 0.04); + } + .icon { flex: none; } + .label { flex: 0 0 48px; margin: 0 8px; font-size: 12px; color: rgba(#000, 0.85); } + .count { flex: 1; font-size: 12px; color: #8E909F; transform: scale(0.83); } + } + } + .right { + flex: 1; + overflow: auto; + } +} \ No newline at end of file