wangzhibo
4 天以前 10595d8632f959d0954d1939243196f4eed02372
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { defineStore } from "pinia";
import { ref } from "vue";
import type { Cs } from "../types";
 
export const useSession = defineStore("cs.session", () => {
    // 详情
    const info = ref<Cs.Session>();
 
    // 设置会话
    function set(data: Cs.Session) {
        info.value = data;
    }
 
    // 清除会话
    function clear() {
        info.value = undefined;
    }
 
    return {
        info,
        set,
        clear,
    };
});