...
|
...
|
@@ -39,23 +39,6 @@ module.exports = () => { |
|
|
}
|
|
|
} else {
|
|
|
if (!req.user.uid &&
|
|
|
req.cookies.app_uid &&
|
|
|
req.cookies.app_uid !== '0' &&
|
|
|
req.cookies.app_session_key &&
|
|
|
req.cookies.app_version &&
|
|
|
req.cookies.app_client_type) {
|
|
|
// 调用接口传参时切勿使用toString获得字符串
|
|
|
req.user.uid = {
|
|
|
toString: () => {
|
|
|
return _.parseInt(req.cookies.app_uid);
|
|
|
},
|
|
|
sessionKey: req.cookies.app_session_key,
|
|
|
appVersion: req.cookies.app_version || req.query.app_version || config.appVersion,
|
|
|
appSessionType: req.cookies.app_client_type
|
|
|
};
|
|
|
}
|
|
|
|
|
|
if (!req.user.uid &&
|
|
|
(
|
|
|
(req.query.uid && req.query.uid !== '0') ||
|
|
|
(
|
...
|
...
|
@@ -67,7 +50,7 @@ module.exports = () => { |
|
|
)
|
|
|
) {
|
|
|
let appUid = req.query.uid || req.cookies.app_uid;
|
|
|
let appVersion = req.cookies.app_version || req.query.app_version || config.appVersion;
|
|
|
let appVersion = req.query.app_version || req.cookies.app_version || config.appVersion;
|
|
|
let appSessionType = req.query.client_type || req.cookies.app_client_type;
|
|
|
let sessionKey = req.query.session_key || req.cookies.app_session_key;
|
|
|
|
...
|
...
|
@@ -89,6 +72,23 @@ module.exports = () => { |
|
|
// res.cookie('app_version', appVersion);
|
|
|
// res.cookie('app_client_type', appSessionType);
|
|
|
}
|
|
|
|
|
|
if (!req.user.uid &&
|
|
|
req.cookies.app_uid &&
|
|
|
req.cookies.app_uid !== '0' &&
|
|
|
req.cookies.app_session_key &&
|
|
|
req.cookies.app_version &&
|
|
|
req.cookies.app_client_type) {
|
|
|
// 调用接口传参时切勿使用toString获得字符串
|
|
|
req.user.uid = {
|
|
|
toString: () => {
|
|
|
return _.parseInt(req.cookies.app_uid);
|
|
|
},
|
|
|
sessionKey: req.cookies.app_session_key,
|
|
|
appVersion: req.cookies.app_version || req.query.app_version || config.appVersion,
|
|
|
appSessionType: req.cookies.app_client_type
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
|
|
|
res.locals.isLogin = Boolean(req.user.uid); // 用户是否登录
|
...
|
...
|
|