@yelon/bis 16.0.2 → 16.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/esm2022/layout/layout-basic/interface.mjs +2 -7
  2. package/esm2022/layout/layout-basic/layout-basic.component.mjs +83 -54
  3. package/esm2022/layout/layout-nav/index.mjs +1 -2
  4. package/esm2022/layout/layout-nav/layout-nav-application.component.mjs +36 -33
  5. package/esm2022/layout/layout-nav/layout-nav-group.component.mjs +82 -77
  6. package/esm2022/layout/layout-nav/layout-nav-tile.component.mjs +3 -3
  7. package/esm2022/layout/widgets/yunzai-clear-storage.component.mjs +3 -3
  8. package/esm2022/layout/widgets/yunzai-fullscreen.component.mjs +3 -3
  9. package/esm2022/layout/widgets/yunzai-i18n.component.mjs +3 -3
  10. package/esm2022/layout/widgets/yunzai-notify.component.mjs +3 -3
  11. package/esm2022/layout/widgets/yunzai-theme-btn.component.mjs +3 -3
  12. package/esm2022/layout/widgets/yunzai-user.component.mjs +19 -19
  13. package/esm2022/layout/yunzai-act.guard.mjs +12 -12
  14. package/esm2022/layout/yunzai-auth.service.mjs +27 -95
  15. package/esm2022/layout/yunzai-default.interceptor.mjs +8 -16
  16. package/esm2022/layout/yunzai-i18n.service.mjs +15 -16
  17. package/esm2022/layout/yunzai-layout.module.mjs +10 -9
  18. package/esm2022/layout/yunzai-startup.service.mjs +26 -35
  19. package/fesm2022/layout.mjs +287 -336
  20. package/fesm2022/layout.mjs.map +1 -1
  21. package/layout/layout-basic/interface.d.ts +1 -15
  22. package/layout/layout-basic/layout-basic.component.d.ts +3 -6
  23. package/layout/layout-nav/index.d.ts +0 -1
  24. package/layout/layout-nav/layout-nav-application.component.d.ts +2 -4
  25. package/layout/layout-nav/layout-nav-group.component.d.ts +2 -4
  26. package/layout/widgets/yunzai-user.component.d.ts +1 -3
  27. package/layout/yunzai-act.guard.d.ts +1 -3
  28. package/layout/yunzai-auth.service.d.ts +2 -4
  29. package/layout/yunzai-i18n.service.d.ts +1 -3
  30. package/layout/yunzai-layout.module.d.ts +3 -2
  31. package/layout/yunzai-startup.service.d.ts +7 -10
  32. package/package.json +11 -11
  33. package/esm2022/layout/layout-nav/types.mjs +0 -2
  34. package/layout/layout-nav/types.d.ts +0 -15
@@ -1,22 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component, ChangeDetectionStrategy, HostListener, Injectable, Inject, Input, Optional, NgModule, APP_INITIALIZER } from '@angular/core';
3
- import { Subject, takeUntil, of, catchError, forkJoin, map as map$1, mergeMap, mergeAll, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
4
- import * as i1$4 from '@yelon/util';
5
- import { WINDOW, hasFavicon, setFavicon, log as log$1, deepCopy, YunzaiConfigService } from '@yelon/util';
6
- import * as i1$5 from '@yelon/theme/layout-default';
7
- import * as i1$3 from '@yelon/cache';
8
- import { CacheService } from '@yelon/cache';
9
- import * as i3$3 from '@yelon/socket';
10
- import * as i4$1 from '@angular/common';
3
+ import { Subject, takeUntil, of, catchError, forkJoin, map as map$1, mergeMap, combineLatest, BehaviorSubject, throwError, filter, take, switchMap } from 'rxjs';
4
+ import * as i1$3 from '@yelon/util';
5
+ import { useLocalStorageLang, useLocalStorageLangs, WINDOW, useLocalStorageProjectInfo, useLocalStorageUser, useLocalStorageHeader, NavType, hasFavicon, setFavicon, useLocalStorageCurrent, useLocalStorageHeaderType, useLocalStorageDefaultRoute, log as log$1, deepCopy, YunzaiConfigService, useLocalStorageTenant } from '@yelon/util';
6
+ import * as i1$4 from '@yelon/theme/layout-default';
7
+ import * as i2$1 from '@yelon/socket';
8
+ import * as i3$2 from '@angular/common';
11
9
  import { registerLocaleData, DOCUMENT, CommonModule } from '@angular/common';
12
- import * as i5$1 from '@angular/router';
10
+ import * as i4$4 from '@angular/router';
13
11
  import { Router, RouterModule } from '@angular/router';
14
- import * as i6$1 from '@yelon/abc/reuse-tab';
12
+ import * as i5$1 from '@yelon/abc/reuse-tab';
15
13
  import * as i3 from 'ng-zorro-antd/core/transition-patch';
16
- import * as i6 from 'ng-zorro-antd/menu';
17
- import * as i7 from 'ng-zorro-antd/dropdown';
18
- import * as i8 from 'ng-zorro-antd/icon';
19
- import * as i9 from 'ng-zorro-antd/avatar';
14
+ import * as i4$1 from 'ng-zorro-antd/menu';
15
+ import * as i5 from 'ng-zorro-antd/dropdown';
16
+ import * as i7 from 'ng-zorro-antd/icon';
17
+ import * as i8$1 from 'ng-zorro-antd/avatar';
20
18
  import * as i1 from 'ng-zorro-antd/modal';
21
19
  import * as i1$1 from 'ng-zorro-antd/message';
22
20
  import * as i1$2 from '@yelon/theme';
@@ -47,27 +45,21 @@ import { formatDistanceToNow } from 'date-fns';
47
45
  import { log } from '@yelon/util/other';
48
46
  import * as i4$2 from '@yelon/abc/notice-icon';
49
47
  import { YUNZAI_THEME_BTN_KEYS } from '@yelon/theme/theme-btn';
50
- import * as i3$2 from '@angular/cdk/bidi';
51
- import * as i8$1 from 'ng-zorro-antd/tooltip';
48
+ import * as i3$3 from '@angular/cdk/bidi';
49
+ import * as i8 from 'ng-zorro-antd/tooltip';
52
50
  import { YA_SERVICE_TOKEN, ALLOW_ANONYMOUS } from '@yelon/auth';
53
- import * as i5 from '@angular/forms';
51
+ import * as i4$3 from '@angular/forms';
54
52
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
55
- import * as i7$1 from 'ng-zorro-antd/grid';
56
- import * as i9$1 from 'ng-zorro-antd/input';
57
- import * as i8$2 from 'ng-zorro-antd/tabs';
53
+ import * as i6 from 'ng-zorro-antd/grid';
54
+ import * as i8$2 from 'ng-zorro-antd/input';
55
+ import * as i7$1 from 'ng-zorro-antd/tabs';
58
56
  import { HttpErrorResponse, HttpResponse, HttpResponseBase, HttpClientModule } from '@angular/common/http';
59
57
  import { NzNotificationService } from 'ng-zorro-antd/notification';
60
- import { YunzaiSharedYelonModule, YunzaiSharedZorroModule } from '@yelon/bcs';
58
+ import { YunzaiSharedYelonModule } from '@yelon/bcs/yunzai-shared-yelon';
59
+ import { YunzaiSharedZorroModule } from '@yelon/bcs/yunzai-shared-zorro';
61
60
  import { AccountBookTwoTone, AccountBookFill, AccountBookOutline, AlertTwoTone, AlertFill, AlibabaOutline, AimOutline, AlipayCircleFill, AlertOutline, AlignCenterOutline, AlipayCircleOutline, AlipayOutline, AlignLeftOutline, AlignRightOutline, AmazonOutline, AliwangwangOutline, AliyunOutline, AlipaySquareFill, AmazonCircleFill, AndroidFill, AliwangwangFill, AntCloudOutline, AmazonSquareFill, AndroidOutline, ApartmentOutline, ApiTwoTone, ApiFill, ApiOutline, AntDesignOutline, AppstoreAddOutline, AppstoreFill, AppleOutline, AppstoreOutline, ArrowDownOutline, AppleFill, ArrowsAltOutline, AppstoreTwoTone, ArrowUpOutline, AreaChartOutline, ArrowLeftOutline, AudioFill, ArrowRightOutline, AudioTwoTone, AuditOutline, AudioMutedOutline, BackwardFill, AudioOutline, BackwardOutline, BankFill, BarcodeOutline, BellFill, BankTwoTone, BarsOutline, BankOutline, BehanceCircleFill, BehanceSquareFill, BoldOutline, BellOutline, BehanceOutline, BlockOutline, BehanceSquareOutline, BgColorsOutline, BellTwoTone, BarChartOutline, BookTwoTone, BookFill, BorderOuterOutline, BorderLeftOutline, BorderBottomOutline, BorderHorizontalOutline, BorderTopOutline, BorderOutline, BorderInnerOutline, BorderRightOutline, BoxPlotOutline, BoxPlotFill, BoxPlotTwoTone, BookOutline, BorderlessTableOutline, BorderVerticleOutline, BuildTwoTone, BuildOutline, BugFill, BugOutline, BugTwoTone, BulbFill, BulbTwoTone, BuildFill, BulbOutline, CalculatorFill, CalculatorTwoTone, CalendarFill, CalendarOutline, CalculatorOutline, CalendarTwoTone, CameraOutline, CameraFill, CameraTwoTone, CarTwoTone, CaretDownOutline, CarOutline, CaretLeftFill, CarFill, CaretRightOutline, CaretDownFill, CaretUpOutline, CaretRightFill, CarryOutFill, CarryOutOutline, CaretLeftOutline, CaretUpFill, BranchesOutline, CarryOutTwoTone, CheckCircleFill, CheckCircleOutline, CheckSquareOutline, CheckCircleTwoTone, CiCircleTwoTone, CheckOutline, CheckSquareTwoTone, CiOutline, CheckSquareFill, CiTwoTone, ChromeOutline, ClockCircleOutline, CiCircleOutline, ChromeFill, ClearOutline, CloseCircleTwoTone, CiCircleFill, CloseCircleOutline, ClockCircleFill, CloseCircleFill, ClockCircleTwoTone, CloseOutline, CloseSquareOutline, CloseSquareFill, CloudFill, CloseSquareTwoTone, CloudDownloadOutline, CloudTwoTone, CloudServerOutline, CloudUploadOutline, CloudSyncOutline, ClusterOutline, CodeSandboxCircleFill, CodeFill, CodepenCircleOutline, CloudOutline, CodeSandboxOutline, CodeOutline, CodeSandboxSquareFill, CodeTwoTone, CodepenSquareFill, CodepenOutline, CoffeeOutline, ColumnWidthOutline, CompressOutline, ColumnHeightOutline, CodepenCircleFill, CompassTwoTone, CommentOutline, ContainerFill, CompassOutline, ConsoleSqlOutline, ContactsOutline, ContainerTwoTone, ContactsFill, ContactsTwoTone, ContainerOutline, ControlFill, CopyFill, CopyOutline, CompassFill, CopyTwoTone, CopyrightOutline, CopyrightCircleOutline, ControlTwoTone, ControlOutline, CreditCardFill, CopyrightTwoTone, CrownFill, CopyrightCircleFill, CrownOutline, CustomerServiceTwoTone, CreditCardOutline, CustomerServiceOutline, DashboardTwoTone, CrownTwoTone, CreditCardTwoTone, CustomerServiceFill, DashboardFill, DashOutline, DatabaseOutline, DatabaseTwoTone, DatabaseFill, DashboardOutline, DeleteTwoTone, DeleteRowOutline, DeleteColumnOutline, DeliveredProcedureOutline, DeleteOutline, CopyrightCircleTwoTone, DesktopOutline, DeleteFill, DiffOutline, DiffFill, DeploymentUnitOutline, DiffTwoTone, DingtalkOutline, DollarCircleFill, DislikeFill, DingtalkSquareFill, DisconnectOutline, DollarCircleTwoTone, DollarOutline, DingtalkCircleFill, DislikeTwoTone, DollarTwoTone, DownCircleFill, DislikeOutline, DollarCircleOutline, DoubleLeftOutline, DownSquareFill, DownOutline, DownSquareOutline, DownSquareTwoTone, DownCircleTwoTone, DoubleRightOutline, DownCircleOutline, DownloadOutline, DotChartOutline, DribbbleCircleFill, DribbbleOutline, DribbbleSquareOutline, DropboxCircleFill, DingdingOutline, EditOutline, DribbbleSquareFill, DropboxSquareFill, EllipsisOutline, EnvironmentFill, EditFill, EnterOutline, EuroCircleFill, EuroTwoTone, EuroCircleOutline, EditTwoTone, EuroOutline, EnvironmentTwoTone, ExclamationCircleFill, ExpandAltOutline, EuroCircleTwoTone, ExclamationCircleTwoTone, EnvironmentOutline, ExperimentOutline, ExperimentFill, ExpandOutline, ExceptionOutline, ExportOutline, ExperimentTwoTone, ExclamationCircleOutline, ExclamationOutline, EyeFill, EyeInvisibleFill, EyeInvisibleTwoTone, DropboxOutline, DragOutline, FacebookOutline, FacebookFill, EyeTwoTone, EyeOutline, FastForwardFill, FieldBinaryOutline, FieldNumberOutline, FastBackwardOutline, FileAddFill, FastBackwardFill, FileExcelFill, FastForwardOutline, FieldStringOutline, FileDoneOutline, FileAddTwoTone, FileExcelTwoTone, FileExclamationFill, FileAddOutline, FileExclamationOutline, FieldTimeOutline, FileImageTwoTone, FileExcelOutline, FileExclamationTwoTone, FileImageFill, FileGifOutline, FileFill, FileMarkdownTwoTone, FileMarkdownOutline, FallOutline, FileImageOutline, EyeInvisibleOutline, FilePdfOutline, FileSearchOutline, FilePptTwoTone, FilePdfTwoTone, FileJpgOutline, FileTextFill, FilePptOutline, FileSyncOutline, FilePptFill, FileUnknownOutline, FileProtectOutline, FileTextTwoTone, FileWordFill, FileUnknownTwoTone, FileWordTwoTone, FileUnknownFill, FileTextOutline, FileZipFill, FilterTwoTone, FilterFill, FileWordOutline, FireOutline, FireTwoTone, FileZipOutline, FilterOutline, FlagTwoTone, FileTwoTone, FilePdfFill, FileOutline, FileMarkdownFill, FileZipTwoTone, FlagOutline, FolderAddTwoTone, FolderOpenFill, FireFill, FlagFill, FolderOutline, FolderViewOutline, FolderTwoTone, FontColorsOutline, FolderOpenTwoTone, FolderFill, ForwardOutline, FolderOpenOutline, ForkOutline, ForwardFill, FormatPainterOutline, FormatPainterFill, FormOutline, FrownFill, FrownTwoTone, FullscreenOutline, FontSizeOutline, FundFill, FunctionOutline, FundViewOutline, FullscreenExitOutline, GifOutline, FundProjectionScreenOutline, FundTwoTone, FolderAddFill, FunnelPlotTwoTone, GiftOutline, FunnelPlotFill, FundOutline, FrownOutline, GithubOutline, GoldFill, FolderAddOutline, GitlabFill, GiftFill, GitlabOutline, GoldTwoTone, GoogleCircleFill, GiftTwoTone, GooglePlusCircleFill, GoldOutline, GithubFill, GoogleOutline, GooglePlusOutline, GoogleSquareFill, GoldenFill, HddTwoTone, GooglePlusSquareFill, GlobalOutline, HeartOutline, HeartTwoTone, GroupOutline, HeartFill, HeatMapOutline, GatewayOutline, FunnelPlotOutline, HddFill, HomeFill, HighlightFill, HomeOutline, HistoryOutline, HighlightOutline, HddOutline, HourglassFill, HomeTwoTone, HourglassTwoTone, Html5Outline, Html5Fill, IdcardFill, Html5TwoTone, HourglassOutline, IdcardTwoTone, IdcardOutline, IeOutline, IeCircleFill, IeSquareFill, InboxOutline, ImportOutline, InfoCircleOutline, InfoCircleTwoTone, InsertRowAboveOutline, InsertRowRightOutline, InfoCircleFill, InfoOutline, InsertRowBelowOutline, HighlightTwoTone, InsuranceFill, InstagramFill, InteractionFill, InsertRowLeftOutline, InstagramOutline, InteractionOutline, ItalicOutline, InteractionTwoTone, LayoutOutline, IssuesCloseOutline, LayoutFill, LaptopOutline, LeftCircleFill, LayoutTwoTone, KeyOutline, LeftOutline, LeftCircleOutline, LeftSquareOutline, LeftSquareFill, LeftCircleTwoTone, LikeFill, LeftSquareTwoTone, LineOutline, LikeTwoTone, LinkedinOutline, LineChartOutline, LineHeightOutline, LinkedinFill, LinkOutline, LikeOutline, InsuranceOutline, Loading3QuartersOutline, LockFill, InsuranceTwoTone, MacCommandOutline, LockTwoTone, LoadingOutline, MailOutline, LoginOutline, MedicineBoxOutline, MailFill, MailTwoTone, MacCommandFill, ManOutline, MedicineBoxFill, MedicineBoxTwoTone, MediumCircleFill, MediumOutline, MehFill, MediumWorkmarkOutline, MenuFoldOutline, MehOutline, MediumSquareFill, MessageTwoTone, MehTwoTone, MergeCellsOutline, MinusCircleFill, MenuOutline, MenuUnfoldOutline, MessageFill, MinusCircleTwoTone, LockOutline, MinusOutline, MinusCircleOutline, LogoutOutline, MessageOutline, MoneyCollectFill, MinusSquareOutline, MinusSquareTwoTone, MobileOutline, MobileTwoTone, MoneyCollectOutline, MoreOutline, NotificationFill, NotificationOutline, MoneyCollectTwoTone, NodeIndexOutline, NodeExpandOutline, MonitorOutline, OrderedListOutline, NodeCollapseOutline, NumberOutline, PaperClipOutline, NotificationTwoTone, PauseCircleFill, PartitionOutline, PauseOutline, OneToOneOutline, PayCircleOutline, PayCircleFill, MinusSquareFill, PauseCircleOutline, PauseCircleTwoTone, PicCenterOutline, PicRightOutline, PercentageOutline, MobileFill, PictureOutline, PictureFill, PhoneTwoTone, PhoneFill, PieChartFill, PictureTwoTone, PieChartOutline, PlaySquareFill, PlayCircleTwoTone, PlayCircleFill, PlusCircleFill, PlaySquareTwoTone, PlaySquareOutline, PlayCircleOutline, PieChartTwoTone, PlusCircleOutline, PlusSquareFill, PoundCircleFill, PlusSquareOutline, PlusOutline, PoundOutline, PoundCircleOutline, PlusSquareTwoTone, PlusCircleTwoTone, PoweroffOutline, PoundCircleTwoTone, PhoneOutline, PrinterFill, PicLeftOutline, ProjectTwoTone, PrinterOutline, ProjectFill, ProfileOutline, ProfileTwoTone, ProjectOutline, PropertySafetyFill, PullRequestOutline, PropertySafetyOutline, PushpinOutline, PushpinTwoTone, PropertySafetyTwoTone, PushpinFill, QqOutline, QqCircleFill, QrcodeOutline, QqSquareFill, QuestionCircleTwoTone, QuestionCircleFill, RadarChartOutline, RadiusUprightOutline, QuestionCircleOutline, QuestionOutline, ReadFill, RadiusUpleftOutline, RadiusBottomleftOutline, RadiusSettingOutline, RadiusBottomrightOutline, ProfileFill, PrinterTwoTone, ReadOutline, ReconciliationFill, ReloadOutline, ReconciliationOutline, RedEnvelopeTwoTone, RedditCircleFill, RedoOutline, RedEnvelopeFill, RedditOutline, RestTwoTone, RightCircleOutline, RestOutline, RedditSquareFill, RestFill, RightCircleTwoTone, RightOutline, RightSquareFill, RightCircleFill, RightSquareOutline, RetweetOutline, RiseOutline, RightSquareTwoTone, RobotFill, RocketOutline, RobotOutline, RocketTwoTone, RocketFill, RedEnvelopeOutline, RollbackOutline, RotateRightOutline, RotateLeftOutline, ReconciliationTwoTone, SafetyCertificateTwoTone, SaveOutline, SafetyOutline, SaveFill, SaveTwoTone, ScheduleFill, SafetyCertificateOutline, ScanOutline, ScheduleTwoTone, SearchOutline, ScheduleOutline, SecurityScanTwoTone, SecurityScanOutline, ScissorOutline, SelectOutline, SecurityScanFill, SendOutline, SettingOutline, SettingTwoTone, SettingFill, ShareAltOutline, ShopOutline, ShopFill, ShopTwoTone, ShrinkOutline, ShakeOutline, ShoppingOutline, ShoppingCartOutline, ShoppingFill, SisternodeOutline, ShoppingTwoTone, SafetyCertificateFill, SkinOutline, SignalFill, SketchOutline, SkinTwoTone, SketchSquareFill, SkypeFill, SkinFill, SlackCircleFill, SlackSquareFill, SlidersTwoTone, SkypeOutline, SlidersFill, SlackSquareOutline, SmallDashOutline, SmileTwoTone, SlidersOutline, SnippetsFill, SnippetsOutline, SmileOutline, SolutionOutline, SlackOutline, SnippetsTwoTone, SoundTwoTone, SortAscendingOutline, SoundFill, SortDescendingOutline, SmileFill, SoundOutline, SplitCellsOutline, SketchCircleFill, StarOutline, StockOutline, StarTwoTone, StepForwardFill, StarFill, StepBackwardFill, StepForwardOutline, StopFill, SubnodeOutline, SwapLeftOutline, StopOutline, StopTwoTone, SwapRightOutline, SwapOutline, SwitcherTwoTone, SwitcherOutline, SyncOutline, StrikethroughOutline, SwitcherFill, TagOutline, TabletTwoTone, TabletOutline, TabletFill, TableOutline, TagsFill, TagFill, TagsTwoTone, TaobaoCircleOutline, StepBackwardOutline, TagsOutline, TagTwoTone, TaobaoOutline, ThunderboltOutline, TaobaoSquareFill, TeamOutline, TaobaoCircleFill, ThunderboltTwoTone, ToolFill, ThunderboltFill, ToTopOutline, ToolOutline, ToolTwoTone, TrademarkCircleFill, TrophyFill, TrademarkCircleTwoTone, TransactionOutline, TrademarkCircleOutline, TranslationOutline, TwitterCircleFill, TrophyOutline, TrademarkOutline, TrophyTwoTone, TwitterSquareFill, UnlockFill, TwitterOutline, UnderlineOutline, UndoOutline, UpCircleFill, UngroupOutline, UnlockTwoTone, UnlockOutline, UpOutline, UsbFill, UpCircleOutline, UnorderedListOutline, UpCircleTwoTone, UpSquareFill, UpSquareOutline, UserAddOutline, UsbTwoTone, UsergroupDeleteOutline, UpSquareTwoTone, UserOutline, UsbOutline, UserDeleteOutline, UserSwitchOutline, VerticalLeftOutline, VerticalAlignBottomOutline, VerifiedOutline, UsergroupAddOutline, UploadOutline, VerticalAlignMiddleOutline, VerticalAlignTopOutline, VerticalRightOutline, VideoCameraOutline, VideoCameraAddOutline, VideoCameraTwoTone, VideoCameraFill, WalletOutline, WalletFill, WarningFill, WarningOutline, WechatOutline, WalletTwoTone, WeiboCircleFill, WarningTwoTone, WeiboSquareFill, WeiboOutline, WeiboSquareOutline, WeiboCircleOutline, WechatFill, WhatsAppOutline, WifiOutline, WomanOutline, YoutubeFill, YahooOutline, WindowsFill, WindowsOutline, YoutubeOutline, YuqueOutline, ZhihuCircleFill, YuqueFill, ZhihuOutline, ZhihuSquareFill, ZoomInOutline, ZoomOutOutline, YahooFill } from '@ant-design/icons-angular/icons';
62
61
  import * as i3$4 from '@yelon/acl';
63
62
 
64
- var NavType;
65
- (function (NavType) {
66
- NavType["APPLICATION"] = "application";
67
- NavType["GROUP"] = "group";
68
- NavType["TILE"] = "tile";
69
- })(NavType || (NavType = {}));
70
-
71
63
  class YunzaiClearStorageComponent {
72
64
  constructor(modalSrv, messageSrv) {
73
65
  this.modalSrv = modalSrv;
@@ -82,13 +74,13 @@ class YunzaiClearStorageComponent {
82
74
  }
83
75
  });
84
76
  }
85
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiClearStorageComponent, deps: [{ token: i1.NzModalService }, { token: i1$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component }); }
86
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage", host: { listeners: { "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
77
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiClearStorageComponent, deps: [{ token: i1.NzModalService }, { token: i1$1.NzMessageService }], target: i0.ɵɵFactoryTarget.Component }); }
78
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage", host: { listeners: { "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
87
79
  <i nz-icon nzType="tool"></i>
88
80
  {{ 'storage.clear' | i18n }}
89
- `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
81
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
90
82
  }
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiClearStorageComponent, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiClearStorageComponent, decorators: [{
92
84
  type: Component,
93
85
  args: [{
94
86
  selector: 'yunzai-clearstorage',
@@ -118,13 +110,13 @@ class YunzaiFullScreenComponent {
118
110
  screenfull.toggle();
119
111
  }
120
112
  }
121
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiFullScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
122
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen", host: { listeners: { "window:resize": "_resize()", "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
113
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiFullScreenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
114
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen", host: { listeners: { "window:resize": "_resize()", "click": "_click()" }, properties: { "class.d-block": "true" } }, ngImport: i0, template: `
123
115
  <i nz-icon [nzType]="status ? 'fullscreen-exit' : 'fullscreen'"></i>
124
116
  {{ (status ? 'exitFullscreen' : 'fullscreen') | i18n }}
125
- `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
117
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
126
118
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiFullScreenComponent, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiFullScreenComponent, decorators: [{
128
120
  type: Component,
129
121
  args: [{
130
122
  selector: 'yunzai-fullscreen',
@@ -257,14 +249,13 @@ const YUNZAI_LANGS = {
257
249
 
258
250
  const DEFAULT = 'zh-CN';
259
251
  class YunzaiI18NService extends YunzaiI18nBaseService {
260
- constructor(http, settings, nzI18nService, yelonLocaleService, platform, cogSrv, cacheService) {
252
+ constructor(http, settings, nzI18nService, yelonLocaleService, platform, cogSrv) {
261
253
  super(cogSrv);
262
254
  this.http = http;
263
255
  this.settings = settings;
264
256
  this.nzI18nService = nzI18nService;
265
257
  this.yelonLocaleService = yelonLocaleService;
266
258
  this.platform = platform;
267
- this.cacheService = cacheService;
268
259
  this._defaultLang = DEFAULT;
269
260
  this.destroy$ = new Subject();
270
261
  const defaultLang = this.getDefaultLang();
@@ -343,31 +334,31 @@ class YunzaiI18NService extends YunzaiI18nBaseService {
343
334
  }
344
335
  }
345
336
  cacheLang(lang, data) {
346
- const key = `_yz_lang_${lang}`;
347
- this.cacheService.set(key, data);
337
+ const [setLang,] = useLocalStorageLang();
338
+ setLang(lang, data);
348
339
  }
349
340
  getLang(lang) {
350
- const key = `_yz_lang_${lang}`;
351
- return this.cacheService.get(key, { mode: 'none' });
341
+ const [, getL] = useLocalStorageLang();
342
+ return getL(lang) || {};
352
343
  }
353
344
  cacheLangs(langs) {
354
- const key = `_yz_langs`;
355
- this.cacheService.set(key, langs);
345
+ const [setLangs,] = useLocalStorageLangs();
346
+ setLangs(langs);
356
347
  }
357
348
  getCachedLangs() {
358
- const key = `_yz_langs`;
359
- return this.cacheService.get(key, { mode: 'none' }) || [];
349
+ const [, getLangs] = useLocalStorageLangs();
350
+ return getLangs() || [];
360
351
  }
361
352
  ngOnDestroy() {
362
353
  this.destroy$.complete();
363
354
  }
364
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiI18NService, deps: [{ token: i1$2._HttpClient }, { token: i1$2.SettingsService }, { token: i2.NzI18nService }, { token: i1$2.YelonLocaleService }, { token: i3$1.Platform }, { token: i4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Injectable }); }
365
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiI18NService, providedIn: 'root' }); }
355
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiI18NService, deps: [{ token: i1$2._HttpClient }, { token: i1$2.SettingsService }, { token: i2.NzI18nService }, { token: i1$2.YelonLocaleService }, { token: i3$1.Platform }, { token: i4.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
356
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiI18NService, providedIn: 'root' }); }
366
357
  }
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiI18NService, decorators: [{
358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiI18NService, decorators: [{
368
359
  type: Injectable,
369
360
  args: [{ providedIn: 'root' }]
370
- }], ctorParameters: function () { return [{ type: i1$2._HttpClient }, { type: i1$2.SettingsService }, { type: i2.NzI18nService }, { type: i1$2.YelonLocaleService }, { type: i3$1.Platform }, { type: i4.YunzaiConfigService }, { type: i1$3.CacheService }]; } });
361
+ }], ctorParameters: function () { return [{ type: i1$2._HttpClient }, { type: i1$2.SettingsService }, { type: i2.NzI18nService }, { type: i1$2.YelonLocaleService }, { type: i3$1.Platform }, { type: i4.YunzaiConfigService }]; } });
371
362
 
372
363
  class YunzaiI18NComponent {
373
364
  get curLangCode() {
@@ -402,8 +393,8 @@ class YunzaiI18NComponent {
402
393
  ngOnDestroy() {
403
394
  this.destroy$.complete();
404
395
  }
405
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiI18NComponent, deps: [{ token: i1$2.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
406
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
396
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiI18NComponent, deps: [{ token: i1$2.SettingsService }, { token: YUNZAI_I18N_TOKEN }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
397
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: { showLangText: "showLangText" }, ngImport: i0, template: `
407
398
  <div *ngIf="showLangText" nz-dropdown [nzDropdownMenu]="langMenu" nzPlacement="bottomRight">
408
399
  <i nz-icon nzType="global"></i>
409
400
  {{ 'lang.nav' | i18n }}
@@ -441,12 +432,12 @@ class YunzaiI18NComponent {
441
432
  </li>
442
433
  </ul>
443
434
  </nz-dropdown-menu>
444
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
435
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i4$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i4$1.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i5.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
445
436
  }
446
437
  __decorate([
447
438
  InputBoolean()
448
439
  ], YunzaiI18NComponent.prototype, "showLangText", void 0);
449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiI18NComponent, decorators: [{
440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiI18NComponent, decorators: [{
450
441
  type: Component,
451
442
  args: [{
452
443
  selector: 'yunzai-i18n',
@@ -637,8 +628,8 @@ class YunzaiNotifyComponent {
637
628
  ngOnDestroy() {
638
629
  this.subs.forEach(a => a.unsubscribe());
639
630
  }
640
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiNotifyComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YUNZAI_I18N_TOKEN }, { token: i2.NzI18nService }, { token: i0.ChangeDetectorRef }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
641
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiNotifyComponent, selector: "yunzai-notify", ngImport: i0, template: `
631
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiNotifyComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YUNZAI_I18N_TOKEN }, { token: i2.NzI18nService }, { token: i0.ChangeDetectorRef }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
632
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiNotifyComponent, selector: "yunzai-notify", ngImport: i0, template: `
642
633
  <notice-icon
643
634
  [data]="data"
644
635
  [count]="count"
@@ -650,7 +641,7 @@ class YunzaiNotifyComponent {
650
641
  ></notice-icon>
651
642
  `, isInline: true, dependencies: [{ kind: "component", type: i4$2.NoticeIconComponent, selector: "notice-icon", inputs: ["data", "count", "loading", "popoverVisible", "btnClass", "btnIconClass", "centered"], outputs: ["select", "clear", "popoverVisibleChange"], exportAs: ["noticeIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
652
643
  }
653
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiNotifyComponent, decorators: [{
644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiNotifyComponent, decorators: [{
654
645
  type: Component,
655
646
  args: [{
656
647
  selector: 'yunzai-notify',
@@ -748,8 +739,8 @@ class YunzaiThemBtnComponent {
748
739
  this.destroy$.next();
749
740
  this.destroy$.complete();
750
741
  }
751
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiThemBtnComponent, deps: [{ token: i0.Renderer2 }, { token: i4.YunzaiConfigService }, { token: i3$1.Platform }, { token: DOCUMENT }, { token: i3$2.Directionality, optional: true }, { token: YUNZAI_THEME_BTN_KEYS }], target: i0.ɵɵFactoryTarget.Component }); }
752
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiThemBtnComponent, selector: "yunzai-theme-btn", inputs: { types: "types", devTips: "devTips", deployUrl: "deployUrl" }, ngImport: i0, template: `
742
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiThemBtnComponent, deps: [{ token: i0.Renderer2 }, { token: i4.YunzaiConfigService }, { token: i3$1.Platform }, { token: DOCUMENT }, { token: i3$3.Directionality, optional: true }, { token: YUNZAI_THEME_BTN_KEYS }], target: i0.ɵɵFactoryTarget.Component }); }
743
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiThemBtnComponent, selector: "yunzai-theme-btn", inputs: { types: "types", devTips: "devTips", deployUrl: "deployUrl" }, ngImport: i0, template: `
753
744
  <div
754
745
  data-event-id="_nav_theme"
755
746
  class="yunzai-default__nav-item"
@@ -791,9 +782,9 @@ class YunzaiThemBtnComponent {
791
782
  <!-- </div>-->
792
783
  <!-- </div>-->
793
784
  </nz-dropdown-menu>
794
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8$1.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
785
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i4$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i4$1.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i5.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
795
786
  }
796
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiThemBtnComponent, decorators: [{
787
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiThemBtnComponent, decorators: [{
797
788
  type: Component,
798
789
  args: [{
799
790
  selector: 'yunzai-theme-btn',
@@ -845,7 +836,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
845
836
  }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i4.YunzaiConfigService }, { type: i3$1.Platform }, { type: undefined, decorators: [{
846
837
  type: Inject,
847
838
  args: [DOCUMENT]
848
- }] }, { type: i3$2.Directionality, decorators: [{
839
+ }] }, { type: i3$3.Directionality, decorators: [{
849
840
  type: Optional
850
841
  }] }, { type: undefined, decorators: [{
851
842
  type: Inject,
@@ -861,20 +852,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
861
852
  class YunzaiUserComponent {
862
853
  constructor(injector, msg, tokenService,
863
854
  // @ts-ignore
864
- configService, cacheService) {
855
+ configService) {
865
856
  this.injector = injector;
866
857
  this.msg = msg;
867
858
  this.tokenService = tokenService;
868
859
  this.configService = configService;
869
- this.cacheService = cacheService;
870
860
  this.icon = '';
871
861
  this.username = '';
872
862
  this.menus = [];
873
863
  this.config = mergeBisConfig(configService);
874
864
  }
875
865
  ngOnInit() {
876
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
877
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
866
+ const [, getProjectInfo] = useLocalStorageProjectInfo();
867
+ const [, getUser] = useLocalStorageUser();
868
+ const projectInfo = getProjectInfo();
869
+ const user = getUser();
878
870
  this.username = user.realname ? user.realname : '未命名';
879
871
  this.icon = user.avatarId
880
872
  ? `${this.config.baseUrl}/filecenter/file/${user.avatarId}`
@@ -894,8 +886,8 @@ class YunzaiUserComponent {
894
886
  this.msg.error('该菜单没有配置链接!');
895
887
  }
896
888
  }
897
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiUserComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YA_SERVICE_TOKEN }, { token: i1$4.YunzaiConfigService }, { token: i1$3.CacheService }], target: i0.ɵɵFactoryTarget.Component }); }
898
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiUserComponent, selector: "yunzai-user", ngImport: i0, template: `
889
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiUserComponent, deps: [{ token: i0.Injector }, { token: i1$1.NzMessageService }, { token: YA_SERVICE_TOKEN }, { token: i1$3.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Component }); }
890
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiUserComponent, selector: "yunzai-user", ngImport: i0, template: `
899
891
  <div
900
892
  class="yunzai-default__nav-item d-flex align-items-center px-sm"
901
893
  data-event-id="_nav_user"
@@ -927,9 +919,9 @@ class YunzaiUserComponent {
927
919
  </div>
928
920
  </div>
929
921
  </nz-dropdown-menu>
930
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i6.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i9.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
922
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i4$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i4$1.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i4$1.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i5.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i8$1.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
931
923
  }
932
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiUserComponent, decorators: [{
924
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiUserComponent, decorators: [{
933
925
  type: Component,
934
926
  args: [{
935
927
  selector: 'yunzai-user',
@@ -971,11 +963,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
971
963
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$1.NzMessageService }, { type: undefined, decorators: [{
972
964
  type: Inject,
973
965
  args: [YA_SERVICE_TOKEN]
974
- }] }, { type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }]; } });
966
+ }] }, { type: i1$3.YunzaiConfigService }]; } });
975
967
 
976
968
  class LayoutNavApplicationComponent {
977
- constructor(cacheService, i18n, http, inject) {
978
- this.cacheService = cacheService;
969
+ constructor(i18n, http, inject) {
979
970
  this.i18n = i18n;
980
971
  this.http = http;
981
972
  this.inject = inject;
@@ -994,7 +985,8 @@ class LayoutNavApplicationComponent {
994
985
  this.attachNav('all');
995
986
  }
996
987
  fetchAllTopic() {
997
- this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
988
+ const [, getTopics] = useLocalStorageHeader();
989
+ this.state.topics = getTopics();
998
990
  }
999
991
  attachNav(type, topic) {
1000
992
  this.state.type = type;
@@ -1013,11 +1005,12 @@ class LayoutNavApplicationComponent {
1013
1005
  this.state.search = null;
1014
1006
  }
1015
1007
  displayAllNav() {
1016
- this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
1008
+ const [, getTopics] = useLocalStorageHeader();
1009
+ this.state.list = getTopics();
1017
1010
  }
1018
1011
  displayMineNav() {
1019
- const temp = this.cacheService.get('_yz_header', { mode: 'none' });
1020
- this.state.list = temp
1012
+ const [, getTopics] = useLocalStorageHeader();
1013
+ this.state.list = getTopics()
1021
1014
  .filter((topic) => {
1022
1015
  topic.children = topic.children.filter((child) => {
1023
1016
  return child.auth;
@@ -1029,8 +1022,9 @@ class LayoutNavApplicationComponent {
1029
1022
  });
1030
1023
  }
1031
1024
  displayOtherNav(topic) {
1025
+ const [, getTopics] = useLocalStorageHeader();
1032
1026
  this.state.topic = topic;
1033
- const temp = this.cacheService.get('_yz_header', { mode: 'none' });
1027
+ const temp = getTopics();
1034
1028
  this.state.list = temp.filter(t => t.key === topic.key)[0].children;
1035
1029
  }
1036
1030
  diffChange(flag) {
@@ -1067,7 +1061,8 @@ class LayoutNavApplicationComponent {
1067
1061
  }
1068
1062
  }
1069
1063
  onSearch() {
1070
- const temp = this.cacheService.get('_yz_header', { mode: 'none' });
1064
+ const [, getTopics] = useLocalStorageHeader();
1065
+ const temp = getTopics();
1071
1066
  if (this.state.search) {
1072
1067
  this.state.list = temp
1073
1068
  .filter((topic) => {
@@ -1086,14 +1081,15 @@ class LayoutNavApplicationComponent {
1086
1081
  });
1087
1082
  }
1088
1083
  else {
1089
- this.state.list = this.cacheService.get('_yz_header', { mode: 'none' });
1084
+ const [, getTopics] = useLocalStorageHeader();
1085
+ this.state.list = getTopics();
1090
1086
  }
1091
1087
  }
1092
1088
  ngOnDestroy() {
1093
1089
  this.state.destroy$.complete();
1094
1090
  }
1095
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: i1$3.CacheService }, { token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
1096
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: LayoutNavApplicationComponent, selector: "layout-nav-application", ngImport: i0, template: `
1091
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: LayoutNavApplicationComponent, deps: [{ token: YunzaiI18NService }, { token: i1$2._HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
1092
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: LayoutNavApplicationComponent, selector: "layout-nav-application", ngImport: i0, template: `
1097
1093
  <!-- search start-->
1098
1094
  <ng-template #search>
1099
1095
  <div nz-row class="yz-application-list-search">
@@ -1126,7 +1122,7 @@ class LayoutNavApplicationComponent {
1126
1122
  href="javascript:;"
1127
1123
  *ngFor="let nav of topic.children"
1128
1124
  (click)="open(nav)"
1129
- >{{ nav.name | i18n }}</a
1125
+ >{{ nav.name | i18n }}</a
1130
1126
  >
1131
1127
  </li>
1132
1128
  </ul>
@@ -1143,17 +1139,17 @@ class LayoutNavApplicationComponent {
1143
1139
  <div nz-col [nzSpan]="3" class="yz-application-topic">
1144
1140
  <div data-event-id="_nav_topic" data-name="全部应用" class="yz-application-text" (click)="attachNav('all')">{{
1145
1141
  'mode.nav.all' | i18n
1146
- }}</div>
1142
+ }}</div>
1147
1143
  <div data-event-id="_nav_topic" data-name="我的应用" class="yz-application-text" (click)="attachNav('mine')">{{
1148
1144
  'mode.nav.mine' | i18n
1149
- }}</div>
1145
+ }}</div>
1150
1146
  <div
1151
1147
  data-event-id="_nav_topic"
1152
1148
  [attr.data-name]="nav.name | i18n"
1153
1149
  class="yz-application-text"
1154
1150
  *ngFor="let nav of state.topics"
1155
1151
  (click)="attachNav('other', nav)"
1156
- >{{ nav.name | i18n }}</div
1152
+ >{{ nav.name | i18n }}</div
1157
1153
  >
1158
1154
  </div>
1159
1155
  <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
@@ -1185,9 +1181,9 @@ class LayoutNavApplicationComponent {
1185
1181
  </div>
1186
1182
  </div>
1187
1183
  <!-- header end-->
1188
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i7$1.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i7$1.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i9$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i9$1.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i9$1.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] }); }
1184
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i6.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: i8$2.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i8$2.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i8$2.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] }); }
1189
1185
  }
1190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: LayoutNavApplicationComponent, decorators: [{
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: LayoutNavApplicationComponent, decorators: [{
1191
1187
  type: Component,
1192
1188
  args: [{
1193
1189
  selector: `layout-nav-application`,
@@ -1224,7 +1220,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
1224
1220
  href="javascript:;"
1225
1221
  *ngFor="let nav of topic.children"
1226
1222
  (click)="open(nav)"
1227
- >{{ nav.name | i18n }}</a
1223
+ >{{ nav.name | i18n }}</a
1228
1224
  >
1229
1225
  </li>
1230
1226
  </ul>
@@ -1241,17 +1237,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
1241
1237
  <div nz-col [nzSpan]="3" class="yz-application-topic">
1242
1238
  <div data-event-id="_nav_topic" data-name="全部应用" class="yz-application-text" (click)="attachNav('all')">{{
1243
1239
  'mode.nav.all' | i18n
1244
- }}</div>
1240
+ }}</div>
1245
1241
  <div data-event-id="_nav_topic" data-name="我的应用" class="yz-application-text" (click)="attachNav('mine')">{{
1246
1242
  'mode.nav.mine' | i18n
1247
- }}</div>
1243
+ }}</div>
1248
1244
  <div
1249
1245
  data-event-id="_nav_topic"
1250
1246
  [attr.data-name]="nav.name | i18n"
1251
1247
  class="yz-application-text"
1252
1248
  *ngFor="let nav of state.topics"
1253
1249
  (click)="attachNav('other', nav)"
1254
- >{{ nav.name | i18n }}</div
1250
+ >{{ nav.name | i18n }}</div
1255
1251
  >
1256
1252
  </div>
1257
1253
  <div nz-col [nzSpan]="21" [ngSwitch]="state.topic" class="yz-application-container">
@@ -1285,12 +1281,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
1285
1281
  <!-- header end-->
1286
1282
  `
1287
1283
  }]
1288
- }], ctorParameters: function () { return [{ type: i1$3.CacheService }, { type: YunzaiI18NService }, { type: i1$2._HttpClient }, { type: i0.Injector }]; } });
1284
+ }], ctorParameters: function () { return [{ type: YunzaiI18NService }, { type: i1$2._HttpClient }, { type: i0.Injector }]; } });
1289
1285
 
1290
1286
  class LayoutNavGroupComponent {
1291
- constructor(inject, cacheService, http) {
1287
+ constructor(inject, http) {
1292
1288
  this.inject = inject;
1293
- this.cacheService = cacheService;
1294
1289
  this.http = http;
1295
1290
  this.state = {
1296
1291
  topics: [],
@@ -1298,7 +1293,8 @@ class LayoutNavGroupComponent {
1298
1293
  };
1299
1294
  }
1300
1295
  ngOnInit() {
1301
- this.state.topics = this.cacheService.get('_yz_header', { mode: 'none' });
1296
+ const [, getTopics] = useLocalStorageHeader();
1297
+ this.state.topics = getTopics() || [];
1302
1298
  }
1303
1299
  open(topic) {
1304
1300
  if (topic.key) {
@@ -1328,83 +1324,89 @@ class LayoutNavGroupComponent {
1328
1324
  ngOnDestroy() {
1329
1325
  this.state.destroy$.complete();
1330
1326
  }
1331
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: LayoutNavGroupComponent, deps: [{ token: i0.Injector }, { token: i1$3.CacheService }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
1332
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: LayoutNavGroupComponent, selector: "layout-nav-group", ngImport: i0, template: `
1333
- <div class="yz-application-group">
1334
- <nz-tabset>
1335
- <nz-tab *ngFor="let menu of state.topics" [nzTitle]="groupTitleTpl">
1336
- <ng-template #groupTitleTpl>
1337
- <a
1338
- data-event-id="_nav_topic"
1339
- [attr.data-name]="menu.name | i18n"
1340
- nz-dropdown
1341
- [nzDropdownMenu]="menuTpl"
1342
- [nzTrigger]="'click'"
1343
- [nzOverlayClassName]="'yz-application-dropdown'"
1344
- >
1345
- <i nz-icon *ngIf="menu.icon" [nzType]="menu.icon" nzTheme="outline"></i>
1346
- {{ menu.name | i18n }}
1347
- <i *ngIf="menu.children && menu.children.length > 0" nz-icon nzType="down" nzTheme="outline"></i>
1348
- </a>
1349
- <nz-dropdown-menu #menuTpl="nzDropdownMenu">
1350
- <ul nz-menu nzSelectable *ngIf="menu.children && menu.children.length > 0">
1351
- <ng-container *ngFor="let item of menu.children">
1352
- <li data-event-id="_nav_item" [attr.data-name]="item.name | i18n" nz-menu-item (click)="open(item)">
1353
- <i nz-icon *ngIf="item.icon" [nzType]="item.icon" nzTheme="outline"></i>{{ item.name | i18n }}
1354
- </li>
1355
- </ng-container>
1356
- </ul>
1357
- </nz-dropdown-menu>
1358
- </ng-template>
1359
- </nz-tab>
1360
- </nz-tabset>
1361
- </div>
1362
- `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "directive", type: i7.NzDropDownADirective, selector: "a[nz-dropdown]" }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i8$2.NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { kind: "component", type: i8$2.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] }); }
1327
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: LayoutNavGroupComponent, deps: [{ token: i0.Injector }, { token: i1$2._HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
1328
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: LayoutNavGroupComponent, selector: "layout-nav-group", ngImport: i0, template: `
1329
+ <div class="yz-application-group">
1330
+ <nz-tabset>
1331
+ <nz-tab *ngFor="let menu of state.topics" [nzTitle]="groupTitleTpl">
1332
+ <ng-template #groupTitleTpl>
1333
+ <a
1334
+ data-event-id="_nav_topic"
1335
+ [attr.data-name]="menu.name | i18n"
1336
+ nz-dropdown
1337
+ [nzDropdownMenu]="menuTpl"
1338
+ [nzTrigger]="'click'"
1339
+ [nzOverlayClassName]="'yz-application-dropdown'"
1340
+ >
1341
+ <i nz-icon *ngIf="menu.icon" [nzType]="menu.icon" nzTheme="outline"></i>
1342
+ {{ menu.name | i18n }}
1343
+ <i *ngIf="menu.children && menu.children.length > 0" nz-icon nzType="down"
1344
+ nzTheme="outline"></i>
1345
+ </a>
1346
+ <nz-dropdown-menu #menuTpl="nzDropdownMenu">
1347
+ <ul nz-menu nzSelectable *ngIf="menu.children && menu.children.length > 0">
1348
+ <ng-container *ngFor="let item of menu.children">
1349
+ <li data-event-id="_nav_item" [attr.data-name]="item.name | i18n" nz-menu-item
1350
+ (click)="open(item)">
1351
+ <i nz-icon *ngIf="item.icon" [nzType]="item.icon"
1352
+ nzTheme="outline"></i>{{ item.name | i18n }}
1353
+ </li>
1354
+ </ng-container>
1355
+ </ul>
1356
+ </nz-dropdown-menu>
1357
+ </ng-template>
1358
+ </nz-tab>
1359
+ </nz-tabset>
1360
+ </div>
1361
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i4$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i4$1.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i5.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "directive", type: i5.NzDropDownADirective, selector: "a[nz-dropdown]" }, { kind: "component", type: i5.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i7$1.NzTabSetComponent, selector: "nz-tabset", inputs: ["nzSelectedIndex", "nzTabPosition", "nzTabBarExtraContent", "nzCanDeactivate", "nzAddIcon", "nzTabBarStyle", "nzType", "nzSize", "nzAnimated", "nzTabBarGutter", "nzHideAdd", "nzCentered", "nzHideAll", "nzLinkRouter", "nzLinkExact"], outputs: ["nzSelectChange", "nzSelectedIndexChange", "nzTabListScroll", "nzClose", "nzAdd"], exportAs: ["nzTabset"] }, { kind: "component", type: i7$1.NzTabComponent, selector: "nz-tab", inputs: ["nzTitle", "nzClosable", "nzCloseIcon", "nzDisabled", "nzForceRender"], outputs: ["nzSelect", "nzDeselect", "nzClick", "nzContextmenu"], exportAs: ["nzTab"] }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] }); }
1363
1362
  }
1364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: LayoutNavGroupComponent, decorators: [{
1363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: LayoutNavGroupComponent, decorators: [{
1365
1364
  type: Component,
1366
1365
  args: [{
1367
1366
  selector: `layout-nav-group`,
1368
1367
  template: `
1369
- <div class="yz-application-group">
1370
- <nz-tabset>
1371
- <nz-tab *ngFor="let menu of state.topics" [nzTitle]="groupTitleTpl">
1372
- <ng-template #groupTitleTpl>
1373
- <a
1374
- data-event-id="_nav_topic"
1375
- [attr.data-name]="menu.name | i18n"
1376
- nz-dropdown
1377
- [nzDropdownMenu]="menuTpl"
1378
- [nzTrigger]="'click'"
1379
- [nzOverlayClassName]="'yz-application-dropdown'"
1380
- >
1381
- <i nz-icon *ngIf="menu.icon" [nzType]="menu.icon" nzTheme="outline"></i>
1382
- {{ menu.name | i18n }}
1383
- <i *ngIf="menu.children && menu.children.length > 0" nz-icon nzType="down" nzTheme="outline"></i>
1384
- </a>
1385
- <nz-dropdown-menu #menuTpl="nzDropdownMenu">
1386
- <ul nz-menu nzSelectable *ngIf="menu.children && menu.children.length > 0">
1387
- <ng-container *ngFor="let item of menu.children">
1388
- <li data-event-id="_nav_item" [attr.data-name]="item.name | i18n" nz-menu-item (click)="open(item)">
1389
- <i nz-icon *ngIf="item.icon" [nzType]="item.icon" nzTheme="outline"></i>{{ item.name | i18n }}
1390
- </li>
1391
- </ng-container>
1392
- </ul>
1393
- </nz-dropdown-menu>
1394
- </ng-template>
1395
- </nz-tab>
1396
- </nz-tabset>
1397
- </div>
1398
- `
1368
+ <div class="yz-application-group">
1369
+ <nz-tabset>
1370
+ <nz-tab *ngFor="let menu of state.topics" [nzTitle]="groupTitleTpl">
1371
+ <ng-template #groupTitleTpl>
1372
+ <a
1373
+ data-event-id="_nav_topic"
1374
+ [attr.data-name]="menu.name | i18n"
1375
+ nz-dropdown
1376
+ [nzDropdownMenu]="menuTpl"
1377
+ [nzTrigger]="'click'"
1378
+ [nzOverlayClassName]="'yz-application-dropdown'"
1379
+ >
1380
+ <i nz-icon *ngIf="menu.icon" [nzType]="menu.icon" nzTheme="outline"></i>
1381
+ {{ menu.name | i18n }}
1382
+ <i *ngIf="menu.children && menu.children.length > 0" nz-icon nzType="down"
1383
+ nzTheme="outline"></i>
1384
+ </a>
1385
+ <nz-dropdown-menu #menuTpl="nzDropdownMenu">
1386
+ <ul nz-menu nzSelectable *ngIf="menu.children && menu.children.length > 0">
1387
+ <ng-container *ngFor="let item of menu.children">
1388
+ <li data-event-id="_nav_item" [attr.data-name]="item.name | i18n" nz-menu-item
1389
+ (click)="open(item)">
1390
+ <i nz-icon *ngIf="item.icon" [nzType]="item.icon"
1391
+ nzTheme="outline"></i>{{ item.name | i18n }}
1392
+ </li>
1393
+ </ng-container>
1394
+ </ul>
1395
+ </nz-dropdown-menu>
1396
+ </ng-template>
1397
+ </nz-tab>
1398
+ </nz-tabset>
1399
+ </div>
1400
+ `
1399
1401
  }]
1400
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$3.CacheService }, { type: i1$2._HttpClient }]; } });
1402
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$2._HttpClient }]; } });
1401
1403
 
1402
1404
  class LayoutNavTileComponent {
1403
1405
  constructor() { }
1404
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: LayoutNavTileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1405
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: LayoutNavTileComponent, selector: "layout-nav-tile", ngImport: i0, template: `<template></template>`, isInline: true }); }
1406
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: LayoutNavTileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1407
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: LayoutNavTileComponent, selector: "layout-nav-tile", ngImport: i0, template: `<template></template>`, isInline: true }); }
1406
1408
  }
1407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: LayoutNavTileComponent, decorators: [{
1409
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: LayoutNavTileComponent, decorators: [{
1408
1410
  type: Component,
1409
1411
  args: [{
1410
1412
  selector: `layout-nav-tile`,
@@ -1441,9 +1443,8 @@ class YunzaiLayoutBasicComponent {
1441
1443
  }
1442
1444
  return cascadingStyleSheet;
1443
1445
  }
1444
- constructor(layoutDisplayService, cacheService, stompService, win) {
1446
+ constructor(layoutDisplayService, stompService, win) {
1445
1447
  this.layoutDisplayService = layoutDisplayService;
1446
- this.cacheService = cacheService;
1447
1448
  this.stompService = stompService;
1448
1449
  this.win = win;
1449
1450
  this.NavType = NavType;
@@ -1476,7 +1477,8 @@ class YunzaiLayoutBasicComponent {
1476
1477
  this.toIndex();
1477
1478
  }
1478
1479
  initFavicon() {
1479
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1480
+ const [, getProjectInfo] = useLocalStorageProjectInfo();
1481
+ const projectInfo = getProjectInfo();
1480
1482
  if (projectInfo.faviconUrl) {
1481
1483
  hasFavicon(projectInfo.faviconUrl).then((has) => {
1482
1484
  if (has) {
@@ -1489,24 +1491,26 @@ class YunzaiLayoutBasicComponent {
1489
1491
  }
1490
1492
  }
1491
1493
  initAside() {
1492
- const aside = this.cacheService.get('_yz_current', { mode: 'none' });
1494
+ const [, getCurrent] = useLocalStorageCurrent();
1495
+ const aside = getCurrent();
1493
1496
  this.state.aside = { ...aside };
1494
1497
  }
1495
1498
  initLogo() {
1496
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1499
+ const [, getProjectInfo] = useLocalStorageProjectInfo();
1500
+ const projectInfo = getProjectInfo();
1497
1501
  this.state.options.logoExpanded = projectInfo.maxLogoUrl ? projectInfo.maxLogoUrl : `./assets/logo-full.svg`;
1498
1502
  this.state.options.logoCollapsed = projectInfo.miniLogoUrl ? projectInfo.miniLogoUrl : `./assets/logo.svg`;
1499
1503
  }
1500
1504
  initNavType() {
1501
- // from browser cache
1502
- const navType = this.cacheService.get('_yz_header_type', { mode: 'none' });
1505
+ const [, getHeaderType] = useLocalStorageHeaderType();
1506
+ const [, getProjectInfo] = useLocalStorageProjectInfo();
1507
+ const navType = getHeaderType();
1508
+ const projectInfo = getProjectInfo();
1503
1509
  if (navType !== null) {
1504
1510
  this.state.navType = navType;
1505
1511
  return;
1506
1512
  }
1507
- // from project info
1508
- const projectInfo = this.cacheService.get('_yz_project_info', { mode: 'none' });
1509
- let fetchedNavType = undefined;
1513
+ let fetchedNavType;
1510
1514
  if (projectInfo.headerStyle && projectInfo.headerStyle.length > 0) {
1511
1515
  fetchedNavType = projectInfo.headerStyle.pop()?.value;
1512
1516
  }
@@ -1514,13 +1518,16 @@ class YunzaiLayoutBasicComponent {
1514
1518
  if (!fetchedNavType) {
1515
1519
  fetchedNavType = NavType.APPLICATION;
1516
1520
  }
1521
+ this.state.navType = fetchedNavType;
1517
1522
  }
1518
1523
  toIndex() {
1519
- const defaultRoute = this.cacheService.get('_yz_defaultRoute', { mode: 'none' });
1524
+ const [, getDefaultRoute] = useLocalStorageDefaultRoute();
1525
+ const defaultRoute = getDefaultRoute();
1520
1526
  log$1('YunzaiLayoutBasicComponent: ', `todo: the default route was ${defaultRoute}, 但是还没想好如何实现.`);
1521
1527
  }
1522
1528
  onNavTypeChange(type) {
1523
- this.cacheService.set('_yz_header_type', type);
1529
+ const [setHeaderType,] = useLocalStorageHeaderType();
1530
+ setHeaderType(type);
1524
1531
  this.win.location.reload();
1525
1532
  }
1526
1533
  addLayoutDisplayListener() {
@@ -1537,8 +1544,9 @@ class YunzaiLayoutBasicComponent {
1537
1544
  ngOnDestroy() {
1538
1545
  this.state.destroy$.complete();
1539
1546
  }
1540
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiLayoutBasicComponent, deps: [{ token: i1$5.LayoutDisplayService }, { token: i1$3.CacheService }, { token: i3$3.StompService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component }); }
1541
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: YunzaiLayoutBasicComponent, selector: "yz-layout-basic", ngImport: i0, template: `<layout-default
1547
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiLayoutBasicComponent, deps: [{ token: i1$4.LayoutDisplayService }, { token: i2$1.StompService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component }); }
1548
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.8", type: YunzaiLayoutBasicComponent, selector: "yz-layout-basic", ngImport: i0, template: `
1549
+ <layout-default
1542
1550
  [options]="options"
1543
1551
  [asideUser]="asideUserTpl"
1544
1552
  [content]="displayReusetab ? contentTpl : noneTpl"
@@ -1549,9 +1557,15 @@ class YunzaiLayoutBasicComponent {
1549
1557
  <ng-container *ngSwitchCase="NavType.APPLICATION">
1550
1558
  <layout-nav-application></layout-nav-application>
1551
1559
  </ng-container>
1552
- <ng-container *ngSwitchCase="NavType.GROUP"> <layout-nav-group></layout-nav-group></ng-container>
1553
- <ng-container *ngSwitchCase="NavType.TILE"> <layout-nav-tile></layout-nav-tile> </ng-container>
1554
- <ng-container *ngSwitchDefault> <layout-nav-application></layout-nav-application> </ng-container>
1560
+ <ng-container *ngSwitchCase="NavType.GROUP">
1561
+ <layout-nav-group></layout-nav-group>
1562
+ </ng-container>
1563
+ <ng-container *ngSwitchCase="NavType.TILE">
1564
+ <layout-nav-tile></layout-nav-tile>
1565
+ </ng-container>
1566
+ <ng-container *ngSwitchDefault>
1567
+ <layout-nav-application></layout-nav-application>
1568
+ </ng-container>
1555
1569
  </ng-container>
1556
1570
  </layout-default-header-item>
1557
1571
  <!-- nav end -->
@@ -1596,9 +1610,15 @@ class YunzaiLayoutBasicComponent {
1596
1610
  <i nz-icon nzType="appstore" class="mr-sm"></i>
1597
1611
  {{ 'mode.nav.tile' | i18n }}
1598
1612
  </div>
1599
- <div data-event-id="_nav_fullscreen" nz-menu-item> <yunzai-fullscreen></yunzai-fullscreen> </div>
1600
- <div data-event-id="_nav_clearstorage" nz-menu-item> <yunzai-clearstorage></yunzai-clearstorage> </div>
1601
- <div data-event-id="_nav_i18n" nz-menu-item> <yunzai-i18n></yunzai-i18n> </div>
1613
+ <div data-event-id="_nav_fullscreen" nz-menu-item>
1614
+ <yunzai-fullscreen></yunzai-fullscreen>
1615
+ </div>
1616
+ <div data-event-id="_nav_clearstorage" nz-menu-item>
1617
+ <yunzai-clearstorage></yunzai-clearstorage>
1618
+ </div>
1619
+ <div data-event-id="_nav_i18n" nz-menu-item>
1620
+ <yunzai-i18n></yunzai-i18n>
1621
+ </div>
1602
1622
  </div>
1603
1623
  </nz-dropdown-menu>
1604
1624
  </layout-default-header-item>
@@ -1633,13 +1653,14 @@ class YunzaiLayoutBasicComponent {
1633
1653
  </ng-template>
1634
1654
  <ng-template #noneTpl>
1635
1655
  <router-outlet></router-outlet>
1636
- </ng-template> `, isInline: true, dependencies: [{ kind: "directive", type: i4$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i4$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i4$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i5$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i5$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6$1.ReuseTabComponent, selector: "reuse-tab, [reuse-tab]", inputs: ["mode", "i18n", "debug", "max", "tabMaxWidth", "excludes", "allowClose", "keepingScroll", "storageState", "keepingScrollContainer", "customContextMenu", "tabBarExtraContent", "tabBarGutter", "tabBarStyle", "tabType", "routeParamMatchMode", "disabled", "titleRender", "canClose"], outputs: ["change", "close"], exportAs: ["reuseTab"] }, { kind: "component", type: i1$5.LayoutDefaultComponent, selector: "layout-default", inputs: ["options", "asideUser", "asideBottom", "nav", "content", "customError"], exportAs: ["layoutDefault"] }, { kind: "component", type: i1$5.LayoutDefaultHeaderItemComponent, selector: "layout-default-header-item", inputs: ["hidden", "direction"] }, { kind: "directive", type: i1$5.LayoutDefaultHeaderItemTriggerDirective, selector: "[layout-default-header-item-trigger]" }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i7.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i7.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i8.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i9.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "component", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage" }, { kind: "component", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen" }, { kind: "component", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: ["showLangText"] }, { kind: "component", type: YunzaiNotifyComponent, selector: "yunzai-notify" }, { kind: "component", type: YunzaiThemBtnComponent, selector: "yunzai-theme-btn", inputs: ["types", "devTips", "deployUrl"] }, { kind: "component", type: YunzaiUserComponent, selector: "yunzai-user" }, { kind: "component", type: LayoutNavApplicationComponent, selector: "layout-nav-application" }, { kind: "component", type: LayoutNavGroupComponent, selector: "layout-nav-group" }, { kind: "component", type: LayoutNavTileComponent, selector: "layout-nav-tile" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] }); }
1656
+ </ng-template> `, isInline: true, dependencies: [{ kind: "directive", type: i3$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3$2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4$4.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i4$4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i5$1.ReuseTabComponent, selector: "reuse-tab, [reuse-tab]", inputs: ["mode", "i18n", "debug", "max", "tabMaxWidth", "excludes", "allowClose", "keepingScroll", "storageState", "keepingScrollContainer", "customContextMenu", "tabBarExtraContent", "tabBarGutter", "tabBarStyle", "tabType", "routeParamMatchMode", "disabled", "titleRender", "canClose"], outputs: ["change", "close"], exportAs: ["reuseTab"] }, { kind: "component", type: i1$4.LayoutDefaultComponent, selector: "layout-default", inputs: ["options", "asideUser", "asideBottom", "nav", "content", "customError"], exportAs: ["layoutDefault"] }, { kind: "component", type: i1$4.LayoutDefaultHeaderItemComponent, selector: "layout-default-header-item", inputs: ["hidden", "direction"] }, { kind: "directive", type: i1$4.LayoutDefaultHeaderItemTriggerDirective, selector: "[layout-default-header-item-trigger]" }, { kind: "directive", type: i3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i4$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "directive", type: i4$1.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "directive", type: i5.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i5.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "directive", type: i7.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: i8$1.NzAvatarComponent, selector: "nz-avatar", inputs: ["nzShape", "nzSize", "nzGap", "nzText", "nzSrc", "nzSrcSet", "nzAlt", "nzIcon"], outputs: ["nzError"], exportAs: ["nzAvatar"] }, { kind: "component", type: YunzaiClearStorageComponent, selector: "yunzai-clearstorage" }, { kind: "component", type: YunzaiFullScreenComponent, selector: "yunzai-fullscreen" }, { kind: "component", type: YunzaiI18NComponent, selector: "yunzai-i18n", inputs: ["showLangText"] }, { kind: "component", type: YunzaiNotifyComponent, selector: "yunzai-notify" }, { kind: "component", type: YunzaiThemBtnComponent, selector: "yunzai-theme-btn", inputs: ["types", "devTips", "deployUrl"] }, { kind: "component", type: YunzaiUserComponent, selector: "yunzai-user" }, { kind: "component", type: LayoutNavApplicationComponent, selector: "layout-nav-application" }, { kind: "component", type: LayoutNavGroupComponent, selector: "layout-nav-group" }, { kind: "component", type: LayoutNavTileComponent, selector: "layout-nav-tile" }, { kind: "pipe", type: i1$2.I18nPipe, name: "i18n" }] }); }
1637
1657
  }
1638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiLayoutBasicComponent, decorators: [{
1658
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiLayoutBasicComponent, decorators: [{
1639
1659
  type: Component,
1640
1660
  args: [{
1641
1661
  selector: `yz-layout-basic`,
1642
- template: `<layout-default
1662
+ template: `
1663
+ <layout-default
1643
1664
  [options]="options"
1644
1665
  [asideUser]="asideUserTpl"
1645
1666
  [content]="displayReusetab ? contentTpl : noneTpl"
@@ -1650,9 +1671,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
1650
1671
  <ng-container *ngSwitchCase="NavType.APPLICATION">
1651
1672
  <layout-nav-application></layout-nav-application>
1652
1673
  </ng-container>
1653
- <ng-container *ngSwitchCase="NavType.GROUP"> <layout-nav-group></layout-nav-group></ng-container>
1654
- <ng-container *ngSwitchCase="NavType.TILE"> <layout-nav-tile></layout-nav-tile> </ng-container>
1655
- <ng-container *ngSwitchDefault> <layout-nav-application></layout-nav-application> </ng-container>
1674
+ <ng-container *ngSwitchCase="NavType.GROUP">
1675
+ <layout-nav-group></layout-nav-group>
1676
+ </ng-container>
1677
+ <ng-container *ngSwitchCase="NavType.TILE">
1678
+ <layout-nav-tile></layout-nav-tile>
1679
+ </ng-container>
1680
+ <ng-container *ngSwitchDefault>
1681
+ <layout-nav-application></layout-nav-application>
1682
+ </ng-container>
1656
1683
  </ng-container>
1657
1684
  </layout-default-header-item>
1658
1685
  <!-- nav end -->
@@ -1697,9 +1724,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
1697
1724
  <i nz-icon nzType="appstore" class="mr-sm"></i>
1698
1725
  {{ 'mode.nav.tile' | i18n }}
1699
1726
  </div>
1700
- <div data-event-id="_nav_fullscreen" nz-menu-item> <yunzai-fullscreen></yunzai-fullscreen> </div>
1701
- <div data-event-id="_nav_clearstorage" nz-menu-item> <yunzai-clearstorage></yunzai-clearstorage> </div>
1702
- <div data-event-id="_nav_i18n" nz-menu-item> <yunzai-i18n></yunzai-i18n> </div>
1727
+ <div data-event-id="_nav_fullscreen" nz-menu-item>
1728
+ <yunzai-fullscreen></yunzai-fullscreen>
1729
+ </div>
1730
+ <div data-event-id="_nav_clearstorage" nz-menu-item>
1731
+ <yunzai-clearstorage></yunzai-clearstorage>
1732
+ </div>
1733
+ <div data-event-id="_nav_i18n" nz-menu-item>
1734
+ <yunzai-i18n></yunzai-i18n>
1735
+ </div>
1703
1736
  </div>
1704
1737
  </nz-dropdown-menu>
1705
1738
  </layout-default-header-item>
@@ -1736,15 +1769,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImpor
1736
1769
  <router-outlet></router-outlet>
1737
1770
  </ng-template> `
1738
1771
  }]
1739
- }], ctorParameters: function () { return [{ type: i1$5.LayoutDisplayService }, { type: i1$3.CacheService }, { type: i3$3.StompService }, { type: undefined, decorators: [{
1772
+ }], ctorParameters: function () { return [{ type: i1$4.LayoutDisplayService }, { type: i2$1.StompService }, { type: undefined, decorators: [{
1740
1773
  type: Inject,
1741
1774
  args: [WINDOW]
1742
1775
  }] }]; } });
1743
1776
 
1744
1777
  class ActGuard {
1745
- constructor(configService, cacheService, pathToRegexp, router) {
1778
+ constructor(configService, pathToRegexp, router) {
1746
1779
  this.configService = configService;
1747
- this.cacheService = cacheService;
1748
1780
  this.pathToRegexp = pathToRegexp;
1749
1781
  this.router = router;
1750
1782
  this.bis = BUSINESS_DEFAULT_CONFIG;
@@ -1753,9 +1785,11 @@ class ActGuard {
1753
1785
  log$1('act: ');
1754
1786
  this.bis = mergeBisConfig(this.configService);
1755
1787
  log$1('act: config ', this.bis);
1756
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
1788
+ const [, getUser] = useLocalStorageUser();
1789
+ const user = getUser();
1757
1790
  log$1('act: user ', user);
1758
- this.menus = deepCopy(user.menu).filter((m) => m.systemCode && m.systemCode === this.bis.systemCode);
1791
+ // @ts-ignore
1792
+ this.menus = deepCopy(user.menu || []).filter((m) => m.systemCode && m.systemCode === this.bis.systemCode);
1759
1793
  log$1('act: menus ', this.menus);
1760
1794
  this.getAllLinks(this.menus, this.links);
1761
1795
  log$1('act: links ', this.links);
@@ -1831,15 +1865,15 @@ class ActGuard {
1831
1865
  }
1832
1866
  });
1833
1867
  }
1834
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: ActGuard, deps: [{ token: i1$4.YunzaiConfigService }, { token: i1$3.CacheService }, { token: i1$4.PathToRegexpService }, { token: i5$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1835
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: ActGuard, providedIn: 'root' }); }
1868
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: ActGuard, deps: [{ token: i1$3.YunzaiConfigService }, { token: i1$3.PathToRegexpService }, { token: i4$4.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1869
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: ActGuard, providedIn: 'root' }); }
1836
1870
  }
1837
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: ActGuard, decorators: [{
1871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: ActGuard, decorators: [{
1838
1872
  type: Injectable,
1839
1873
  args: [{
1840
1874
  providedIn: 'root'
1841
1875
  }]
1842
- }], ctorParameters: function () { return [{ type: i1$4.YunzaiConfigService }, { type: i1$3.CacheService }, { type: i1$4.PathToRegexpService }, { type: i5$1.Router }]; } });
1876
+ }], ctorParameters: function () { return [{ type: i1$3.YunzaiConfigService }, { type: i1$3.PathToRegexpService }, { type: i4$4.Router }]; } });
1843
1877
 
1844
1878
  class YunzaiAuthService {
1845
1879
  constructor(injector) {
@@ -1855,46 +1889,19 @@ class YunzaiAuthService {
1855
1889
  get httpClient() {
1856
1890
  return this.injector.get(_HttpClient);
1857
1891
  }
1858
- get cacheService() {
1859
- return this.injector.get(CacheService);
1860
- }
1861
1892
  askToken() {
1862
1893
  log$1('yz.auth.service: ', 'askToken');
1863
- // if (this.tokenService.get()?.token) {
1864
- // const notCovertToken = this.tokenService.get();
1865
- // let convertedToken: ITokenModel;
1866
- // if (notCovertToken && notCovertToken['access_token']) {
1867
- // convertedToken = {
1868
- // token: notCovertToken['access_token'],
1869
- // expired: notCovertToken['expires_in'],
1870
- // refreshToken: notCovertToken['refresh_token'],
1871
- // scope: notCovertToken['scope'],
1872
- // tokenType: notCovertToken['token_type']
1873
- // };
1874
- // return of(convertedToken);
1875
- // } else {
1876
- // return of(this.tokenService.get()!);
1877
- // }
1878
- // } else {
1879
1894
  if (this.config.loginForm) {
1880
1895
  return this.fetchTokenByUP();
1881
1896
  }
1882
1897
  else {
1883
1898
  return this.fetchTokenByCas();
1884
1899
  }
1885
- // }
1886
1900
  }
1887
1901
  fetchTokenByUP() {
1888
1902
  log$1('yz.auth.service: ', 'fetchTokenByUP');
1889
1903
  return this.httpClient.post(`/auth/oauth/token?_allow_anonymous=true`, this.config.loginForm).pipe(map$1((response) => {
1890
- const { access_token, expires_in, refresh_token, scope, token_type } = response;
1891
- return {
1892
- token: access_token,
1893
- expired: expires_in,
1894
- refreshToken: refresh_token,
1895
- tokenType: token_type,
1896
- scope
1897
- };
1904
+ return response;
1898
1905
  }));
1899
1906
  }
1900
1907
  fetchTokenByCas() {
@@ -1903,23 +1910,9 @@ class YunzaiAuthService {
1903
1910
  return this.httpClient
1904
1911
  .get(`/cas-proxy/app/validate_full?callback=${uri}&_allow_anonymous=true&timestamp=${new Date().getTime()}`)
1905
1912
  .pipe(map$1((response) => {
1906
- // 查看缓存中的用户是否与token验证回的用户id相同,如果不同则缓存为过期缓存,进行清除
1907
- if (response && response.userId) {
1908
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
1909
- if (user && user.id && user.id !== response.userId) {
1910
- this.cacheService.clear();
1911
- }
1912
- }
1913
1913
  switch (response.errcode) {
1914
1914
  case 2000:
1915
- const { access_token, expires_in, refresh_token, scope, token_type } = response.data;
1916
- return {
1917
- token: access_token,
1918
- expired: expires_in,
1919
- refreshToken: refresh_token,
1920
- tokenType: token_type,
1921
- scope
1922
- };
1915
+ return response.data;
1923
1916
  case 2001:
1924
1917
  this.injector.get(WINDOW).location.href = response.msg;
1925
1918
  throw Error("Cookie Error: Can't find Cas Cookie,So jump to login!");
@@ -1945,63 +1938,37 @@ class YunzaiAuthService {
1945
1938
  log$1('yz.auth.service: get token->', token);
1946
1939
  this.configService.set('auth', {
1947
1940
  token_send_key: 'Authorization',
1948
- token_send_template: `${token.tokenType} \${token}`,
1941
+ token_send_template: `${token.token_type} \${access_token}`,
1949
1942
  token_send_place: 'header'
1950
1943
  });
1951
1944
  log$1('yz.auth.service: ', 'set token');
1952
1945
  this.tokenService.set(token);
1953
- return this.cacheInit();
1954
- }), mergeAll());
1946
+ return of(null);
1947
+ }), mergeMap(() => this.cacheInit()));
1955
1948
  }
1956
1949
  cacheInit() {
1957
1950
  log$1('yz.auth.service: ', 'cacheInit');
1958
- const tenant = this.cacheService.get('_yz_tenant', { mode: 'none' });
1959
- const user = this.cacheService.get('_yz_user', { mode: 'none' });
1960
- const header = this.cacheService.get('_yz_header', { mode: 'none' });
1961
- const project = this.cacheService.get('_yz_project_info', { mode: 'none' });
1962
- return forkJoin(of(user), of(header), of(project)).pipe(mergeMap(([u, h, p]) => {
1963
- let list = [];
1964
- // user cache
1965
- if (!u || !tenant) {
1966
- log$1('yz.auth.service: ', 'fetch user cache');
1967
- list.push(this.httpClient.get(`/auth/user`).pipe(map$1((user) => {
1968
- this.cacheService.set('_yz_tenant', user.tenantId);
1969
- this.cacheService.set('_yz_user', user.principal);
1970
- })));
1971
- }
1972
- else {
1973
- log$1('yz.auth.service: ', 'user recache');
1974
- list.push(of(() => { }));
1975
- }
1976
- // header cache
1977
- if (!h) {
1978
- log$1('yz.auth.service: ', 'fetch header cache');
1979
- list.push(this.httpClient.get(`/auth/allheader/v2`).pipe(map$1((header) => {
1980
- this.cacheService.set('_yz_header', header.data);
1981
- })));
1982
- }
1983
- else {
1984
- log$1('yz.auth.service: ', 'header recache');
1985
- list.push(of(() => { }));
1986
- }
1987
- // project cache
1988
- if (!p) {
1989
- log$1('yz.auth.service: ', 'fetch project cache');
1990
- list.push(this.httpClient.get(`/app-manager/project/info`).pipe(map$1((info) => {
1991
- this.cacheService.set('_yz_project_info', info.data);
1992
- })));
1993
- }
1994
- else {
1995
- log$1('yz.auth.service: ', 'project recache');
1996
- list.push(of(() => { }));
1997
- }
1998
- return forkJoin(list);
1951
+ const [setTenant,] = useLocalStorageTenant();
1952
+ const [setUser,] = useLocalStorageUser();
1953
+ const [setHeader,] = useLocalStorageHeader();
1954
+ const [setProject,] = useLocalStorageProjectInfo();
1955
+ return combineLatest([this.httpClient.get(`/auth/user`), this.httpClient.get(`/auth/allheader/v2`), this.httpClient.get(`/app-manager/project/info`)])
1956
+ .pipe(map$1(([user, header, project]) => {
1957
+ log$1('yz.auth.service: ', 'set user');
1958
+ setUser(user.principal);
1959
+ log$1('yz.auth.service: ', 'set tenant');
1960
+ setTenant(user.tenantId);
1961
+ log$1('yz.auth.service: ', 'set header');
1962
+ setHeader(header.data);
1963
+ log$1('yz.auth.service: ', 'set project');
1964
+ setProject(project.data);
1965
+ return void 0;
1999
1966
  }));
2000
1967
  }
2001
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiAuthService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2002
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiAuthService, providedIn: 'root' }); }
1968
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiAuthService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
1969
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiAuthService, providedIn: 'root' }); }
2003
1970
  }
2004
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiAuthService, decorators: [{
1971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiAuthService, decorators: [{
2005
1972
  type: Injectable,
2006
1973
  args: [{ providedIn: 'root' }]
2007
1974
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
@@ -2076,7 +2043,7 @@ class YunzaiDefaultInterceptor {
2076
2043
  }, 5000);
2077
2044
  }
2078
2045
  reAttachToken(req) {
2079
- const token = this.tokenSrv.get()?.token;
2046
+ const token = this.tokenSrv.get()?.access_token;
2080
2047
  return req.clone({
2081
2048
  setHeaders: {
2082
2049
  Authorization: `Bearer ${token}`
@@ -2086,11 +2053,10 @@ class YunzaiDefaultInterceptor {
2086
2053
  refreshTokenRequest() {
2087
2054
  const model = this.tokenSrv.get();
2088
2055
  const form = new FormData();
2089
- form.set('refresh_token', model?.refreshToken);
2056
+ form.set('refresh_token', model?.refresh_token);
2090
2057
  form.set('grant_type', 'refresh_token');
2091
2058
  form.set('scope', 'webapp');
2092
- log('yz.default.interceptor: use the refresh token to request a new token', model?.refreshToken);
2093
- // return this.http.post(`/auth/user/token/refresh?_allow_anonymous=true`, form);
2059
+ log('yz.default.interceptor: use the refresh token to request a new token', model?.refresh_token);
2094
2060
  return this.http.post(`/auth/oauth/getOrCreateToken/webapp`, form);
2095
2061
  }
2096
2062
  tryRefreshToken(ev, req, next) {
@@ -2110,14 +2076,7 @@ class YunzaiDefaultInterceptor {
2110
2076
  return this.refreshTokenRequest().pipe(switchMap(res => {
2111
2077
  log('yz.default.interceptor: refresh token accessed -> ', res);
2112
2078
  // 重新保存新 token
2113
- const { access_token, expires_in, refresh_token, scope, token_type } = res;
2114
- this.tokenSrv.set({
2115
- token: access_token,
2116
- expired: expires_in,
2117
- refreshToken: refresh_token,
2118
- tokenType: token_type,
2119
- scope
2120
- });
2079
+ this.tokenSrv.set(res);
2121
2080
  // 通知后续请求继续执行
2122
2081
  this.refreshToking = false;
2123
2082
  this.refreshToken$.next(res);
@@ -2195,10 +2154,10 @@ class YunzaiDefaultInterceptor {
2195
2154
  return of(ev);
2196
2155
  }), catchError((err) => this.handleData(err, newReq, next)));
2197
2156
  }
2198
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiDefaultInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2199
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiDefaultInterceptor }); }
2157
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiDefaultInterceptor, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
2158
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiDefaultInterceptor }); }
2200
2159
  }
2201
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiDefaultInterceptor, decorators: [{
2160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiDefaultInterceptor, decorators: [{
2202
2161
  type: Injectable
2203
2162
  }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
2204
2163
 
@@ -2213,8 +2172,8 @@ const WIDGETS = [
2213
2172
  const LAYOUT_NAV_COMPONENTS = [LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent];
2214
2173
  const COMPONENTS = [YunzaiLayoutBasicComponent];
2215
2174
  class YunzaiLayoutModule {
2216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2217
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.2", ngImport: i0, type: YunzaiLayoutModule, declarations: [YunzaiLayoutBasicComponent, YunzaiClearStorageComponent,
2175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2176
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.8", ngImport: i0, type: YunzaiLayoutModule, declarations: [YunzaiLayoutBasicComponent, YunzaiClearStorageComponent,
2218
2177
  YunzaiFullScreenComponent,
2219
2178
  YunzaiI18NComponent,
2220
2179
  YunzaiNotifyComponent,
@@ -2231,7 +2190,7 @@ class YunzaiLayoutModule {
2231
2190
  YunzaiNotifyComponent,
2232
2191
  YunzaiThemBtnComponent,
2233
2192
  YunzaiUserComponent, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent] }); }
2234
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiLayoutModule, providers: [
2193
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiLayoutModule, providers: [
2235
2194
  {
2236
2195
  provide: YUNZAI_THEME_BTN_KEYS,
2237
2196
  useValue: 'site-theme'
@@ -2244,7 +2203,7 @@ class YunzaiLayoutModule {
2244
2203
  YunzaiSharedYelonModule,
2245
2204
  YunzaiSharedZorroModule] }); }
2246
2205
  }
2247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiLayoutModule, decorators: [{
2206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiLayoutModule, decorators: [{
2248
2207
  type: NgModule,
2249
2208
  args: [{
2250
2209
  imports: [
@@ -3063,7 +3022,7 @@ const ICONS = [
3063
3022
  ];
3064
3023
 
3065
3024
  class YunzaiStartupService {
3066
- constructor(iconSrv, menuService, i18n, win, settingService, aclService, titleService, yzAuthService, cacheService, configService) {
3025
+ constructor(iconSrv, menuService, i18n, win, settingService, aclService, titleService, yzAuthService, configService) {
3067
3026
  this.menuService = menuService;
3068
3027
  this.i18n = i18n;
3069
3028
  this.win = win;
@@ -3071,7 +3030,6 @@ class YunzaiStartupService {
3071
3030
  this.aclService = aclService;
3072
3031
  this.titleService = titleService;
3073
3032
  this.yzAuthService = yzAuthService;
3074
- this.cacheService = cacheService;
3075
3033
  this.configService = configService;
3076
3034
  this.config = BUSINESS_DEFAULT_CONFIG;
3077
3035
  this.config = mergeBisConfig(this.configService);
@@ -3087,7 +3045,6 @@ class YunzaiStartupService {
3087
3045
  }), mergeMap(() => {
3088
3046
  return this.yzAuthService.login();
3089
3047
  }), mergeMap(v => {
3090
- // preloader finish
3091
3048
  this.systemInit();
3092
3049
  log$1('startup.service: preloader finish');
3093
3050
  if (this.win && this.win.appBootstrap) {
@@ -3098,68 +3055,62 @@ class YunzaiStartupService {
3098
3055
  }
3099
3056
  systemInit() {
3100
3057
  log$1('startup.service: system init');
3101
- // user
3102
- const yunzaiUser = this.cacheService.get('_yz_user', { mode: 'none' });
3103
- // menu
3058
+ const [setCurrent,] = useLocalStorageCurrent();
3059
+ const [, getUser] = useLocalStorageUser();
3060
+ const [setDefaultRoute,] = useLocalStorageDefaultRoute();
3061
+ const yunzaiUser = getUser();
3062
+ // @ts-ignore
3104
3063
  const yunzaiMenus = deepCopy(yunzaiUser.menu).filter(m => m.systemCode && m.systemCode === this.config.systemCode);
3105
3064
  mapYzSideToYelonMenu(yunzaiMenus);
3106
3065
  const currentMenu = yunzaiMenus.pop();
3107
3066
  if (currentMenu) {
3108
- // logo app
3109
3067
  this.settingService.setApp({ name: currentMenu.text, description: currentMenu.intro });
3110
3068
  this.settingService.setUser({
3111
3069
  name: yunzaiUser.realname,
3112
3070
  avatar: `${this.config.baseUrl}/filecenter/file/${yunzaiUser.avatarId}` || '',
3113
3071
  email: yunzaiUser.email
3114
3072
  });
3115
- // title
3116
3073
  this.titleService.default = currentMenu && currentMenu.text ? currentMenu.text : 'default application name';
3117
3074
  this.titleService.setTitle(currentMenu && currentMenu.text ? currentMenu.text : 'no title');
3118
- // acl
3119
3075
  const abilities = [];
3120
3076
  generateAbility([currentMenu], abilities, '');
3121
- this.aclService.attachRole(yunzaiUser?.roles
3122
- .map((role) => {
3077
+ this.aclService.attachRole(yunzaiUser?.roles.map((role) => {
3123
3078
  return role.roleValue;
3124
- })
3125
- .filter((a) => !!a) || []);
3079
+ }).filter((a) => !!a) || []);
3126
3080
  this.aclService.attachAbility(abilities);
3127
- // aside menu
3128
3081
  this.menuService.add([currentMenu]);
3129
- // cache current
3130
- this.cacheService.set('_yz_current', {
3082
+ setCurrent({
3131
3083
  name: currentMenu.text,
3132
3084
  intro: currentMenu.intro || '',
3133
3085
  icon: currentMenu.appIconUrl || './assets/tmp/img/avatar.jpg'
3134
3086
  });
3135
- // cache displayIndex
3136
3087
  const attributes = currentMenu.attribute;
3137
3088
  if (attributes) {
3138
3089
  const attr = JSON.parse(attributes);
3139
3090
  if (attr && attr.defaultRoute) {
3140
- this.cacheService.set('_yz_defaultRoute', attr.defaultRoute);
3091
+ setDefaultRoute(attr.defaultRoute);
3141
3092
  }
3142
3093
  else {
3143
- this.cacheService.set('_yz_defaultRoute', '/displayIndex');
3094
+ setDefaultRoute("/displayIndex");
3144
3095
  }
3145
3096
  }
3146
3097
  else {
3147
- this.cacheService.set('_yz_defaultRoute', '/displayIndex');
3098
+ setDefaultRoute("/displayIndex");
3148
3099
  }
3149
3100
  }
3150
3101
  }
3151
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiStartupService, deps: [{ token: i8.NzIconService }, { token: i1$2.MenuService }, { token: YUNZAI_I18N_TOKEN }, { token: WINDOW }, { token: i1$2.SettingsService }, { token: i3$4.ACLService }, { token: i1$2.TitleService }, { token: YunzaiAuthService }, { token: i1$3.CacheService }, { token: i1$4.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3152
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiStartupService }); }
3102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiStartupService, deps: [{ token: i7.NzIconService }, { token: i1$2.MenuService }, { token: YUNZAI_I18N_TOKEN }, { token: WINDOW }, { token: i1$2.SettingsService }, { token: i3$4.ACLService }, { token: i1$2.TitleService }, { token: YunzaiAuthService }, { token: i1$3.YunzaiConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3103
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiStartupService }); }
3153
3104
  }
3154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: YunzaiStartupService, decorators: [{
3105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.8", ngImport: i0, type: YunzaiStartupService, decorators: [{
3155
3106
  type: Injectable
3156
- }], ctorParameters: function () { return [{ type: i8.NzIconService }, { type: i1$2.MenuService }, { type: YunzaiI18NService, decorators: [{
3107
+ }], ctorParameters: function () { return [{ type: i7.NzIconService }, { type: i1$2.MenuService }, { type: YunzaiI18NService, decorators: [{
3157
3108
  type: Inject,
3158
3109
  args: [YUNZAI_I18N_TOKEN]
3159
3110
  }] }, { type: undefined, decorators: [{
3160
3111
  type: Inject,
3161
3112
  args: [WINDOW]
3162
- }] }, { type: i1$2.SettingsService }, { type: i3$4.ACLService }, { type: i1$2.TitleService }, { type: YunzaiAuthService }, { type: i1$3.CacheService }, { type: i1$4.YunzaiConfigService }]; } });
3113
+ }] }, { type: i1$2.SettingsService }, { type: i3$4.ACLService }, { type: i1$2.TitleService }, { type: YunzaiAuthService }, { type: i1$3.YunzaiConfigService }]; } });
3163
3114
  function mapYzSideToYelonMenu(menus) {
3164
3115
  menus.forEach(menu => {
3165
3116
  menu.badgeDot = menu.badge_dot || null;
@@ -3241,5 +3192,5 @@ const HTML_NAMES_MAPPING = {
3241
3192
  * Generated bundle index. Do not edit.
3242
3193
  */
3243
3194
 
3244
- export { ActGuard, BUSINESS_DEFAULT_CONFIG, HTML_NAMES_MAPPING, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, NavType, YUNZAI_APPINIT_PROVIDES, YUNZAI_LANGS, YUNZAI_APPINIT_PROVIDES as YZ_APPINIT_PROVIDES, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiAuthService as YzAuthService, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, YunzaiLayoutBasicComponent as YzLayoutBasicComponent, YunzaiStartupService as YzStartupService, YunzaiStartupServiceFactory as YzStartupServiceFactory, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
3195
+ export { ActGuard, BUSINESS_DEFAULT_CONFIG, HTML_NAMES_MAPPING, LayoutNavApplicationComponent, LayoutNavGroupComponent, LayoutNavTileComponent, YUNZAI_APPINIT_PROVIDES, YUNZAI_LANGS, YunzaiAuthService, YunzaiClearStorageComponent, YunzaiDefaultInterceptor, YunzaiFullScreenComponent, YunzaiI18NComponent, YunzaiI18NService, YunzaiLayoutBasicComponent, YunzaiLayoutModule, YunzaiNotifyComponent, YunzaiStartupService, YunzaiStartupServiceFactory, YunzaiThemBtnComponent, YunzaiUserComponent, YunzaiDefaultInterceptor as YzDefaultInterceptor, YunzaiI18NService as YzI18NService, generateAbility, mapYzSideToYelonMenu, mergeBisConfig };
3245
3196
  //# sourceMappingURL=layout.mjs.map