Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuloulou
/
yohobuy-portal-fe2
·
Commits
Go to a project
GitLab
Go to dashboard
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
xuhongyun
9 years ago
Commit
0309b92f44c64a51404c8d126cb10dfd1b699f5a
1 parent
600847b8
delete portal cdn
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
19 deletions
code/gulpfile.js
code/index.js
code/libs/Controller.js
server/index.js
server/libs/Controller.js
code/gulpfile.js
View file @
0309b92
...
...
@@ -125,10 +125,9 @@ gulp.task('server', function () {
* 服务器打包
**************************************************************/
gulp
.
task
(
"mvc"
,
[
"controllers"
,
"interfaces"
,
"view"
,
"framework"
]);
gulp
.
task
(
"controllers"
,
function
()
{
vfs
.
src
(
"./apps/**/controllers/*.js"
).
pipe
(
mapStream
(
function
(
file
,
callback
){
file
.
path
=
file
.
path
.
replace
(
/apps
\
\([^/]
+
)\\
controllers
\\
([^
.
]
+
)
.js/g
,
function
(
$0
,
$1
,
$2
){
file
.
path
=
file
.
path
.
replace
(
/apps
\
/([^/]
+
)\/
controllers
\/
([^
.
]
+
)
.js/g
,
function
(
$0
,
$1
,
$2
){
return
[
"controllers"
,
$1
+
"."
+
$2
+
".js"
].
join
(
path
.
sep
);
});
callback
(
null
,
file
);
...
...
@@ -136,7 +135,7 @@ gulp.task("controllers", function () {
});
gulp
.
task
(
"interfaces"
,
function
()
{
vfs
.
src
(
"./apps/**/interfaces/*.js"
).
pipe
(
mapStream
(
function
(
file
,
callback
){
file
.
path
=
file
.
path
.
replace
(
/apps
\
\([^/]
+
)\\
interfaces
\\
([^
.
]
+
)
.js/g
,
function
(
$0
,
$1
,
$2
){
file
.
path
=
file
.
path
.
replace
(
/apps
\
/([^/]
+
)\/
interfaces
\/
([^
.
]
+
)
.js/g
,
function
(
$0
,
$1
,
$2
){
return
[
"interfaces"
,
$1
+
"."
+
$2
+
".js"
].
join
(
path
.
sep
);
});
callback
(
null
,
file
);
...
...
code/index.js
View file @
0309b92
...
...
@@ -112,7 +112,7 @@ if(process.env.NODE_ENV==="gray"){
}
/*线上环境*/
if
(
process
.
env
.
NODE_ENV
===
"production"
){
apiCofig
.
EnvConst
.
domain
=
"http://1
72.31.20.7
:8088/platform"
;
apiCofig
.
EnvConst
.
domain
=
"http://1
27.0.0.1
:8088/platform"
;
apiCofig
.
EnvConst
.
yohoSearch
=
"http://search.yohoops.org/yohosearch"
;
}
module
.
exports
=
require
(
'./libs/App'
)(
apiCofig
);
\ No newline at end of file
...
...
code/libs/Controller.js
View file @
0309b92
...
...
@@ -140,14 +140,14 @@ Controller.prototype.client=function(res,views,model,clientmodel){
var
src
=
""
;
if
(
process
.
env
.
NODE_ENV
===
"production"
||
process
.
env
.
NODE_ENV
===
"gray"
){
src
=
"http://cdn.yoho.cn/"
+
config
.
name
+
"/"
+
config
.
version
;
html
=
html
.
replace
(
/
\/
static
\/
index
\.
min
\.
css/g
,
function
(
$1
){
return
src
+
"/index.min.css"
;
})
}
else
{
// if(process.env.NODE_ENV==="production"||process.env.NODE_ENV==="gray"){
// src="http://cdn.yoho.cn/"+config.name+"/"+config.version;
// html=html.replace(/\/static\/index\.min\.css/g,function($1){
// return src+"/index.min.css";
// })
// }else{
src
=
"/static"
;
}
//
}
var
script
=
[
'<script type="text/javascript" src="'
+
src
+
'/'
+
clientmodel
+
'/libs.js"></script>'
,
'<script type="text/javascript" src="'
+
src
+
'/'
+
clientmodel
+
'/'
+
views
+
'.js"></script>'
];
res
.
send
(
html
+
ViewModel
+
script
.
join
(
''
));
...
...
server/index.js
View file @
0309b92
...
...
@@ -112,7 +112,7 @@ if(process.env.NODE_ENV==="gray"){
}
/*线上环境*/
if
(
process
.
env
.
NODE_ENV
===
"production"
){
apiCofig
.
EnvConst
.
domain
=
"http://1
72.31.20.7
:8088/platform"
;
apiCofig
.
EnvConst
.
domain
=
"http://1
27.0.0.1
:8088/platform"
;
apiCofig
.
EnvConst
.
yohoSearch
=
"http://search.yohoops.org/yohosearch"
;
}
module
.
exports
=
require
(
'./libs/App'
)(
apiCofig
);
\ No newline at end of file
...
...
server/libs/Controller.js
View file @
0309b92
...
...
@@ -140,14 +140,14 @@ Controller.prototype.client=function(res,views,model,clientmodel){
var
src
=
""
;
if
(
process
.
env
.
NODE_ENV
===
"production"
||
process
.
env
.
NODE_ENV
===
"gray"
){
src
=
"http://cdn.yoho.cn/"
+
config
.
name
+
"/"
+
config
.
version
;
html
=
html
.
replace
(
/
\/
static
\/
index
\.
min
\.
css/g
,
function
(
$1
){
return
src
+
"/index.min.css"
;
})
}
else
{
// if(process.env.NODE_ENV==="production"||process.env.NODE_ENV==="gray"){
// src="http://cdn.yoho.cn/"+config.name+"/"+config.version;
// html=html.replace(/\/static\/index\.min\.css/g,function($1){
// return src+"/index.min.css";
// })
// }else{
src
=
"/static"
;
}
//
}
var
script
=
[
'<script type="text/javascript" src="'
+
src
+
'/'
+
clientmodel
+
'/libs.js"></script>'
,
'<script type="text/javascript" src="'
+
src
+
'/'
+
clientmodel
+
'/'
+
views
+
'.js"></script>'
];
res
.
send
(
html
+
ViewModel
+
script
.
join
(
''
));
...
...
Please
register
or
login
to post a comment