jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/node_modules/antd-mini/es/app.js

21 lines
852 B
JavaScript
Raw Normal View History

2024-11-10 07:01:22 +00:00
"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*/];
});
});
}
};