Authored by 邱骏

Merge branch 'feature/wechatCs' into feature/converse

@@ -19,7 +19,7 @@ COPY yoho-activity-platform.tar.gz /home @@ -19,7 +19,7 @@ COPY yoho-activity-platform.tar.gz /home
19 RUN cd /home && \ 19 RUN cd /home && \
20 mkdir -p /home/yoho-activity-platform && \ 20 mkdir -p /home/yoho-activity-platform && \
21 mkdir -p /Data/log/yoho-activity-platform && \ 21 mkdir -p /Data/log/yoho-activity-platform && \
22 - tar -xzvf yoho-activity-platform.tar.gz -C /home/yoho-activity-platform && \ 22 + tar -xzf yoho-activity-platform.tar.gz -C /home/yoho-activity-platform && \
23 rm -rf yoho-activity-platform.tar.gz 23 rm -rf yoho-activity-platform.tar.gz
24 24
25 WORKDIR /home/yoho-activity-platform 25 WORKDIR /home/yoho-activity-platform
@@ -89,7 +89,7 @@ try { @@ -89,7 +89,7 @@ try {
89 89
90 // docker验证项目是否正常发布 90 // docker验证项目是否正常发布
91 app.use('/node/status.html', (req, res) => { 91 app.use('/node/status.html', (req, res) => {
92 - return res.status(204).end(); 92 + return res.status(200).end();
93 }); 93 });
94 94
95 require('./dispatch')(app); 95 require('./dispatch')(app);
@@ -159,6 +159,22 @@ const wechatShare = { @@ -159,6 +159,22 @@ const wechatShare = {
159 } 159 }
160 160
161 }).catch(next); 161 }).catch(next);
  162 + },
  163 +
  164 + getWechatCs(req, res, next) {
  165 + let param = req.body || {};
  166 + let uid = {
  167 + toString: () => {
  168 + return parseInt(param.uid, 10);
  169 + },
  170 + sessionKey: param.sessionKey,
  171 + appVersion: param.appVersion,
  172 + appSessionType: param.sessionType
  173 + };
  174 +
  175 + return req.ctx(WechatModel).getIsNeedAddWechatCS(uid).then(result => {
  176 + return res.json(result);
  177 + }).catch(next);
162 } 178 }
163 }; 179 };
164 180
@@ -68,13 +68,13 @@ class WechatModel extends global.yoho.BaseModel { @@ -68,13 +68,13 @@ class WechatModel extends global.yoho.BaseModel {
68 }; 68 };
69 69
70 if (type === 'save') { 70 if (type === 'save') {
71 - strSql = `insert into ${TABLE_WECHAT}  
72 - (access_token, access_ticket, access_create_time, access_expired) values 71 + strSql = `insert into ${TABLE_WECHAT}
  72 + (access_token, access_ticket, access_create_time, access_expired) values
73 (:access_token, :access_ticket, :access_create_time, :access_expired);`; 73 (:access_token, :access_ticket, :access_create_time, :access_expired);`;
74 74
75 return mysqlCli.insert(strSql, params); 75 return mysqlCli.insert(strSql, params);
76 } else if (type === 'update') { 76 } else if (type === 'update') {
77 - strSql = `update ${TABLE_WECHAT} set 77 + strSql = `update ${TABLE_WECHAT} set
78 access_token = :access_token, 78 access_token = :access_token,
79 access_ticket = :access_ticket, 79 access_ticket = :access_ticket,
80 access_create_time = :access_create_time, 80 access_create_time = :access_create_time,
@@ -84,6 +84,16 @@ class WechatModel extends global.yoho.BaseModel { @@ -84,6 +84,16 @@ class WechatModel extends global.yoho.BaseModel {
84 } 84 }
85 85
86 } 86 }
  87 +
  88 + getIsNeedAddWechatCS(uid) {
  89 + return this.get({
  90 + url: '',
  91 + data: {
  92 + method: 'app.passport.getIsNeedAddWechatCS',
  93 + uid: uid
  94 + }
  95 + });
  96 + }
87 } 97 }
88 98
89 module.exports = WechatModel; 99 module.exports = WechatModel;
@@ -63,4 +63,7 @@ router.post('/guochao/checkFav', guochao.checkFav); @@ -63,4 +63,7 @@ router.post('/guochao/checkFav', guochao.checkFav);
63 // 图片处理git 63 // 图片处理git
64 router.get('/shoes/getBase64ImageData', shoes.getImageData); 64 router.get('/shoes/getBase64ImageData', shoes.getImageData);
65 65
  66 +// 查询专属客服微信号
  67 +router.post('/getWechatCs', wechat.getWechatCs);
  68 +
66 module.exports = router; 69 module.exports = router;
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 const pkg = require('../package.json'); 8 const pkg = require('../package.json');
9 9
10 const isProduction = process.env.NODE_ENV === 'production'; 10 const isProduction = process.env.NODE_ENV === 'production';
11 -const isTest = process.env.NODE_ENV === 'test'; 11 +const isTest = process.env.NODE_ENV === 'test3';
12 12
13 module.exports = { 13 module.exports = {
14 app: 'h5', 14 app: 'h5',
@@ -19,14 +19,14 @@ module.exports = { @@ -19,14 +19,14 @@ module.exports = {
19 19
20 yohoVerifyUdid: '0f626ede-0e17-460b-a8ea-069ee506e8e9', 20 yohoVerifyUdid: '0f626ede-0e17-460b-a8ea-069ee506e8e9',
21 domains: { 21 domains: {
22 - // api: 'http://api-test3.yohops.com:9999/',  
23 - // service: 'http://service-test3.yohops.com:9999/',  
24 - // singleApi: 'http://api-test3.yohops.com:9999/' 22 + api: 'http://api-test3.dev.yohocorp.com/',
  23 + service: 'http://api-test3.dev.yohocorp.com/',
  24 + singleApi: 'http://api-test3.yohops.com:9999/',
25 25
26 - singleApi: 'http://api.yoho.cn/',  
27 - api: 'http://api.yoho.cn/', 26 + // singleApi: 'http://api.yoho.cn/',
  27 + // api: 'http://api.yoho.cn/',
  28 + // service: 'http://service.yoho.cn/',
28 store: 'http://192.168.102.47:8080/portal-gateway/wechat/', 29 store: 'http://192.168.102.47:8080/portal-gateway/wechat/',
29 - service: 'http://service.yoho.cn/',  
30 serviceNotify: 'http://service.yoho.cn/', 30 serviceNotify: 'http://service.yoho.cn/',
31 platformApi: 'http://172.16.6.210:8088/', 31 platformApi: 'http://172.16.6.210:8088/',
32 }, 32 },
@@ -67,15 +67,13 @@ module.exports = { @@ -67,15 +67,13 @@ module.exports = {
67 maxFiles: 7 67 maxFiles: 7
68 }, 68 },
69 console: { 69 console: {
70 - level: 'info', 70 + level: 'debug',
71 colorize: 'all', 71 colorize: 'all',
72 prettyPrint: true 72 prettyPrint: true
73 } 73 }
74 }, 74 },
75 redis: { 75 redis: {
76 connect: { 76 connect: {
77 - // host: '127.0.0.1',  
78 -  
79 host: '192.168.102.49', 77 host: '192.168.102.49',
80 port: '6379', 78 port: '6379',
81 enable_offline_queue: false, 79 enable_offline_queue: false,
@@ -96,10 +94,10 @@ module.exports = { @@ -96,10 +94,10 @@ module.exports = {
96 }, 94 },
97 mysql: { 95 mysql: {
98 connect: { 96 connect: {
99 - host: 'localhost', 97 + host: '192.168.102.219',
100 port: '3306', 98 port: '3306',
101 - user: 'root',  
102 - password: '' 99 + user: 'yh_test',
  100 + password: 'yh_test'
103 }, 101 },
104 database: 'yoho_activity_platform', 102 database: 'yoho_activity_platform',
105 }, 103 },
@@ -190,21 +188,21 @@ if (isProduction) { @@ -190,21 +188,21 @@ if (isProduction) {
190 siteUrl: '//action.yoho.cn', 188 siteUrl: '//action.yoho.cn',
191 assetUrl: `/yoho-activity-platform/${pkg.version}/`, 189 assetUrl: `/yoho-activity-platform/${pkg.version}/`,
192 domains: { 190 domains: {
193 - api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',  
194 - service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',  
195 - global: process.env.TEST_GLOBAL || 'http://global-test-soa.yohops.com:9999/',  
196 - store: process.env.TEST_STORE || 'http://192.168.102.210:8080/portal-gateway/wechat/',  
197 - liveApi: process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/',  
198 - singleApi: process.env.TEST_SINGLE || 'http://api-test1.yohops.com:9999/', 191 + api: 'http://api-test3.dev.yohocorp.com/',
  192 + service: 'http://api-test3.dev.yohocorp.com/',
  193 + global: 'http://global-test-soa.yohops.com:9999/',
  194 + store: 'http://192.168.102.210:8080/portal-gateway/wechat/',
  195 + liveApi: 'http://testapi.live.yohops.com:9999/',
  196 + singleApi: 'http://api-test3.dev.yohocorp.com/',
199 platformApi: 'http://192.168.102.48:8088/' 197 platformApi: 'http://192.168.102.48:8088/'
200 }, 198 },
201 useCache: true, 199 useCache: true,
202 mysql: { 200 mysql: {
203 connect: { 201 connect: {
204 - host: 'localhost', 202 + host: '192.168.102.219',
205 port: '3306', 203 port: '3306',
206 - user: 'root',  
207 - password: '' 204 + user: 'yh_test',
  205 + password: 'yh_test'
208 }, 206 },
209 database: 'yoho_activity_platform', 207 database: 'yoho_activity_platform',
210 } 208 }
@@ -14,6 +14,21 @@ module.exports = { @@ -14,6 +14,21 @@ module.exports = {
14 }, 14 },
15 seederStorage: 'sequelize' 15 seederStorage: 'sequelize'
16 }, 16 },
  17 + test3: {
  18 + username: 'yh_test',
  19 + password: 'yh_test',
  20 + database: 'yoho_activity_platform',
  21 + port: '3306',
  22 + host: '192.168.102.219',
  23 + dialect: 'mysql',
  24 + pool: {
  25 + max: 5,
  26 + min: 0,
  27 + acquire: 30000,
  28 + idle: 10000
  29 + },
  30 + seederStorage: 'sequelize'
  31 + },
17 production: { 32 production: {
18 username: 'yh_vpc_bak', 33 username: 'yh_vpc_bak',
19 password: 'yoho@2Y$^YpNb7hp', 34 password: 'yoho@2Y$^YpNb7hp',
1 #!/bin/bash 1 #!/bin/bash
2 -wordir=$2 2 +wordir=$1
3 cd $wordir 3 cd $wordir
4 rm -rf yoho-activity-platform.tar.gz 4 rm -rf yoho-activity-platform.tar.gz
5 -if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]  
6 -then  
7 - NODE_ENV='test'  
8 -elif [[ $1 == "GRAY-QCLOUD" ]]  
9 -then  
10 - NODE_ENV='gray'  
11 -elif [[ $1 == "ONLINE-AWS" ]] || [[ $1 == "ONLINE-QCLOUD" ]]  
12 -then  
13 - NODE_ENV='production'  
14 -fi  
15 -yarn  
16 -NODE_ENV=development yarn 5 +yarn --production=false
17 yarn build 6 yarn build
18 -tar -czvf yoho-activity-platform.tar.gz * 7 +tar -czf yoho-activity-platform.tar.gz *
  1 +2b0f287ebc269a4629e5c63eb94d0644
  1 +8a9723d4f7974a78efe7bcc47a2de387
  1 +6f7ce9d3dec89f5ea16431a6030f5d43
  1 +a8dd03d2504673733288baa043e8301d
  1 +02313c3236dd18aa06d45ee3bd8f0370
  1 +356ae3dc3a7e3eaa9324067e556adebf
  1 +ec8ca55d0c7367250f8d1c65900e7817
  1 +03e6ff8f6d803c17a1c1efc228b5a016
  1 +e0bfe6ed930a4fb609e28e6f95b9cb57
  1 +364348225d35f530b1b1d3cf42f035a6
  1 +083dbe1ac022090c78012381d40172fe
  1 +6aafbae56001d931446d84bdf4d52daf
  1 +ba8b7adc2de640fd349bc52c689edd5a
  1 +cb4c52feccd3157e9eecf10374b4430a
  1 +10521533b62f7f5f9f11e0cac5b144c6
  1 +ade4ec0161c2fd4a35621f44cfc2869c
  1 +8f77a3a9cc3e575826068d814e938248
  1 +ddf6b705c75cda4e14ba3fc41bbce800
  1 +ee49c5b03d983c66d9da737d8eb4f53a
  1 +c4e6bfff407522b24a13347ae384c23c
  1 +20608d555610a3ccb6e4b4659f2bde8f
  1 +b3ffed72b88e1eff1815eb1fa69e7c9b
  1 +dc09801c5326fc992cae091280b16282
  1 +1062df56cb75c5d93c37f6b6481b740f
  1 +e8afa4320cbbd038d9d7d46f25edfd85
  1 +feb10dd32a7262a75f0d8c854a5402b2
  1 +1856de9c47814eb0ce0518d8398c8c80
  1 +22a365ab9d801db75234f0ff28b21fe3
  1 +55c9dc4ced0ef36b777058ee8c548a34
  1 +546ef472fd6e8f6e6e2903c42343fb51