Authored by 陈轩

im 改写gDomain的读法

@@ -28,6 +28,7 @@ exports.page = (req, res) => { @@ -28,6 +28,7 @@ exports.page = (req, res) => {
28 width750: true, 28 width750: true,
29 localCss: true, 29 localCss: true,
30 imServer: global.yoho.config.domains.imServer, 30 imServer: global.yoho.config.domains.imServer,
  31 + imSocket: global.yoho.config.domains.imSocket,
31 userData: { 32 userData: {
32 uid: req.user.uid, 33 uid: req.user.uid,
33 encrypteduid: req.user.ENCRYPTION_UID || (crypto.encryption(null, req.user.uid + '' || '0')), 34 encrypteduid: req.user.ENCRYPTION_UID || (crypto.encryption(null, req.user.uid + '' || '0')),
@@ -63,4 +63,10 @@ @@ -63,4 +63,10 @@
63 <input type="hidden" id="js-eid" value="{{encrypteduid}}"> 63 <input type="hidden" id="js-eid" value="{{encrypteduid}}">
64 <input type="hidden" id="js-avatar" value="{{avatar}}"> 64 <input type="hidden" id="js-avatar" value="{{avatar}}">
65 <input type="hidden" id="js-uname" value="{{uname}}"> 65 <input type="hidden" id="js-uname" value="{{uname}}">
66 -{{/with}}  
  66 +{{/with}}
  67 +<script>
  68 + var gDomains = {
  69 + imSocket: "{{imSocket}}",
  70 + imServer: "{{imServer}}",
  71 + };
  72 +</script>
1 -/* global gAssetURI */  
2 module.exports = function(path) { 1 module.exports = function(path) {
3 - return gAssetURI + path; 2 + return window.STATIC_RESOURCE_PATH + path;
4 }; 3 };
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 var config = { 9 var config = {
10 servers: [gDomains.imSocket], 10 servers: [gDomains.imSocket],
11 defaultUserHead: '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif', 11 defaultUserHead: '//img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif',
12 - rebotUserHead: `${gAssetURI}/img/service/chat/im-robot.png`, 12 + rebotUserHead: `${window.STATIC_RESOURCE_PATH}/img/service/chat/im-robot.png`,
13 recType: { 13 recType: {
14 ENTER: 1, // 用户进入 14 ENTER: 1, // 用户进入
15 LINK_SUCCESS: 2, // 连线人工客服回应 15 LINK_SUCCESS: 2, // 连线人工客服回应
@@ -9,9 +9,6 @@ @@ -9,9 +9,6 @@
9 const webpack = require('webpack'); 9 const webpack = require('webpack');
10 const path = require('path'); 10 const path = require('path');
11 const _ = require('lodash'); 11 const _ = require('lodash');
12 -const config = require('../config/common');  
13 -const domains = config.domains;  
14 -const assetURI = config.assetUrl;  
15 const shelljs = require('shelljs'); 12 const shelljs = require('shelljs');
16 const ExtractTextPlugin = require('extract-text-webpack-plugin'); 13 const ExtractTextPlugin = require('extract-text-webpack-plugin');
17 14
@@ -77,10 +74,6 @@ module.exports = { @@ -77,10 +74,6 @@ module.exports = {
77 $: 'yoho-jquery', 74 $: 'yoho-jquery',
78 jQuery: 'yoho-jquery', 75 jQuery: 'yoho-jquery',
79 'window.jQuery': 'yoho-jquery' 76 'window.jQuery': 'yoho-jquery'
80 - }),  
81 - new webpack.DefinePlugin({  
82 - gDomains: JSON.stringify(domains),  
83 - gAssetURI: JSON.stringify(assetURI)  
84 }) 77 })
85 ] 78 ]
86 }; 79 };