zhiyong.zhou
2024-02-26 60d911172b1dbebe0ab952ce10366b327d5744f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import constants from "@/common/constants";
 
const {STORAGE} = constants;
 
const {USER, USER_NAME, USER_CODE, USER_ID, USER_DEPART_NAME, USER_DEPART_CODE} = STORAGE;
 
export default {
    setUser(value) {
        uni.setStorageSync(USER, value);
    },
    setUserId(value) {
        uni.setStorageSync(USER_ID, value);
    },
    setUserCode(value) {
        uni.setStorageSync(USER_CODE, value);
    },
    setUserName(value) {
        uni.setStorageSync(USER_NAME, value);
    },
    setUserDepartName(value) {
        uni.setStorageSync(USER_DEPART_NAME, value);
    },
    setUserDepartCode(value) {
        uni.setStorageSync(USER_DEPART_CODE, value);
    },
    getUserDepartName() {
        return uni.getStorageSync(USER_DEPART_NAME);
    },
    getUserDepartCode() {
        return uni.getStorageSync(USER_DEPART_CODE);
    },
    getUserId() {
        return uni.getStorageSync(USER_ID);
    },
    getUserCode() {
        return uni.getStorageSync(USER_CODE);
    },
    getUserName() {
        return uni.getStorageSync(USER_NAME);
    }
}