Authored by 郭成尧

appVersion

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 const _ = require('lodash'); 3 const _ = require('lodash');
4 const cookie = global.yoho.cookie; 4 const cookie = global.yoho.cookie;
5 const authcode = require('../../utils/authcode'); 5 const authcode = require('../../utils/authcode');
6 -const packageData = require('../../package.json'); 6 +const config = global.yoho.config;
7 7
8 module.exports = () => { 8 module.exports = () => {
9 return (req, res, next) => { 9 return (req, res, next) => {
@@ -49,7 +49,7 @@ module.exports = () => { @@ -49,7 +49,7 @@ module.exports = () => {
49 return _.parseInt(req.cookies.app_uid); 49 return _.parseInt(req.cookies.app_uid);
50 }, 50 },
51 sessionKey: req.cookies.app_session_key, 51 sessionKey: req.cookies.app_session_key,
52 - appVersion: req.query.app_version || req.cookies.app_version || packageData.version, 52 + appVersion: req.query.app_version || req.cookies.app_version || config.appVersion,
53 appSessionType: req.cookies.app_client_type 53 appSessionType: req.cookies.app_client_type
54 }; 54 };
55 } 55 }
@@ -63,7 +63,7 @@ module.exports = () => { @@ -63,7 +63,7 @@ module.exports = () => {
63 )) 63 ))
64 ) { 64 ) {
65 let appUid = req.query.uid || req.cookies.app_uid; 65 let appUid = req.query.uid || req.cookies.app_uid;
66 - let appVersion = req.query.app_version || req.cookies.app_version || packageData.version; 66 + let appVersion = req.query.app_version || req.cookies.app_version || config.appVersion;
67 let appSessionType = req.query.client_type || req.cookies.app_client_type; 67 let appSessionType = req.query.client_type || req.cookies.app_client_type;
68 68
69 req.query.uid = { 69 req.query.uid = {