Authored by yyq

auth

... ... @@ -9,17 +9,17 @@ const helpers = global.yoho.helpers;
module.exports = (req, res, next) => {
if (!req.user.uid) {
if (req.yoho.isApp) {
return next({
code: 401,
message: 'weblogin'
});
} else if (req.xhr) {
if (req.xhr) {
return res.json({
code: 400,
message: '抱歉,您暂未登录!',
redirect: '/signin.html'
});
} else if (req.yoho.isApp) {
return next({
code: 401,
message: 'weblogin'
});
} else {
return res.redirect(helpers.urlFormat('/signin.html', {
refer: req.originalUrl,
... ...
... ... @@ -367,7 +367,9 @@ seckillObj = {
event.stopPropagation();
if (!yoho.isLogin()) {
let uid = yoho.isLogin();
if (!uid || uid === '0') {
yoho.invokeMethod('go.login');
return;
}
... ... @@ -417,7 +419,7 @@ seckillObj = {
};
yoho.invokeMethod(action, params, function() {
let uid = yoho.isLogin();
uid = yoho.isLogin();
if (uid && uid !== '0') {
onsuccess({uid});
... ...