index.js
1.78 KB
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
//获取平台定制API
const getPlateCustomApi = () => {
return uni.$u.http.get("/yt/app_design/get")
};
//第三方账号登录API
const getThirdLoginApi = (code) => {
return uni.$u.http.get(`/yt/third/login/${code}`)
};
//第三方账号绑定API
const postThirdLoginApi = (data = {}) => {
return uni.$u.http
.post("/yt/third/bind", data)
};
//设置个人信息API
const setUserInfoApi = () => {
return uni.$u.http.get("/yt/user/me/info")
};
//获取平台信息API
const setPlateInfoApi = () => {
return uni.$u.http.get("/yt/platform/get")
};
//获取告警徽标数API
const getAlarmTotalApi = () => {
return uni.$u.http.get("/yt/homepage/app?login=true")
};
//登录API
const postLoginApi = (loginForm = {}) => {
return uni.$u.http
.post("/auth/login", loginForm)
};
//获取验证码API
const postCodeApi = (phone) => {
return uni.$u.http
.post(`/yt/noauth/reset_code/${phone}`)
}
//重置密码API
const postResetCodeApi = (phone, data = {}) => {
return uni.$u.http
.post(`/yt/noauth/reset/${phone}`, data)
}
//更新个人资料API
const postPersonalInfoApi = (data = {}) => {
return uni.$u.http
.put('/yt/user/center', data)
}
//第三方登录需要解绑API
const deleteBindApi = (data = {}) => {
return uni.$u.http.delete('/yt/third', data)
}
//获取手机验证码API
const postPhoneCodeApi = (phone, data = {}) => {
return uni.$u.http
.post(`/yt/noauth/send_login_code/${phone}`, data)
}
//手机登录API
const postPhoneLoginApi = (data = {}) => {
return uni.$u.http
.post('/yt/auth/code/login', data)
}
export default {
getPlateCustomApi,
getThirdLoginApi,
setUserInfoApi,
setPlateInfoApi,
getAlarmTotalApi,
postLoginApi,
postCodeApi,
postResetCodeApi,
postPersonalInfoApi,
deleteBindApi,
postPhoneCodeApi,
postPhoneLoginApi,
postThirdLoginApi
}