reg-service.js
2.45 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
/**
* 注册数据接口
*
* @author JiangFeng<jeff.jiang@yoho.cn>
* @date 2016/06/21
*/
'use strict';
const API = require(`${global.library}/api`).API;
const api = new API();
const RegService = {
getAreaData() {
return [
{
areaCode: '+61',
selected: false,
name: '澳大利亚'
}, {
areaCode: '+82',
selected: false,
name: '韩国'
}, {
areaCode: '+1',
selected: false,
name: '加拿大'
}, {
areaCode: '+60',
selected: false,
name: '马来西亚'
}, {
areaCode: '+1',
selected: false,
name: '美国'
}, {
areaCode: '+81',
selected: false,
name: '日本'
}, {
areaCode: '+65',
selected: false,
name: '新加坡'
}, {
areaCode: '+44',
selected: false,
name: '英国'
}, {
areaCode: '+86',
selected: true,
name: '中国'
}, {
areaCode: '+853',
selected: false,
name: '中国澳门'
}, {
areaCode: '+886',
selected: false,
name: '中国台湾'
}, {
areaCode: '+852',
selected: false,
name: '中国香港'
}];
},
sendCodeToMobile(area, mobile) {
let params = {
method: 'app.register.sendRegCodeToMobile',
area: area,
mobile: mobile
};
return api.post('', params);
},
validMobileCode(area, mobile, code) {
let params = {
method: 'app.register.validRegCode',
area: area,
mobile: mobile,
code: code
};
return api.post('', params);
},
regMobile(area, mobile, password, shoppingKey) {
let params = {
method: 'app.passport.register',
area: area,
profile: mobile,
password: password
};
if (shoppingKey) {
params.shopping_key = shoppingKey;
}
return api.post('', params);
}
};
module.exports = RegService;