router.js
1.52 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
/**
* 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 router = express.Router(); // eslint-disable-line
router.get('/login', login.local.loginPage);
router.get('/login/wechat', login.wechat.beforeLogin, login.wechat.login); // 登录
router.get('/login/wechat/callback', login.wechat.callback);
/**
* 邮箱
*/
// 通过邮箱找回密码
router.get('/back/email.html', back.indexPageByEmail);
// 发送邮箱验证码
router.post('/back/sendemail', back.sendCodeToEmailAPI);
// 重新发送邮箱验证码
router.get('/back/resendemail', back.resendCodeToEmailAPI);
// 邮箱找回密码-成功
router.get('/back/success.html', back.backSuccessPageByEmail);
// 据邮箱修改密码
router.post('/back/passwordbyemail', back.setNewPasswordByEmailAPI);
/**
* 手机
*/
// 通过手机找回密码
router.get('/back/mobile.html', back.indexPageByMobile);
// 发送手机验证码
router.get('/back/mobilecode.html', back.verifyCodePageByMobile);
// 发送手机验证码
router.post('/back/sendcode', back.sendCodeToMobileAPI);
// 校验手机验证码
router.post('/back/verifycode', back.verifyCodeByMobileAPI);
// 找回密码
router.get('/back/backcode.html', back.setNewPasswordPageByMobile);
// 根据手机验证码修改密码
router.post('/back/passwordbymobile', back.setNewPasswordByMobileAPI);
module.exports = router;