diff --git a/shell/git_diy.sh b/shell/git_diy.sh index b7df725b..28192154 100755 --- a/shell/git_diy.sh +++ b/shell/git_diy.sh @@ -29,12 +29,16 @@ fi diyscriptsdir=/ql/diyscripts mkdir -p ${diyscriptsdir} +urlTmp=${url%*/} +repoTmp=${urlTmp##*/} +repo=${repoTmp%.*} +tmp=${url%/*} +authorTmp1=${tmp##*/} +authorTmp2=${authorTmp1##*:} +author=${authorTmp2##*.} + if [ ! -d "$diyscriptsdir/${author}_${repo}" ]; then echo -e "${author}本地仓库不存在,从远程拉取ing..." - repoTmp=${url##*/} - repo=${repoTmp%.*} - tmp=${url%/*} - author=${tmp##*/} cd ${diyscriptsdir} && git clone $url ${author}_${repo} gitpullstatus=$? [ $gitpullstatus -eq 0 ] && echo -e "${author}本地仓库拉取完毕" diff --git a/src/app.tsx b/src/app.tsx index 2e3aef04..ca5c3221 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -3,9 +3,6 @@ import { request } from '@/utils/http'; import config from '@/utils/config'; export function render(oldRender: any) { - if (history.location.pathname === '/login') { - oldRender(); - } request .get(`${config.apiPrefix}user`) .then((data) => { diff --git a/src/assets/logo.png b/src/assets/logo.png index 096c16cb..0a53e4e8 100644 Binary files a/src/assets/logo.png and b/src/assets/logo.png differ diff --git a/src/pages/cookie/index.tsx b/src/pages/cookie/index.tsx index 51420308..71ccfaeb 100644 --- a/src/pages/cookie/index.tsx +++ b/src/pages/cookie/index.tsx @@ -113,11 +113,7 @@ const Config = () => { render: (text: string, record: any) => { const match = record.value.match(/pt_pin=([^; ]+)(?=;?)/); const val = (match && match[1]) || '未匹配用户名'; - return ( - - {decodeURIComponent(unescape(val))} - - ); + return {decodeUrl(val)}; }, }, { @@ -226,17 +222,29 @@ const Config = () => { .finally(() => setLoading(false)); }; + const decodeUrl = (val: string) => { + try { + const newUrl = decodeURIComponent(val); + return newUrl; + } catch (error) { + return val; + } + }; + useEffect(() => { if (value && loading) { - // asyncUpdateStatus(); + asyncUpdateStatus(); } }, [value]); const asyncUpdateStatus = async () => { for (let i = 0; i < value.length; i++) { const cookie = value[i]; + if (cookie.status === Status.已禁用) { + continue; + } await sleep(1000); - refreshStatus(cookie, i); + location.pathname === '/cookie' && refreshStatus(cookie, i); } }; diff --git a/src/pages/login/index.less b/src/pages/login/index.less index 23075564..3892be68 100644 --- a/src/pages/login/index.less +++ b/src/pages/login/index.less @@ -51,7 +51,7 @@ } .logo { - width: 40px; + width: 30px; margin-right: 8px; } diff --git a/src/utils/config.ts b/src/utils/config.ts index 7763b213..4cbe07a1 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,5 +1,5 @@ export default { - siteName: '脚本控制面板', + siteName: '青龙控制面板', apiPrefix: '/api/', authKey: 'token',