router.js
2.72 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
/**
* router of sub app channel
* @author: Bi Kai<kai.bi@yoho.cn>
* @date: 2016/05/09
*/
'use strict';
const express = require('express');
const cRoot = './controllers';
const login = require(cRoot + '/login');
const back = require(cRoot + '/back');
const bind = require(cRoot + '/bind');
const reg = require(cRoot + '/reg');
const router = express.Router(); // eslint-disable-line
// 登出
router.get('/signout/index', login.local.logout);
// 登录页面
router.get('/login', login.common.beforeLogin, login.local.loginPage);
// 本地登录
router.post('/login/auth', login.local.login);
// 微信登录
router.get('/login/wechat', login.common.beforeLogin, login.wechat.login);
router.get('/login/wechat/callback', login.wechat.callback);
// sina登录
router.get('/login/sina', login.common.beforeLogin, login.sina.login);
router.get('/login/sina/callback', login.sina.callback);
// qq登录
router.get('/login/qq', login.common.beforeLogin, login.qq.login);
router.get('/login/qq/callback', login.qq.callback);
// 登录绑定
router.get('/bind/index', bind.indexPage);
router.post('/bind/bindCheck', bind.bindCheck);
router.get('/bind/code', bind.codePage);
router.post('/bind/sendBindMsg', bind.sendBindMsg);
router.post('/bind/bindMobile', bind.bindMobile);
router.post('/bind/relateMobile', bind.relateMobile);
router.get('/bind/success', bind.successPage);
router.post('/bind/changeCheck', bind.changeCheck);
router.post('/bind/changeMobile', bind.changeMobile);
/**
* 注册
*/
router.get('/reg/index', reg.index);
router.post('/reg/verifymobile', reg.verifymobile);
router.get('/reg/code', reg.code);
router.post('/reg/sendcode', reg.sendcode);
router.post('/reg/verifycode', reg.verifycode);
/**
* 邮箱
*/
// 通过邮箱找回密码
router.get('/back/email.html', back.indexByEmailPage);
// 邮箱找回密码-成功
router.get('/back/success.html', back.backSuccessByEmailPage);
// 发送邮箱验证码
router.post('/back/sendemail', back.sendCodeToEmailAPI);
// 重新发送邮箱验证码
router.get('/back/resendemail', back.resendCodeToEmailAPI);
// 据邮箱修改密码
router.post('/back/passwordbyemail', back.setNewPasswordByEmailAPI);
/**
* 手机
*/
// 通过手机找回密码
router.get('/back/mobile.html', back.indexByMobilePage);
// 发送手机验证码
router.get('/back/mobilecode.html', back.verifyCodeByMobilePage);
// 输入新密码
router.get('/back/backcode.html', back.setNewPasswordByMobilePage);
// 发送手机验证码
router.post('/back/sendcode', back.sendCodeToMobileAPI);
// 校验手机验证码
router.post('/back/verifycode', back.verifyCodeByMobileAPI);
// 根据手机验证码修改密码
router.post('/back/passwordbymobile', back.setNewPasswordByMobileAPI);
module.exports = router;