Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
d4e4b76216fd43215eabcb4d769f57f7f2a70e9a
2 parents
e349c160
ccd007a1
master
...
feature/blk-miniapp
feature/brand-multi-shops
feature/change
feature/context
feature/context-and-tracking
feature/docker
feature/hotfix
feature/leftScrollMore
feature/listGoodsList
feature/style
feature/tracking
feature/webpack-hash
gray
hotfix/moreGoods
hotfix/ssr
release/0725
release/5.8
merge
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
124 additions
and
39 deletions
config/common.js
doraemon/middleware/devtools.js
doraemon/middleware/user.js
package.json
public/build/webpack.dev.config.js
public/js/global.js
yarn.lock
config/common.js
View file @
d4e4b76
...
...
@@ -18,9 +18,9 @@ module.exports = {
app_type
:
1
},
domains
:
{
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
singleApi
:
'http://api-test3.yohops.com:9999/'
api
:
'http://api-test2.yohops.com:9999/'
,
service
:
'http://service-test2.yohops.com:9999/'
,
singleApi
:
'http://api-test2.yohops.com:9999/'
// api: 'http://api-test2.yohops.com:9999/',
// service: 'http://service-test2.yohops.com:9999/',
...
...
@@ -38,6 +38,11 @@ module.exports = {
default
:
'//m.yohoblk.com'
,
index
:
'//m.yohoblk.com'
},
report
:
{
host
:
'10.66.0.139'
,
port
:
8086
,
db
:
'web-apm'
},
useOneapm
:
false
,
useCache
:
true
,
memcache
:
{
...
...
@@ -78,7 +83,7 @@ module.exports = {
port
:
'4444'
// influxdb port
},
console
:
{
level
:
'
info
'
,
level
:
'
debug
'
,
colorize
:
'all'
,
prettyPrint
:
true
}
...
...
@@ -118,15 +123,48 @@ if (isProduction) {
api
:
'app-java-168863769.cn-north-1.elb.amazonaws.com.cn'
,
service
:
'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
}
},
loggers
:
{
infoFile
:
{
name
:
'info'
,
level
:
'info'
,
filename
:
'logs/info.log'
,
maxFiles
:
7
},
errorFile
:
{
name
:
'error'
,
level
:
'error'
,
filename
:
'logs/error.log'
,
handleExceptions
:
true
,
maxFiles
:
7
},
udp
:
{
// send by udp
level
:
'debug'
,
// logger level
host
:
'influxdblog.yohoops.org'
,
// influxdb host
port
:
'4444'
// influxdb port
},
console
:
{
level
:
'info'
,
colorize
:
'all'
,
prettyPrint
:
true
}
},
report
:
{
host
:
'influxdblog.web.yohoops.org'
,
port
:
8086
,
db
:
'web-apm'
}
});
}
else
if
(
isTest
)
{
Object
.
assign
(
module
.
exports
,
{
appName
:
'm.yohoblk.com for test'
,
domains
:
{
api
:
process
.
env
.
TEST_API
||
'http://testapi.yoho.cn:28078/'
,
service
:
process
.
env
.
TEST_SERVICE
||
'http://testservice.yoho.cn:28077/'
,
singleApi
:
process
.
env
.
TEST_SINGLE
||
'http://192.168.102.31:8092/brower'
// api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
// service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
// singleApi: process.env.TEST_SINGLE || 'http://api-test1.yohops.com:9999/'
api
:
'http://api-test2.yohops.com:9999/'
,
service
:
'http://service-test2.yohops.com:9999/'
,
singleApi
:
'http://api-test2.yohops.com:9999/'
},
memcache
:
{
master
:
[
'192.168.104.15:12111'
,
'192.168.104.29:12111'
,
'192.168.104.32:12111'
],
...
...
doraemon/middleware/devtools.js
View file @
d4e4b76
'use strict'
;
const
fs
=
require
(
'fs'
);
let
devHost
=
'
127.0.0.1
'
;
let
devHost
=
'
m.yohoblk.com
'
;
fs
.
readFile
(
'.devhost'
,
(
err
,
buf
)
=>
{
if
(
!
err
)
{
...
...
doraemon/middleware/user.js
View file @
d4e4b76
const
_
=
require
(
'lodash'
);
const
md5
=
require
(
'yoho-md5'
);
const
config
=
global
.
yoho
.
config
;
module
.
exports
=
()
=>
{
return
(
req
,
res
,
next
)
=>
{
...
...
@@ -11,6 +13,25 @@ module.exports = () => {
delete
req
.
cookies
.
_YOHOUID
;
}
// app 内处理
if
(
req
.
yoho
.
isApp
)
{
if
(
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
};
}
}
delete
req
.
query
.
app_version
;
delete
req
.
query
.
client_secret
;
delete
req
.
query
.
client_type
;
...
...
package.json
View file @
d4e4b76
...
...
@@ -53,7 +53,7 @@
"yoho-cookie"
:
"1.2.0"
,
"yoho-jquery"
:
"^2.2.4"
,
"yoho-md5"
:
"^2.0.0"
,
"yoho-node-lib"
:
"
0.2.17
"
,
"yoho-node-lib"
:
"
=0.5.21
"
,
"yoho-qs"
:
"1.0.1"
,
"yoho-store"
:
"^1.3.20"
},
...
...
public/build/webpack.dev.config.js
View file @
d4e4b76
...
...
@@ -5,7 +5,7 @@ const devInfo = require('./dev-info.js');
let
baseConfig
=
require
(
'./webpack.base.config'
);
baseConfig
.
entry
.
libs
.
push
(
path
.
join
(
__dirname
,
'../js/dev.js'
));
//
baseConfig.entry.libs.push(path.join(__dirname, '../js/dev.js'));
module
.
exports
=
merge
(
baseConfig
,
{
output
:
{
...
...
public/js/global.js
View file @
d4e4b76
...
...
@@ -6,12 +6,18 @@
import
$
from
'jquery'
;
import
cookie
from
'yoho-cookie'
;
import
yoho
from
'yoho'
;
// 初始化
import
tip
from
'common/tip'
;
// 注册ajaxError处理服务端401状态
$
(
document
).
ajaxError
((
event
,
xhr
)
=>
{
if
(
xhr
.
status
===
401
)
{
if
(
yoho
.
isApp
&&
!
cookie
.
get
(
'app_version'
))
{
tip
({
txt
:
'请升级APP至最新版'
,
delay
:
600
*
1000
});
return
;
}
cookie
.
remove
(
'_UID'
);
cookie
.
remove
(
'_TOKEN'
);
...
...
yarn.lock
View file @
d4e4b76
...
...
@@ -1083,7 +1083,7 @@ block-stream@*:
dependencies:
inherits "~2.0.0"
bluebird@3.x.x, bluebird@^3.0.6, bluebird@^3.1.1, bluebird@^3.
3, bluebird@^3.4.0, bluebird@^3.
4.2, bluebird@^3.5.0:
bluebird@3.x.x, bluebird@^3.0.6, bluebird@^3.1.1, bluebird@^3.4.2, bluebird@^3.5.0:
version "3.5.1"
resolved "http://npm.yoho.cn/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
...
...
@@ -2277,7 +2277,7 @@ debug@2.6.9, debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.6.0, debug@^2.6.
dependencies:
ms "2.0.0"
debug@^3.0.0, debug@^3.1.0:
debug@^3.0.0, debug@^3.
0.1, debug@^3.
1.0:
version "3.1.0"
resolved "http://npm.yoho.cn/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
...
...
@@ -2416,6 +2416,13 @@ dns-txt@^2.0.2:
dependencies:
buffer-indexof "^1.0.0"
dnscache@^1.0.1:
version "1.0.1"
resolved "http://npm.yoho.cn/dnscache/-/dnscache-1.0.1.tgz#42cb2b9bfb5e8fbdfa395aac74e127fc05074d31"
dependencies:
asap "~2.0.3"
lodash.clone "~4.3.2"
doctrine@^2.0.0:
version "2.0.2"
resolved "http://npm.yoho.cn/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075"
...
...
@@ -2700,8 +2707,8 @@ es6-promise@^3.1.2:
resolved "http://npm.yoho.cn/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
es6-promise@^4.0.3:
version "4.2.1"
resolved "http://npm.yoho.cn/es6-promise/-/es6-promise-4.2.1.tgz#3b98a6714ba1b9267428b2c00e6265b16dab0205"
version "4.2.2"
resolved "http://npm.yoho.cn/es6-promise/-/es6-promise-4.2.2.tgz#f722d7769af88bd33bc13ec6605e1f92966b82d9"
es6-set@~0.1.5:
version "0.1.5"
...
...
@@ -4049,6 +4056,14 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
influx-batch-sender@^0.1.4:
version "0.1.5"
resolved "http://npm.yoho.cn/influx-batch-sender/-/influx-batch-sender-0.1.5.tgz#865a5eb9a446f4e8ed442ab44e67c3532c27a5d7"
dependencies:
debug "^3.0.1"
lodash "^4.17.4"
request "^2.83.0"
influxdb-winston@^1.0.1:
version "1.0.1"
resolved "http://npm.yoho.cn/influxdb-winston/-/influxdb-winston-1.0.1.tgz#e01af018a557caf11a292bf20f9fa04a8672a9de"
...
...
@@ -4730,6 +4745,10 @@ lodash._basecallback@^3.0.0:
lodash.isarray "^3.0.0"
lodash.pairs "^3.0.0"
lodash._baseclone@~4.5.0:
version "4.5.7"
resolved "http://npm.yoho.cn/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz#ce42ade08384ef5d62fa77c30f61a46e686f8434"
lodash._basecopy@^3.0.0:
version "3.0.1"
resolved "http://npm.yoho.cn/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
...
...
@@ -4806,6 +4825,12 @@ lodash.clone@^4.3.2:
version "4.5.0"
resolved "http://npm.yoho.cn/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6"
lodash.clone@~4.3.2:
version "4.3.2"
resolved "http://npm.yoho.cn/lodash.clone/-/lodash.clone-4.3.2.tgz#e56b176b6823a7dde38f7f2bf58de7d5971200e9"
dependencies:
lodash._baseclone "~4.5.0"
lodash.clonedeep@^4.3.2:
version "4.5.0"
resolved "http://npm.yoho.cn/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
...
...
@@ -4923,7 +4948,7 @@ lodash.uniq@^4.5.0:
version "4.5.0"
resolved "http://npm.yoho.cn/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
lodash@4.17.4, lodash@^4.0.0, lodash@^4.1.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.3.0, lodash@
^4.6.1, lodash@
~4.17.4:
lodash@4.17.4, lodash@^4.0.0, lodash@^4.1.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.4:
version "4.17.4"
resolved "http://npm.yoho.cn/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
...
...
@@ -5078,10 +5103,6 @@ memcached@2.2.x, memcached@^2.2.1, memcached@^2.2.2:
hashring "3.2.x"
jackpot ">=0.0.6"
memory-cache@^0.1.6:
version "0.1.6"
resolved "http://npm.yoho.cn/memory-cache/-/memory-cache-0.1.6.tgz#2ed9933ed7a8c718249be7366f7ca8749acf8a24"
memory-fs@^0.2.0:
version "0.2.0"
resolved "http://npm.yoho.cn/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290"
...
...
@@ -6083,6 +6104,10 @@ pidusage-fork@^0.1.1:
version "0.1.2"
resolved "http://npm.yoho.cn/pidusage-fork/-/pidusage-fork-0.1.2.tgz#a60c26d054e105cdb13243d083e81c7de8c1eef5"
pidusage@^1.1.6:
version "1.2.0"
resolved "http://npm.yoho.cn/pidusage/-/pidusage-1.2.0.tgz#65ee96ace4e08a4cd3f9240996c85b367171ee92"
pify@^2.0.0, pify@^2.3.0:
version "2.3.0"
resolved "http://npm.yoho.cn/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
...
...
@@ -7363,14 +7388,6 @@ request-promise-core@1.1.1:
dependencies:
lodash "^4.13.1"
request-promise@^3.0.0:
version "3.0.0"
resolved "http://npm.yoho.cn/request-promise/-/request-promise-3.0.0.tgz#be1edb26f41c49cd1d5656c6753d6842a1249f46"
dependencies:
bluebird "^3.3"
lodash "^4.6.1"
request "^2.34"
request-promise@^4.2.1:
version "4.2.2"
resolved "http://npm.yoho.cn/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4"
...
...
@@ -7380,7 +7397,7 @@ request-promise@^4.2.1:
stealthy-require "^1.1.0"
tough-cookie ">=2.3.3"
request@2, request@^2.
34, request@^2.44.0, request@^2.79.0, request@^2.81
.0:
request@2, request@^2.
44.0, request@^2.79.0, request@^2.81.0, request@^2.83
.0:
version "2.83.0"
resolved "http://npm.yoho.cn/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356"
dependencies:
...
...
@@ -8931,7 +8948,7 @@ uuid@^2.0.2:
version "2.0.3"
resolved "http://npm.yoho.cn/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
uuid@^3.0.0, uuid@^3.1.0:
uuid@^3.0.0, uuid@^3.
0.1, uuid@^3.
1.0:
version "3.1.0"
resolved "http://npm.yoho.cn/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
...
...
@@ -9434,7 +9451,7 @@ winston-daily-rotate-file@^1.1.1, winston-daily-rotate-file@^1.3.0:
dependencies:
mkdirp "0.5.1"
winston@^2.2.0, winston@^2.3.1:
winston@^2.2.0, winston@^2.3.1
, winston@^2.4.0
:
version "2.4.0"
resolved "http://npm.yoho.cn/winston/-/winston-2.4.0.tgz#808050b93d52661ed9fb6c26b3f0c826708b0aee"
dependencies:
...
...
@@ -9681,20 +9698,23 @@ yoho-md5@^2.0.0:
version "2.0.0"
resolved "http://npm.yoho.cn/yoho-md5/-/yoho-md5-2.0.0.tgz#e801a5cce8e08f5d7211e9a2e789ea7275eb9332"
yoho-node-lib@0.2.17:
version "0.2.17"
resolved "http://npm.yoho.cn/yoho-node-lib/-/yoho-node-lib-0.2.17.tgz#b01f16fe8967f1d768ceab757ada9d394f45e0ef"
yoho-node-lib@=0.5.21:
version "0.5.21"
resolved "http://npm.yoho.cn/yoho-node-lib/-/yoho-node-lib-0.5.21.tgz#4977a4d9c3da60f08ba17b57a6abe8fab037ccbb"
dependencies:
bluebird "^3.4.0
"
dnscache "^1.0.1
"
handlebars "^4.0.5"
influx-batch-sender "^0.1.4"
lodash "^4.13.1"
lru-cache "^4.1.1"
md5 "^2.1.0"
memcached "^2.2.2"
memory-cache "^0.1.6"
moment "^2.13.0"
request-promise "^3.0.0"
pidusage "^1.1.6"
request "^2.81.0"
uuid "^3.0.1"
walk "^2.3.9"
winston "^2.
2
.0"
winston "^2.
4
.0"
winston-daily-rotate-file "^1.1.1"
xss-filters "^1.2.6"
...
...
Please
register
or
login
to post a comment