21 lines
852 B
JavaScript
21 lines
852 B
JavaScript
"use strict";
|
||
Object.defineProperty(exports, "__esModule", { value: true });
|
||
exports.ssr = void 0;
|
||
var tslib_1 = require("tslib");
|
||
exports.ssr = {
|
||
beforeRenderServer: function (_a) {
|
||
var env = _a.env, location = _a.location, history = _a.history, mode = _a.mode, context = _a.context;
|
||
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
||
return tslib_1.__generator(this, function (_b) {
|
||
// global 为 Node.js 下的全局变量
|
||
// 避免直接 mock location,这样会造成一些环境判断失效
|
||
global.mockLocation = location;
|
||
// 国际化
|
||
if (location.pathname.indexOf('zh-CN') > -1) {
|
||
global.locale = 'zh-CN';
|
||
}
|
||
return [2 /*return*/];
|
||
});
|
||
});
|
||
}
|
||
}; |