diff --git a/cmdb-ui/public/index.html b/cmdb-ui/public/index.html
index a07dfe4..be372b6 100644
--- a/cmdb-ui/public/index.html
+++ b/cmdb-ui/public/index.html
@@ -1,7 +1,6 @@
-
@@ -12,17 +11,19 @@
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<% } %>
-
-
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
diff --git a/cmdb-ui/src/modules/acl/views/resource_types.vue b/cmdb-ui/src/modules/acl/views/resource_types.vue
index cb59e34..214d01a 100644
--- a/cmdb-ui/src/modules/acl/views/resource_types.vue
+++ b/cmdb-ui/src/modules/acl/views/resource_types.vue
@@ -63,7 +63,14 @@
show-quick-jumper
:current="tablePage.currentPage"
:total="tablePage.total"
- :show-total="(total, range) => `当前展示 ${range[0]}-${range[1]} 条数据, 共 ${total} 条`"
+ :show-total="
+ (total, range) =>
+ $t('pagination.total', {
+ range0: range[0],
+ range1: range[1],
+ total,
+ })
+ "
:page-size="tablePage.pageSize"
:default-current="1"
:page-size-options="pageSizeOptions"
diff --git a/cmdb-ui/src/modules/acl/views/resources.vue b/cmdb-ui/src/modules/acl/views/resources.vue
index 5f6ea13..6dccddf 100644
--- a/cmdb-ui/src/modules/acl/views/resources.vue
+++ b/cmdb-ui/src/modules/acl/views/resources.vue
@@ -138,7 +138,14 @@
show-quick-jumper
:current="tablePage.currentPage"
:total="tablePage.total"
- :show-total="(total, range) => `当前展示 ${range[0]}-${range[1]} 条数据, 共 ${total} 条`"
+ :show-total="
+ (total, range) =>
+ $t('pagination.total', {
+ range0: range[0],
+ range1: range[1],
+ total,
+ })
+ "
:page-size="tablePage.pageSize"
:default-current="1"
:page-size-options="pageSizeOptions"
diff --git a/cmdb-ui/src/modules/acl/views/roles.vue b/cmdb-ui/src/modules/acl/views/roles.vue
index 6332251..b150eab 100644
--- a/cmdb-ui/src/modules/acl/views/roles.vue
+++ b/cmdb-ui/src/modules/acl/views/roles.vue
@@ -107,7 +107,14 @@
show-quick-jumper
:current="tablePage.currentPage"
:total="tablePage.total"
- :show-total="(total, range) => `当前展示 ${range[0]}-${range[1]} 条数据, 共 ${total} 条`"
+ :show-total="
+ (total, range) =>
+ $t('pagination.total', {
+ range0: range[0],
+ range1: range[1],
+ total,
+ })
+ "
:page-size="tablePage.pageSize"
:default-current="1"
:page-size-options="pageSizeOptions"
diff --git a/cmdb-ui/src/utils/request.js b/cmdb-ui/src/utils/request.js
index ba09e46..f453359 100644
--- a/cmdb-ui/src/utils/request.js
+++ b/cmdb-ui/src/utils/request.js
@@ -7,6 +7,7 @@ import notification from 'ant-design-vue/es/notification'
import { ACCESS_TOKEN } from '@/store/global/mutation-types'
import router from '@/router'
import store from '@/store'
+import i18n from '@/lang'
// 创建 axios 实例
const service = axios.create({
@@ -20,15 +21,16 @@ const err = (error) => {
console.log(error)
const reg = /5\d{2}/g
if (error.response && reg.test(error.response.status)) {
- const errorMsg = ((error.response || {}).data || {}).message || '服务端未知错误, 请联系管理员!'
+ const errorMsg = ((error.response || {}).data || {}).message || i18n.t('requestServiceError')
message.error(errorMsg)
} else if (error.response.status === 412) {
let seconds = 5
notification.warning({
key: 'notification',
message: 'WARNING',
- description:
- '修改已提交,请等待审核(5s)',
+ description: i18n.t('requestWait', {
+ time: 5,
+ }),
duration: 5,
})
let interval = setInterval(() => {
@@ -41,14 +43,15 @@ const err = (error) => {
notification.warning({
key: 'notification',
message: 'WARNING',
- description:
- `修改已提交,请等待审核(${seconds}s)`,
+ description: i18n.t('requestWait', {
+ time: seconds,
+ }),
duration: seconds
})
}, 1000)
} else if (error.config.url === '/api/v0.1/ci_types/can_define_computed' || error.config.isShowMessage === false) {
} else {
- const errorMsg = ((error.response || {}).data || {}).message || '出现错误,请稍后再试'
+ const errorMsg = ((error.response || {}).data || {}).message || i18n.t('requestError')
message.error(`${errorMsg}`)
}
if (error.response) {