...
|
...
|
@@ -248,23 +248,26 @@ exports.index = (req, res, next) => { |
|
|
|
|
|
options.loginUrl = '//m.yohobuy.com/activity/student/register';
|
|
|
if (options.isApp) {
|
|
|
if (options.isLogin) {
|
|
|
if (options.isStudent) {
|
|
|
options.loginUrl = false;
|
|
|
} else {
|
|
|
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
|
|
|
}
|
|
|
} else {
|
|
|
// no login
|
|
|
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
|
|
|
}
|
|
|
} else {
|
|
|
if (options.isLogin) {
|
|
|
if (options.isStudent) {
|
|
|
options.loginUrl = false;
|
|
|
}
|
|
|
}
|
|
|
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
|
|
|
}
|
|
|
// if (options.isApp) {
|
|
|
// if (options.isLogin) {
|
|
|
// if (options.isStudent) {
|
|
|
// options.loginUrl = false;
|
|
|
// } else {
|
|
|
// options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
|
|
|
// }
|
|
|
// } else {
|
|
|
// // no login
|
|
|
// options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
|
|
|
// }
|
|
|
// } else {
|
|
|
// if (options.isLogin) {
|
|
|
// if (options.isStudent) {
|
|
|
// options.loginUrl = false;
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
// console.log(options);
|
|
|
res.render('student', options);
|
...
|
...
|
@@ -291,9 +294,12 @@ exports.register = (req, res, next) => { |
|
|
}
|
|
|
Promise.all([verifiedStudentTotal(), getEducationLevelList()]).then((arr) => {
|
|
|
if (req.__USER__.isStudent) {
|
|
|
refer = '/activity/student?uid=' + req.__USER__.uid;// 所有认证过的,都跳转学生首页
|
|
|
|
|
|
|
|
|
refer = '/activity/student';// 所有认证过的,都跳转学生首页
|
|
|
if(req.__USER__.isApp){
|
|
|
refer = refer + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
|
|
|
}else{
|
|
|
refer = refer + '?uid='+ req.__USER__.uid;
|
|
|
}
|
|
|
res.redirect(helpers.urlFormat(refer));
|
|
|
} else {
|
|
|
res.render('register', {
|
...
|
...
|
@@ -413,19 +419,18 @@ exports.isLogin = (req, res, next) => { |
|
|
next();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// refer = decodeURI(req.cookies.refer)||req.get("refer");
|
|
|
//
|
|
|
// if (refer) {
|
|
|
// refer = decodeURI(req.cookies.refer)||req.get("refer");
|
|
|
// } else {
|
|
|
// refer = '/activity/student/register';
|
|
|
// }
|
|
|
//没有登录
|
|
|
if(yoho.isApp){
|
|
|
if(!yoho.isLogin){
|
|
|
url = url + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + yoho.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
|
|
|
res.redirect(url);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (req.path === '/student/register' && !yoho.isStudent) {
|
|
|
url = '/activity/student/register';
|
|
|
}
|
|
|
// if (req.path === '/student/register' && !yoho.isStudent) {
|
|
|
// url = '/activity/student/register';
|
|
|
// }
|
|
|
res.redirect(helpers.urlFormat('/signin.html', {
|
|
|
refer: url
|
|
|
}));
|
...
|
...
|
|