linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import http from '@/http/api.js'
 
// 获取token
const token = (tenantId, username, password, type) => {
    return http.request({
        url: '/blade-auth/oauth/token',
        method: 'POST',
        header: {
            'Tenant-Id': tenantId
        },
        params: {
            tenantId,
            username,
            password,
            grant_type: "password",
            scope: "all",
            type
        }
    })
}
 
const register = (phone, password) => {
    return http.request({
        url: '',
        method: 'POST',
        params: {
            phone,
            password
        }
    })
}
 
const refreshToken = (refresh_token, tenantId) => {
    return http.request({
        url: '/api/blade-auth/oauth/token',
        method: 'post',
        headers: {
            'Tenant-Id': tenantId
        },
        params: {
            tenantId,
            refresh_token,
            grant_type: "refresh_token",
            scope: "all",
        }
    })
}
 
// 获取用户信息
const userInfo = () => {
    return http.request({
        url: '/api/blade-user/info',
        method: 'GET',
    })
}
 
 
 
// 获取所有用户
export const getUserList = () => {
    return http.request({
        url: '/api/blade-user/user-list',
        method: 'GET',
    })
}
 
// 根据电话号码获取用户
export const getUserByPhoneIds = (phoneIds) => {
    return http.request({
        url: '/api/blade-user/getUserByPhoneIds',
        method: 'POST',
        params: {
            phoneIds
        }
    })
}
 
export const customizeGetList = (adCode) => {
    return http.request({
        url: '/api/blade-user/customizeGetList',
        method: 'get',
        params: {
            adCode
        }
    })
}
 
//更新用户信息
export const updateUserInfo = (data) => {
    return http.request({
        url: '/blade-system/user/update',
        method: 'POST',
        data: data
    })
}
 
 
// 获取用户信息
export const getUser = (id) => {
    console.log('************************', id)
    return http.request({
        url: '/blade-system/user/detail',
        method: 'GET',
        params: {
            id
        }
    })
}
 
// 获取用户信息
export const fetchUserInfo = (id) => {
    return http.request({
        url: '/blade-system/user/details',
        method: 'GET',
        params: {
            id
        }
    })
}
 
// 获取人员类型
export const getPeopleType = (params) => {
    return http.request({
        url: '/blade-system/user/getUserInfoByCode',
        method: 'GET',
        params: params
    })
}
 
 
 
export default {
    token,
    userInfo,
    refreshToken,
    register,
    getUserByPhoneIds
}