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
import http from '@/http/api.js'
 
// 微信    获取手机号
export const phoneLogin = (param) => {
    return http.request({
        url: '/api/blade-auth/oauth/wxLogin',
        method: 'GET',
        custom: {
            need: true,
        },
        params: param
    })
}
 
//微信授权登录
export const wxLogin = (tenantId, username, password, type) => {
    return http.request({
        url: '/api/blade-auth/oauth/token',
        method: 'POST',
        header: {
            'Tenant-Id': tenantId
        },
        params: {
            tenantId,
            username,
            password,
            grant_type: "wx",
            scope: "all",
            type
        }
    })
}
 
//获取手机 验证码
export const getCode = (param) => {
    return http.request({
        url: '/api/blade-sm/sms/sms/sendCode',
        method: 'POST',
        data: param
    })
}
 
//验证码登录
export const codeLogin = (tenantId, username, password, type) => {
    return http.request({
        url: '/api/blade-auth/oauth/token',
        method: 'POST',
        header: {
            'Tenant-Id': tenantId
        },
        params: {
            tenantId,
            username,
            password,
            grant_type: "phone",
            scope: "all",
            type
        }
    })
}