jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/node_modules/antd-mini/es/app.js
2024-11-10 15:01:22 +08:00

21 lines
852 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"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*/];
});
});
}
};