首页 > 解决方案 > 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,例如

是错误还是我们在哪里配置语言服务路径。

标签: jhipsterng2-translate

解决方案


推荐阅读