user.js
1.62 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import http from './interface'
//通过用户名获取可用的仓库列表
export const getWarehouseByUserCode = (data) => {
return http.request({
url: '/system/warehouse/getWarehouseByUserCode',
method:'get',
data,
})
}
//登录
export const login = (data) => {
return http.request({
url: '/mobile/login',
method:'POST',
data,
})
}
//退出登录
export const logout = () => {
return http.request({
url: '/home/v1/logout',
method:'GET',
})
}
//使用手机号注册账户
export const phoneReg = (data) => {
return http.request({
url: '/home/v1/reg/phone',
method:'POST',
data,
})
}
/**
* 修改密码
* oldPwd 原密码
* newPwd 新密码
*/
export const updatePassword = (data) => {
return http.request({
url: '/home/v1/password/update',
method:'POST',
data,
})
}
/**
* 密码验证
* oldPwd 原密码
* newPwd 新密码
*/
export const passwordValidation = (data) => {
return http.request({
url: '/home/v1/password/validation',
method:'POST',
data,
})
}
/**
* 检查是否登录
* oldPwd 原密码
* newPwd 新密码
*/
export const hasLogin = () => {
return http.request({
url: '/home/v1/user/islogin',
method:'GET'
})
}
/**
* 更新手机号
* phone 手机号
* code 手机验证码
*/
export const updatePhone = (data) =>{
return http.request({
url: '/home/v1/user/phone/update',
method:'POST',
data,
})
}
export default {
getWarehouseByUserCode,
login,
logout,
phoneReg,
updatePassword,
passwordValidation,
updatePhone,
hasLogin
}