From f9edfc344c5c33a5748e0e04feb9130e921f2d6c Mon Sep 17 00:00:00 2001 From: xjh22222228 Date: Sat, 24 Apr 2021 09:10:08 +0800 Subject: [PATCH] fix: own visible --- src/components/web-list/index.component.ts | 3 ++- src/utils/index.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/web-list/index.component.ts b/src/components/web-list/index.component.ts index 8216848..0de16bd 100644 --- a/src/components/web-list/index.component.ts +++ b/src/components/web-list/index.component.ts @@ -6,6 +6,7 @@ import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop' import { websiteList } from '../../store' import { INavFourProp } from 'src/types' import { setWebsiteList } from '../../utils' +import { isLogin } from '../../utils/user' @Component({ selector: 'app-web-list', @@ -37,7 +38,7 @@ export class WebListComponent implements OnInit { const item = nav[i] if (item.url) { - if (item.top) { + if (item.top && (isLogin || !item.ownVisible)) { dataList.push(item) } } else { diff --git a/src/utils/index.ts b/src/utils/index.ts index 03595ba..464da3d 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -87,10 +87,11 @@ export function totalWeb(): number { if (!Array.isArray(nav)) return for (let i = 0; i < nav.length; i++) { - if (nav[i].url) { + const item = nav[i] + if (item.url && (isLogin || !item.ownVisible)) { total += 1 } else { - r(nav[i].nav) + r(item.nav) } } } -- GitLab