fix: 修复登陆,i18n bug

This commit is contained in:
@changcode
2022-04-14 17:22:48 +08:00
parent 2cc23bf1a9
commit 884c9da2da
5 changed files with 9 additions and 10 deletions

View File

@@ -66,7 +66,7 @@ export default {
return return
} }
this.loading = true this.loading = true
post(api.operationLog, { username: this.username, pin: this.pin }).then( post(api.login, { username: this.username, pin: this.pin }).then(
res => { res => {
if (res.code === 200) { if (res.code === 200) {
if (!this.$_.isEmpty(res.data.lang)) { if (!this.$_.isEmpty(res.data.lang)) {

View File

@@ -65,7 +65,7 @@ export default {
mixins: [rightBoxMixin], mixins: [rightBoxMixin],
data () { data () {
return { return {
url: api.i18nBox, url: api.i18nSys,
loginName: localStorage.getItem(storageKey.username), loginName: localStorage.getItem(storageKey.username),
rules: { // 表单校验规则 rules: { // 表单校验规则
name: [ name: [

View File

@@ -70,7 +70,7 @@ export default {
mixins: [table], mixins: [table],
data () { data () {
return { return {
url: api.i18n, url: api.i18nLang,
tableTitle: [ // 原始table列 tableTitle: [ // 原始table列
{ {
label: 'ID', label: 'ID',

View File

@@ -17,16 +17,16 @@ export const api = {
appearance: '/sys/appearance', appearance: '/sys/appearance',
permissions: '/sys/user/permissions', permissions: '/sys/user/permissions',
operationLog: '/sys/log', operationLog: '/sys/log',
login: '/sys/login',
// user // user
user: '/sys/user', user: '/sys/user',
// role // role
role: '/sys/role', role: '/sys/role',
menu: '/sys/role/menu/', menu: '/sys/role/menu/',
sysMenu: '/sys/menu/', sysMenu: '/sys/menu/',
// i18n // i18n
i18n: '/sys/i18n/lang', i18nLang: '/sys/i18n/lang',
i18nBox: '/sys/i18n', i18nSys: '/sys/i18n',
// chart // chart
chartList: '/visual/chart/list', chartList: '/visual/chart/list',
// galaxyProxy // galaxyProxy
@@ -212,7 +212,7 @@ export async function getI18n () {
const langs = dictData.map(d => d.value).join(',') const langs = dictData.map(d => d.value).join(',')
localStorage.setItem(storageKey.languages, langs) localStorage.setItem(storageKey.languages, langs)
const request = new Promise(resolve => { 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 response.data.cn = response.data.zh
resolve(response.data) resolve(response.data)
}) })

View File

@@ -58,8 +58,7 @@ import cnDataList from '@/components/table/CnDataList'
import dataListMixin from '@/mixins/data-list' import dataListMixin from '@/mixins/data-list'
import i18nTable from '@/components/table/settings/I18nTable' import i18nTable from '@/components/table/settings/I18nTable'
import i18nBox from '@/components/rightBox/settings/I18nBox' import i18nBox from '@/components/rightBox/settings/I18nBox'
import { api } from '@/utils/api' import { api } from '@/utils/api'
import { put } from '@/utils/http'
export default { export default {
name: 'I18n', name: 'I18n',
@@ -71,7 +70,7 @@ export default {
}, },
data () { data () {
return { return {
url: api.i18n, url: api.i18nSys,
blankObject: { // 空白对象 blankObject: { // 空白对象
id: '', id: '',
name: '', name: '',