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
| /**
| * 安全相关API
| */
|
| import {http,Method} from '@/utils/request.js';
| import storage from "@/utils/storage.js"
| import { md5 } from '@/utils/md5.js'
|
| /**
| * 发送绑定手机验证码
| * @param mobile
| * @param captcha
| */
| export function sendBindMobileSms(mobile, captcha) {
| return http.request({
| url: `members/security/bind/send/${mobile}`,
| method: Method.POST,
| needToken: true,
| header:{'content-type':"application/x-www-form-urlencoded"},
| data: {
| uuid: storage.getUuid(),
| captcha,
| },
| });
| }
|
| /**
| * 绑定手机号
| * @param mobile
| * @param sms_code
| */
| export function bindMobile(mobile, sms_code) {
| return http.request({
| url: `members/security/bind/${mobile}`,
| method: Method.PUT,
| needToken: true,
| data: {sms_code},
| });
| }
|
| /**
| * 发送手机验证码
| * 在修改手机号和更改密码时通用
| * @param captcha
| */
| export function sendMobileSms(captcha) {
| return http.request({
| url: 'members/security/send',
| method: Method.POST,
| needToken: true,
| header:{'content-type':"application/x-www-form-urlencoded"},
| data: {
| uuid: storage.getUuid(),
| captcha,
| },
| });
| }
|
| /**
| * 验证更换手机号短信
| * @param sms_code
| */
| export function validChangeMobileSms(sms_code) {
| return http.request({
| url: 'members/security/exchange-bind',
| method: Method.GET,
| needToken: true,
| params: {sms_code},
| });
| }
|
| /**
| * 更换手机号
| * @param mobile
| * @param sms_code
| */
| export function changeMobile(mobile, sms_code) {
| return http.request({
| url: `members/security/exchange-bind/${mobile}`,
| method: Method.PUT,
| header:{'content-type':"application/x-www-form-urlencoded"},
| needToken: true,
| data: {sms_code},
| });
| }
|
|
| /**
| * 更改密码
| * @param captcha
| * @param password
| */
| export function changePassword(captcha, password) {
| return http.request({
| url: 'members/security/password',
| method: Method.PUT,
| header:{'content-type':"application/x-www-form-urlencoded"},
| needToken: true,
| data: {
| uuid: storage.getUuid(),
| captcha,
| password: md5(password),
| },
| });
| }
|
| /**
| * 获取当前实名认证进度
| * @param email
| * @param email_code
| */
| export function contractStep() {
| return http.request({
| url: `members/contract/step`,
| method: Method.GET,
| needToken: true
| })
| }
|
| /**
| * 实名认证
| * @param email
| * @param email_code
| */
| export function authentication(params) {
| return http.request({
| url: `members/contract/authentication`,
| method: Method.POST,
| needToken: true,
| header:{'content-type':"application/x-www-form-urlencoded"},
| data: params
| })
| }
|
|