From 884c9da2da39f39f6f3bfeb8abffdb74a3e45ea1 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 14 Apr 2022 17:22:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E9=99=86?= =?UTF-8?q?=EF=BC=8Ci18n=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Login.vue | 2 +- src/components/rightBox/settings/I18nBox.vue | 2 +- src/components/table/settings/I18nTable.vue | 2 +- src/utils/api.js | 8 ++++---- src/views/settings/I18n.vue | 5 ++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Login.vue b/src/Login.vue index 12e81a57..9caabefe 100644 --- a/src/Login.vue +++ b/src/Login.vue @@ -66,7 +66,7 @@ export default { return } this.loading = true - post(api.operationLog, { username: this.username, pin: this.pin }).then( + post(api.login, { username: this.username, pin: this.pin }).then( res => { if (res.code === 200) { if (!this.$_.isEmpty(res.data.lang)) { diff --git a/src/components/rightBox/settings/I18nBox.vue b/src/components/rightBox/settings/I18nBox.vue index 7272179d..a4a4ab7e 100644 --- a/src/components/rightBox/settings/I18nBox.vue +++ b/src/components/rightBox/settings/I18nBox.vue @@ -65,7 +65,7 @@ export default { mixins: [rightBoxMixin], data () { return { - url: api.i18nBox, + url: api.i18nSys, loginName: localStorage.getItem(storageKey.username), rules: { // 表单校验规则 name: [ diff --git a/src/components/table/settings/I18nTable.vue b/src/components/table/settings/I18nTable.vue index a90c1e52..a4d6377b 100644 --- a/src/components/table/settings/I18nTable.vue +++ b/src/components/table/settings/I18nTable.vue @@ -70,7 +70,7 @@ export default { mixins: [table], data () { return { - url: api.i18n, + url: api.i18nLang, tableTitle: [ // 原始table列 { label: 'ID', diff --git a/src/utils/api.js b/src/utils/api.js index ded5a12e..94ac7e90 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -17,16 +17,16 @@ export const api = { appearance: '/sys/appearance', permissions: '/sys/user/permissions', operationLog: '/sys/log', + login: '/sys/login', // user user: '/sys/user', // role role: '/sys/role', menu: '/sys/role/menu/', sysMenu: '/sys/menu/', - // i18n - i18n: '/sys/i18n/lang', - i18nBox: '/sys/i18n', + i18nLang: '/sys/i18n/lang', + i18nSys: '/sys/i18n', // chart chartList: '/visual/chart/list', // galaxyProxy @@ -212,7 +212,7 @@ export async function getI18n () { const langs = dictData.map(d => d.value).join(',') localStorage.setItem(storageKey.languages, langs) const request = new Promise(resolve => { - get(api.i18n, { l: langs }).then(response => { + get(api.i18nLang, { l: langs }).then(response => { response.data.cn = response.data.zh resolve(response.data) }) diff --git a/src/views/settings/I18n.vue b/src/views/settings/I18n.vue index fb03631f..a940bf6c 100644 --- a/src/views/settings/I18n.vue +++ b/src/views/settings/I18n.vue @@ -58,8 +58,7 @@ import cnDataList from '@/components/table/CnDataList' import dataListMixin from '@/mixins/data-list' import i18nTable from '@/components/table/settings/I18nTable' import i18nBox from '@/components/rightBox/settings/I18nBox' -import { api } from '@/utils/api' -import { put } from '@/utils/http' +import { api } from '@/utils/api' export default { name: 'I18n', @@ -71,7 +70,7 @@ export default { }, data () { return { - url: api.i18n, + url: api.i18nSys, blankObject: { // 空白对象 id: '', name: '',