Authored by 陈峰

commit

... ... @@ -12,6 +12,7 @@ import 'statics/font/iconfont.css';
import 'statics/font/ufofont.css';
const {app, router, store} = createApp(window.__INITIAL_STATE__ && window.__INITIAL_STATE__.yoho.context);
const isDegrade = Boolean(!window.__INITIAL_STATE__);
if (window.__INITIAL_STATE__) {
store.replaceState(window.__INITIAL_STATE__);
... ... @@ -76,7 +77,7 @@ router.onReady(() => {
return next();
}
});
app.$mount('#app');
app.$mount(isDegrade ? '#degrade-app' : '#app');
});
router.onError(e => {
... ...
... ... @@ -16,6 +16,8 @@
</head>
<body>
<!--vue-ssr-outlet-->
<div id="degrade-app"></div>
div
<div id="main-wrap">
<div id="no-download"></div>
</div>
... ...
... ... @@ -113,7 +113,7 @@ const webpackConfig = merge(baseConfig, {
'process.env.VUE_ENV': '"client"'
}),
new HtmlWebpackPlugin({
filename: '../../degrade.html',
filename: isProd ? '../../degrade.html' : 'degrade.html',
template: 'apps/index.html',
inject: true
})
... ...
... ... @@ -9,6 +9,7 @@ const routes = require('../../config/ssr-routes');
const redis = require('../../utils/redis');
const routeEncode = require('../../utils/route-encode');
const {createBundleRenderer} = require('vue-server-renderer');
const rp = require('request-promise');
const logger = global.yoho.logger;
const config = global.yoho.config;
... ...