<commit_before>/**
 * Created by apple on 2017/8/13.
 */
let express = require('express');
let router = express.Router();
let User = require('../lib/controlers/User');

/**
 * 注册
 */
// router.post('/regist', (req, res) => {
    // let email = '<EMAIL>',
    //     username = 'admin',
    //     password = '<PASSWORD>',
    //     avatar = 'https://avatars2.githubusercontent.com/u/20011131',
    //     user_type = 2,
    //     status = 0;
    // let md5 = crypto.createHash('md5');
    // md5.update(password);
    // password = <PASSWORD>('hex');
    // let newUser = new User(email, username, password, avatar, moment(new Date()).format('YYYY-MM-DD hh:mm:ss'), user_type, status);
    // // res.send(newUser);
    // newUser.checkEmail()
    //     .then(results => {
    //         if (results.length > 0) {
    //             res.json({code: '20000', msg: '该邮箱已注册'});
    //         } else {
    //             newUser.regist()
    //                 .then(data => {
    //                     res.json({code: '10000', msg: '注册成功'});
    //                 })
    //                 .catch(err => {
    //                     res.json({code: '20000', msg: err});
    //                 })
    //         }
    //     })
    //     .catch(err => {
    //         res.json({code: '20000', msg: err});
    //     });
// });

/**
 * 登录
 */
router.post('/login', User.checkUsernameAndPwd);
router.post('/login', User.checkUser);
router.post('/login', User.getToken);
router.post('/login', User.saveToken);
router.post('/login', User.login);

module.exports = router;<commit_msg>'push'<commit_after>/**
 * Created by apple on 2017/8/13.
 */
let express = require('express');
let router = express.Router();
let User = require('../lib/Controlers/User');

/**
 * 注册
 */
// router.post('/regist', (req, res) => {
    // let email = '<EMAIL>',
    //     username = 'admin',
    //     password = '<PASSWORD>',
    //     avatar = 'https://avatars2.githubusercontent.com/u/20011131',
    //     user_type = 2,
    //     status = 0;
    // let md5 = crypto.createHash('md5');
    // md5.update(password);
    // password = <PASSWORD>('hex');
    // let newUser = new User(email, username, password, avatar, moment(new Date()).format('YYYY-MM-DD hh:mm:ss'), user_type, status);
    // // res.send(newUser);
    // newUser.checkEmail()
    //     .then(results => {
    //         if (results.length > 0) {
    //             res.json({code: '20000', msg: '该邮箱已注册'});
    //         } else {
    //             newUser.regist()
    //                 .then(data => {
    //                     res.json({code: '10000', msg: '注册成功'});
    //                 })
    //                 .catch(err => {
    //                     res.json({code: '20000', msg: err});
    //                 })
    //         }
    //     })
    //     .catch(err => {
    //         res.json({code: '20000', msg: err});
    //     });
// });

/**
 * 登录
 */
router.post('/login', User.checkUsernameAndPwd);
router.post('/login', User.checkUser);
router.post('/login', User.getToken);
router.post('/login', User.saveToken);
router.post('/login', User.login);

module.exports = router;
{'fraction_non_alphanumeric': 0.21539436173582516, 'fraction_numerical': 0.026607538802660754, 'mean_word_length': 1.6471081307627828, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4283271', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1050, 'n_words': 179}