Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
Email Patches
Plain Diff
Browse Files
Authored by
Aiden Xu
9 years ago
Commit
9df7f9d917ddbd4889686e503a612bdd98558dd3
1 parent
906e66f7
分期订单
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
150 deletions
.gitignore
app.js
doraemon/middleware/devtools.js
doraemon/views/layout.hbs
.gitignore
View file @
9df7f9d
# Created by https://www.gitignore.io/api/node,webstorm,netbeans,sublimetext,vim
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
### WebStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea/
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### WebStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
.nb-gradle/
### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
### Vim ###
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
### VS Code ###
.vscode/
### YOHO ###
dist
public/css/*
public/bundle/*
.eslintcache
*.log.*
nbproject/*
.DS_Store
# Created by https://www.gitignore.io/api/node,webstorm,netbeans,sublimetext,vim
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
### WebStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea/
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### WebStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
.nb-gradle/
### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
### Vim ###
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
### VS Code ###
.vscode/
### YOHO ###
dist
public/css/*
public/bundle/*
.eslintcache
*.log.*
nbproject/*
.DS_Store
.devhost
...
...
app.js
View file @
9df7f9d
...
...
@@ -86,13 +86,17 @@ try {
const
setYohoData
=
require
(
'./doraemon/middleware/set-yoho-data'
);
const
errorHanlder
=
require
(
'./doraemon/middleware/error-handler'
);
const
setPageInfo
=
require
(
'./doraemon/middleware/set-pageinfo'
);
const
devtools
=
require
(
'./doraemon/middleware/devtools'
);
// YOHO 前置中间件
app
.
use
(
setYohoData
());
app
.
use
(
user
());
app
.
use
(
setPageInfo
());
if
(
app
.
locals
.
devEnv
)
{
app
.
use
(
devtools
());
}
require
(
'./dispatch'
)(
app
);
app
.
all
(
'*'
,
errorHanlder
.
notFound
());
// 404
...
...
doraemon/middleware/devtools.js
0 → 100644
View file @
9df7f9d
'use strict'
;
const
fs
=
require
(
'fs'
);
let
devHost
=
'localhost'
;
fs
.
readFile
(
'.devhost'
,
(
err
,
buf
)
=>
{
if
(
!
err
)
{
devHost
=
JSON
.
parse
(
buf
.
toString
()).
host
;
}
});
module
.
exports
=
()
=>
{
return
(
req
,
res
,
next
)
=>
{
Object
.
assign
(
res
.
locals
,
{
devHost
:
devHost
});
next
();
};
};
...
...
doraemon/views/layout.hbs
View file @
9df7f9d
...
...
@@ -18,7 +18,7 @@
(
function
(
d
,
c
){
var
e
=
d
.
documentElement
,
a
=
"orientationchange"
in
window
?
"orientationchange"
:
"resize"
,
b
=
function
(){
var
f
=
e
.
clientWidth
;
if
(
!
f
){
return
}
if
(
f
>=
640
){
e
.
style
.
fontSize
=
"40px"
}
else
{
e
.
style
.
fontSize
=
40
*
(
f
/
640
)
+
"px"
}};
if
(
!
d
.
addEventListener
){
return
}
b
();
c
.
addEventListener
(
a
,
b
,
false
);
d
.
addEventListener
(
"DOMContentLoaded"
,
b
,
false
)})(
document
,
window
);
</script>
{{#if
devEnv
}}
<link
rel=
"stylesheet"
href=
"//
172.16.11.32
:5001/css/index.css"
>
<link
rel=
"stylesheet"
href=
"//
{{
devHost
}}
:5001/css/index.css"
>
{{^}}
<link
rel=
"stylesheet"
href=
"//cdn.yoho.cn/m-yohobuy-node/
{{
version
}}
/index.css"
>
{{/if}}
...
...
@@ -41,8 +41,8 @@
<script
type=
"text/javascript"
src=
"//res.wx.qq.com/open/js/jweixin-1.1.0.js"
></script>
{{/
wechatShare
}}
{{#if
devEnv
}}
<script
src=
"//172.16.11.32:5001/libs.js"
></script>
<script
src=
"//172.16.11.32:5001/
{{
module
}}
.
{{
page
}}
.js"
></script>
<script
src=
"//
{{
devHost
}}
:5001/libs.js"
></script>
<script
src=
"//
{{
devHost
}}
:5001/
{{
module
}}
.
{{
page
}}
.js"
></script>
{{^}}
<script
src=
"//cdn.yoho.cn/m-yohobuy-node/
{{
version
}}
/libs.js"
></script>
<script
src=
"//cdn.yoho.cn/m-yohobuy-node/
{{
version
}}
/
{{
module
}}
.
{{
page
}}
.js"
></script>
...
...
Please
register
or
login
to post a comment