jhipster - Jhipster JhiLanguageService 总是指向相对路径
问题描述
我正在使用 jhipster 应用程序
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.labkit.sci.mycloud",
"nativeLanguage": "en"
},
"jhipsterVersion": "5.5.0",
"applicationType": "monolith",
"baseName": "mycloudApp",
"packageName": "com.labkit.sci.mycloud",
"packageFolder": "com/labkit/sci/mycloud",
"serverPort": "8383",
"authenticationType": "oauth2",
"cacheProvider": "no",
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "gradle",
"enableSwaggerCodegen": false,
"clientFramework": "angularX",
"useSass": true,
"clientPackageManager": "npm",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"de"
]
}
}
我已将 webpack.common.js 中的 SERVER_API_URL 配置为
SERVER_API_URL:
'http://localhost:9000/'
但是 JhiLanguageService 总是指向相对路径
我还在 mycloud-app\src\main\webapp\app\app.constants.ts 中进行了配置
export const SERVER_API_URL = 'http://localhost:9000/';
仍然是指向相对路径的 url http://localhost:9000/site/product/i18n/en.json?buildTimestamp=1540574017051
但是其余的 api 调用使用的是 SERVER_API_URL,例如
是错误还是我们在哪里配置语言服务路径。
解决方案
推荐阅读
- java - 在 ArrayList 中使用 indexOf() 时出现 ConcurrentModificationException
- python-3.x - 如何提示用户使用 python3 打开文件?(游戏)
- mysql - 将 FOREIGN_KEY_CHECKS 重置为 1 是否检查一致性
- flutter - 我的快照没有 futurebuilder 中的数据
- javascript - 在 AngularJS 或 html 或 Javascript 中,需要根据下拉选择将单元格添加到表格中
- matlab - 如何从 Matlab 环境执行 OpenSMILE 工具包?
- c# - UWP:设置按钮 IsEnabled = false 会触发 NavigationView 中的选项卡更改
- node.js - 使用 formdata-node 默认导入时,如何解决“错误:'default' 不是由...导出的”?
- html - 浮动汉堡菜单 css
- azure-devops - 使用 AzureCLI 任务的 Azure 管道错误:段数错误