router.js
1.4 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
/**
* 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 captcha = require(cRoot + '/captcha');
const back = require(cRoot + '/back');
const router = express.Router(); // eslint-disable-line
router.get('/login/wechat', login.wechat.beforeLogin, login.wechat.login); // 登录
router.get('/login/wechat/callback', login.wechat.callback);
// 找回密码首页
router.get('/back/index.html'.back.indexPage);
// 实时验证输入是否正确
router.post('/back/authcode', captcha.checkAPI, back.validateUserInputAPI, back.getUserInfoAPI);
router.post('/back/email', captcha.checkPage, back.sendCodeAPI);
// 邮件重置密码
router.get('/back/backcode.html', back.authRequest, back.checkEmailCodePage, back.resetPasswordByEmailPage);
// 邮件重置密码成功页面
router.get('/back/resetSuccess.html', back.checkSuccessStatusPage, back.resetPwdSuccessPage);
// 重新发送短信
router.post('/back/sendBackMobile', captcha.checkAPI, back.sendBackMobileAPI);
router.get('/back/verification.html', back.verifyCodeByMobilePage);
router.post('/back/backMobile', captcha.checkAPI, back.verifyCodyByMobileAPI);
// 手机更新密码页面
router.post('/back/update', back.authRequest, back.validationPwdPage, back.updatePwdPage);
module.exports = router;