router.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
/**
* passport路由
* @author: leo <qi.li@yoho.cn>
* @date: 2017/06/26
*/
'use strict';
const express = require('express');
const sms = require('./controllers/sms');
const user = require('./controllers/user');
const login = require('./controllers/login');
const router = express.Router(); // eslint-disable-line
// SMS 短信
router.post('/sms/sendCode', sms.beforeSend, sms.sendCode);
router.post('/sms/checkCode', sms.checkCode, user.userInfo);
// 第三方登录
// wechat
router.get('/login/wechat', login.wechat.login);
router.get('/login/wechat/callback', login.wechat.callback);
// 微信授权登录
router.get('/user/wechatLogin', user.wechatUserLogin);
router.get('/user/newWechatLogin', user.newWechatLogin);
router.get('/user/wechatCallback', user.wechatUserCallback);
router.get('/user/newWechatCallback', user.newWechatUserCallback);
router.get('/user/wechatInfo', user.wechatUserInfo);
router.get('/user/newWechatInfo', user.newWechatUserInfo);
// sina
router.get('/login/sina', 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', login.qq.login);
router.get('/login/qq/callback', login.qq.callback);
module.exports = router;