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
| /**
| * Created by Andste on 2018/5/2.
| * 用户认证相关API
| */
| import storage from '@/utils/storage.js';
| import {http, Method} from '@/utils/request.js';
| import { md5 } from '@/utils/md5.js';
|
| /**
| * 普通登录
| * @param username
| * @param password
| * @param captcha
| */
| export function login(username, password, captcha) {
| return http.request({
| url: 'passport/login',
| method: Method.POST,
| params: {
| username,
| password: md5(password),
| captcha,
| uuid: storage.getUuid(),
| },
| });
| }
|
|
|
|
|
| /**
| * 验证账户信息
| * @param captcha
| * @param account
| */
| export function validAccount(captcha, account) {
| return http.request({
| url: 'passport/find-pwd',
| method: Method.GET,
| params: {
| uuid: storage.getUuid(),
| captcha,
| account,
| },
| });
| }
|
| /**
| * 发送找回密码短信
| * @param uuid
| * @param captcha
| */
| export function sendFindPasswordSms(uuid,captcha) {
| return http.request({
| url: 'passport/find-pwd/send',
| method: Method.POST,
| header:{'content-type':"application/x-www-form-urlencoded"},
| data: {
| uuid:uuid,
| captcha,
| },
| });
| }
|
| /**
| * 校验找回密码验证码
| * @param uuid
| * @param sms_code
| */
| export function validFindPasswordSms(uuid, sms_code) {
| return http.request({
| url: 'passport/find-pwd/valid',
| method: Method.GET,
| params: {
| uuid,
| sms_code,
| },
| });
| }
|
| /**
| * 修改密码【找回密码用】
| * @param password
| * @param uuid
| */
| export function changePassword(password, uuid) {
| if (!uuid) {
| uuid = storage.getUuid();
| }
| return http.request({
| url: 'passport/find-pwd/update-password',
| method: Method.PUT,
| header:{'content-type':"application/x-www-form-urlencoded"},
| data: {
| uuid,
| password: md5(password),
| },
| });
| }
|
|
|
| // 保存生物认证登录
| export function setBiolofy(params) {
| return http.request({
| url: `passport/login/save/biology`,
| method: 'POST',
| params
| })
| }
|
|