logologo
开始
手册
开发
插件
API
首页
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
开始
手册
开发
插件
API
首页
logologo
API Overview

@nocobase/auth

AuthManager
Auth
BaseAuth

@nocobase/cache

CacheManager
Cache

@nocobase/cli

NocoBase CLI
全局环境变量

@nocobase/client

Application
Plugin

@nocobase/database

Collection
Field

interfaces

BaseInterface
Filter Operators

RelationRepository

BelongsToManyRepository
belongs-to-repository
HasManyRepository
HasOneRepository
Repository

shared

create-options
destroy-options
find-one
find-options
transaction
update-options

@nocobase/data-source-manager

DataSourceManager
DataSource (abstract)
ICollectionManager
ICollection
IField
IModel
IRepository

@nocobase/flow-engine

DataSourceManager
FlowContext
FlowEngine
FlowModel
FlowResource

@nocobase/logger

Logger

@nocobase/server

AppCommand
Application
AuditManager
Context
Migration
Plugin

@nocobase/sdk

Auth
Storage

@nocobase/telemetry

Metric
Telemetry
Trace
Previous PageAuth
Next PageMetric

#Storage

#概览

Storage 类用于客户端信息存储,默认使用 localStorage.

#基本使用

export abstract class Storage {
  abstract clear(): void;
  abstract getItem(key: string): string | null;
  abstract removeItem(key: string): void;
  abstract setItem(key: string, value: string): void;
}

export class CustomStorage extends Storage {
  // ...
}

#类方法

#setItem()

存储内容。

#签名

  • setItem(key: string, value: string): void

#getItem()

获取内容。

#签名

  • getItem(key: string): string | null

#removeItem()

删除内容。

#签名

  • removeItem(key: string): void

#clear()

清除所有内容。

#签名

  • clear(): void