Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
8 years ago
Commit
74e0b9c3be5aeda3f5dc576f3449e7986b8dd2c3
1 parent
7408c0b6
add bughd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
app.js
doraemon/views/layout.hbs
utils/helpers.js
app.js
View file @
74e0b9c
...
...
@@ -47,6 +47,7 @@ global.appRoot = path.resolve(__dirname);
// 向模板注入变量
app
.
locals
.
devEnv
=
app
.
get
(
'env'
)
===
'development'
;
app
.
locals
.
isProduction
=
app
.
get
(
'env'
)
===
'production'
;
app
.
locals
.
version
=
pkg
.
version
;
// zookeeper
...
...
doraemon/views/layout.hbs
View file @
74e0b9c
...
...
@@ -42,6 +42,13 @@
<script
src=
"//
{{#
isEqual
cdn
'qcloud'
}}
qcdn.yoho.cn
{{^}}
cdn.yoho.cn
{{/
isEqual
}}
/yohobuy-node/
{{
version
}}
/
{{
module
}}
.
{{
page
}}
.js"
></script>
{{>
analysis
}}
{{/if}}
{{#
ifand
isProduction
pc
.
open
.
bughd
}}
<script
type=
"text/javascript"
src=
"https://dn-bughd-web.qbox.me/bughd.min.js"
crossOrigin=
"anonymous"
></script>
<script
type=
"text/javascript"
>
window
.
bughd
=
window
.
bughd
||
function
(){};
bughd
(
"create"
,{
key
:
"986befe1e91cae7c844df12923febcf6"
})
</script>
{{/
ifand
}}
<script>
window.cdn='
{{
cdn
}}
'
;
</script>
<script>
window._version='
{{
version
}}
'
;
</script>
</body>
...
...
utils/helpers.js
View file @
74e0b9c
...
...
@@ -65,5 +65,23 @@ module.exports = {
}
else
{
return
''
;
}
},
ifand
:
function
()
{
let
args
=
Array
.
prototype
.
slice
.
call
(
arguments
);
let
opt
=
args
[
args
.
length
-
1
];
let
isTrue
=
true
;
for
(
let
i
=
0
;
i
<
args
.
length
-
1
;
i
++
)
{
if
(
!
args
[
i
])
{
isTrue
=
false
;
break
;
}
}
if
(
isTrue
)
{
return
opt
.
fn
(
this
);
}
else
{
return
opt
.
inverse
(
this
);
}
}
};
...
...
Please
register
or
login
to post a comment