2023-11-01 15:47:53 +08:00
|
|
|
|
2023-11-01 15:48:48 +08:00
|
|
|
![downloads](https://img.shields.io/npm/dt/@gm5/session.svg)
|
|
|
|
![version](https://img.shields.io/npm/v/@gm5/session.svg)
|
2020-09-18 18:25:56 +08:00
|
|
|
|
2020-09-18 18:27:00 +08:00
|
|
|
# @gm5/session
|
2020-09-18 18:25:56 +08:00
|
|
|
|
2020-09-27 14:23:28 +08:00
|
|
|
> 会话拓展包。
|
2020-09-18 18:25:56 +08:00
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
|
|
|
```bash
|
2023-11-01 15:47:53 +08:00
|
|
|
npm i @gm5/session
|
2020-09-18 18:25:56 +08:00
|
|
|
```
|
|
|
|
|
2020-09-27 14:23:28 +08:00
|
|
|
## 使用
|
|
|
|
|
|
|
|
```js
|
2023-11-01 15:47:53 +08:00
|
|
|
import { createApp } from '@gm5/core
|
|
|
|
import { createSession, SessionModule } from '@gm5/session'
|
2020-09-27 14:23:28 +08:00
|
|
|
|
2023-11-01 15:47:53 +08:00
|
|
|
const app = createApp()
|
2020-09-27 14:23:28 +08:00
|
|
|
|
2023-11-01 15:47:53 +08:00
|
|
|
app.install(SessionModule, {domain: 'your_domain'})
|
|
|
|
.use(createSession)
|
|
|
|
.run()
|
2020-09-27 14:23:28 +08:00
|
|
|
|
|
|
|
|
|
|
|
```
|