Authored by 李奇

/evalute/queryReasonBySettingType接口session_key验证添加

@@ -111,9 +111,12 @@ const saveEval = (req, res, next) => { @@ -111,9 +111,12 @@ const saveEval = (req, res, next) => {
111 * @param next 111 * @param next
112 */ 112 */
113 const queryReason = (req, res, next) => { 113 const queryReason = (req, res, next) => {
  114 + const uid = req.user.uid;
114 const type = req.body.type; 115 const type = req.body.type;
  116 + const encryptedUid = aes.encryptionUid(uid);
  117 +
115 118
116 - clientApi.queryReason(type) 119 + clientApi.queryReason(uid, encryptedUid, type)
117 .then(result => { 120 .then(result => {
118 res.json(result); 121 res.json(result);
119 }).catch(next); 122 }).catch(next);
@@ -97,9 +97,11 @@ const saveEval = (params) => { @@ -97,9 +97,11 @@ const saveEval = (params) => {
97 * @param cvId 97 * @param cvId
98 * @returns {*} 98 * @returns {*}
99 */ 99 */
100 -const queryReason = (type) => { 100 +const queryReason = (uid, encryptedUid, type) => {
101 const params = { 101 const params = {
102 - type 102 + uid,
  103 + type,
  104 + encryptedUid
103 }; 105 };
104 106
105 return api.post(urls.evalReason, params); 107 return api.post(urls.evalReason, params);
@@ -36,6 +36,12 @@ var _fetchReason = (function() { @@ -36,6 +36,12 @@ var _fetchReason = (function() {
36 type: YOHO_CS 36 type: YOHO_CS
37 }) 37 })
38 .done(function(res) { 38 .done(function(res) {
  39 + if (res && res.code === 401) {
  40 + window.onbeforeunload = null;
  41 + return location.href = '//www.yohobuy.com/signin.html?refer=' + // eslint-disable-line
  42 + encodeURIComponent(location.href);
  43 + }
  44 +
39 if (res.code === 200) { 45 if (res.code === 200) {
40 cache = res.data; 46 cache = res.data;
41 render(cache); 47 render(cache);