Authored by 郭成尧

uid-create

... ... @@ -10,6 +10,7 @@
'use strict';
const _ = require('lodash');
const config = global.yoho.config;
const utils = require(global.utils);
const ResetModel = require('../models/reset');
... ... @@ -48,7 +49,16 @@ const passwordResetPage = (req, res) => {
*/
const passwordReset = (req, res, next) => {
let passwordWeakObj = req.session.passwordWeak;
let uid = (req.user && req.user.uid) || (passwordWeakObj && passwordWeakObj.uid);
let uid = req.user && req.user.uid;
if (!uid && passwordWeakObj && passwordWeakObj.uid && passwordWeakObj.session_key) {
uid = {
toString: () => {
return _.parseInt(passwordWeakObj.uid);
},
sessionKey: passwordWeakObj.session_key
};
}
if (!uid || !passwordWeakObj || !passwordWeakObj.token) {
return res.json({
... ...