Skip to content

Commit

Permalink
Merge pull request #22 from jvuesource/v2.x
Browse files Browse the repository at this point in the history
SSR render success
  • Loading branch information
terwer authored Feb 28, 2019
2 parents c033fb4 + 2d0a6cd commit 5125835
Show file tree
Hide file tree
Showing 9 changed files with 11,214 additions and 11,326 deletions.
18 changes: 9 additions & 9 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
application.title=JVue Framework
application.formatted-version=v2.0.0

# 解决Spring Boot部署到Tomcat中文乱码
spring.http.encoding.charset=UTF-8
spring.http.encoding.force=true
spring.http.encoding.enabled=true

spring.profiles.active=prod
application.title=JVue Framework
application.formatted-version=v2.0.0

# 解决Spring Boot部署到Tomcat中文乱码
spring.http.encoding.charset=UTF-8
spring.http.encoding.force=true
spring.http.encoding.enabled=true

spring.profiles.active=dev
80 changes: 41 additions & 39 deletions src/main/vue/build/cpm.cmd
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
REM ./build/cpm.cmd
REM ncp [source] [dest] [--limit=concurrency limit] [--filter=filter] --stopOnErr

REM clean && mkdir
del "dist/node_modules" /q
mkdir "dist/node_modules"

REM core-js
yarn ncp node_modules/core-js dist/node_modules/core-js
del -rf dist/node_modules/core-js/modules /q

REM vue-server-renderer
yarn ncp node_modules/he dist/node_modules/he
yarn ncp node_modules/lodash._reinterpolate dist/node_modules/lodash._reinterpolate
yarn ncp node_modules/lodash.template dist/node_modules/lodash.template
yarn ncp node_modules/lodash.templatesettings dist/node_modules/lodash.templatesettings
yarn ncp node_modules/resolve dist/node_modules/resolve
yarn ncp node_modules/serialize-javascript dist/node_modules/serialize-javascript
yarn ncp node_modules/vue-server-renderer dist/node_modules/vue-server-renderer
del dist/node_modules/vue-server-renderer/node_modules /q

REM vue
yarn ncp node_modules/vue dist/node_modules/vue

REM vue-router
yarn ncp node_modules/vue-router dist/node_modules/vue-router

REM axios
yarn ncp node_modules/axios dist/node_modules/axios
yarn ncp node_modules/is-buffer dist/node_modules/is-buffer
yarn ncp node_modules/follow-redirects dist/node_modules/follow-redirects

REM bootstrap-vue
yarn ncp node_modules/bootstrap-vue dist/node_modules/bootstrap-vue
del "dist/node_modules/bootstrap-vue/node_modules" /q
del "dist/node_modules/bootstrap-vue/src" /q

REM circular-json
yarn ncp node_modules/circular-json dist/node_modules/circular-json
REM ./build/cpm.cmd
REM ncp [source] [dest] [--limit=concurrency limit] [--filter=filter] --stopOnErr

REM clean && mkdir
del "dist/node_modules" /q
mkdir "dist/node_modules"

REM core-js
yarn ncp node_modules/core-js dist/node_modules/core-js

REM vue-server-renderer
yarn ncp node_modules/he dist/node_modules/he
yarn ncp node_modules/lodash._reinterpolate dist/node_modules/lodash._reinterpolate
yarn ncp node_modules/lodash.template dist/node_modules/lodash.template
yarn ncp node_modules/lodash.templatesettings dist/node_modules/lodash.templatesettings
yarn ncp node_modules/resolve dist/node_modules/resolve
yarn ncp node_modules/serialize-javascript dist/node_modules/serialize-javascript
yarn ncp node_modules/vue-server-renderer dist/node_modules/vue-server-renderer
del dist/node_modules/vue-server-renderer/node_modules /q

REM vue
yarn ncp node_modules/vue dist/node_modules/vue

REM vue-router
yarn ncp node_modules/vue-router dist/node_modules/vue-router

REM axios
yarn ncp node_modules/axios dist/node_modules/axios
yarn ncp node_modules/is-buffer dist/node_modules/is-buffer
yarn ncp node_modules/follow-redirects dist/node_modules/follow-redirects

REM bootstrap-vue
yarn ncp node_modules/bootstrap-vue dist/node_modules/bootstrap-vue
del "dist/node_modules/bootstrap-vue/node_modules" /q
del "dist/node_modules/bootstrap-vue/src" /q

REM circular-json
yarn ncp node_modules/circular-json dist/node_modules/circular-json

REM source-map
yarn ncp node_modules/source-map dist/node_modules/source-map
6 changes: 4 additions & 2 deletions src/main/vue/build/cpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ mkdir -p dist/node_modules

# core-js
yarn ncp node_modules/core-js dist/node_modules/core-js
rm -rf dist/node_modules/core-js/modules

# vue-server-renderer
yarn ncp node_modules/he dist/node_modules/he
Expand Down Expand Up @@ -37,4 +36,7 @@ rm -rf dist/node_modules/bootstrap-vue/node_modules
rm -rf dist/node_modules/bootstrap-vue/src

# circular-json
yarn ncp node_modules/circular-json dist/node_modules/circular-json
yarn ncp node_modules/circular-json dist/node_modules/circular-json

# source-map
yarn ncp node_modules/source-map dist/node_modules/source-map
122 changes: 0 additions & 122 deletions src/main/vue/src/components/HelloWorld.vue

This file was deleted.

91 changes: 44 additions & 47 deletions src/main/vue/src/util/logger.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
/**
* logger
*
* @author Terwer
* @version 1.0
* 19-2-27 下午11:22
**/
global.loggerName = "default";
const isDebugEnabled =
process.env.NODE_ENV === "development" &&
process.env.VUE_APP_DEBUG === "true";
const isInfoEnabled =
process.env.NODE_ENV === "development" && process.env.VUE_APP_INFO === "true";
const isErrorEnabled = process.env.VUE_APP_ERROR === "true";
console.log(
"isDebugEnabled,isInfoEnabled,isErrorEnabled=>",
`${isDebugEnabled},${isInfoEnabled},${isErrorEnabled}`
);

const debug = log => {
if (isDebugEnabled) {
console.warn("[", global.loggerName, "]", log);
}
};

const info = log => {
if (isInfoEnabled) {
console.log("[", global.loggerName, "]", log);
}
};

const error = log => {
if (isErrorEnabled) {
console.error("[", global.loggerName, "]", log);
}
};

let logger = {
debug,
info,
error
};

export const getLogger = name => {
global.loggerName = name;
return logger;
};
/**
* logger
*
* @author Terwer
* @version 1.0
* 19-2-27 下午11:22
**/
global.loggerName = "default";
const isDebugEnabled = process.env.VUE_APP_DEBUG === "true";
const isInfoEnabled = process.env.VUE_APP_INFO === "true";
const isErrorEnabled = process.env.VUE_APP_ERROR === "true";
console.log(
"isDebugEnabled,isInfoEnabled,isErrorEnabled=>",
`${isDebugEnabled},${isInfoEnabled},${isErrorEnabled}`
);

const debug = log => {
if (isDebugEnabled) {
console.warn("[", global.loggerName, "]", log);
}
};

const info = log => {
if (isInfoEnabled) {
console.log("[", global.loggerName, "]", log);
}
};

const error = log => {
if (isErrorEnabled) {
console.error("[", global.loggerName, "]", log);
}
};

let logger = {
debug,
info,
error
};

export const getLogger = name => {
global.loggerName = name;
return logger;
};
Loading

0 comments on commit 5125835

Please sign in to comment.