UserController.js
1.25 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
/**
* UserController.js 用户控制器,提供远程服务器接口
*
* @description :: Server-side logic for managing userrelevances
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
var http = require('http');
module.exports = {
/**
* 检查手机号码是否被注册
*/
checkMobile: function(req, res, next) {
if (!req.xhr) {
return res.end("fail, please use ajx request");
}
RemoteApi.post("http://mobapi.nong12.com/mobsiteApp/user/checkMobile.do", req.body.params).then(function(body) {
return res.json(body);
}, function(error) {
return res.json(error);
});
},
sendAuthCode: function(req, res, next) {
if (!req.xhr) {
return res.end("fail, please use ajx request");
}
RemoteApi.post("http://mobapi.nong12.com/mobsiteApp/user/sendAuthCode.do", req.body.params).then(function(body) {
return res.json(body);
}, function(error) {
return res.json(error);
});
},
checkAuthCode: function(req, res, next) {
if (!req.xhr) {
return res.end("fail, please use ajx request");
}
RemoteApi.post("http://mobapi.nong12.com/mobsiteApp/user/checkAuthCode.do", req.body.params).then(function(body) {
return res.json(body);
}, function(error) {
return res.json(error);
});
},
};