router.js
1.01 KB
/**
* 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.common.beforeLogin, login.common.isLoginUser, login.wechat.login);
router.get('/login/wechat', 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', login.qq.login);
router.get('/login/qq/callback', login.qq.callback);
module.exports = router;