mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
chore: add i18n support for TabsView.vue; 🌟
This commit is contained in:
parent
3573a51dbd
commit
886a19ddfc
@ -40,16 +40,18 @@ export default {
|
||||
return {
|
||||
pageList: [],
|
||||
activePage: '',
|
||||
menuVisible: false,
|
||||
menuItemList: [
|
||||
{ key: '1', icon: 'arrow-left', text: '关闭左侧' },
|
||||
{ key: '2', icon: 'arrow-right', text: '关闭右侧' },
|
||||
{ key: '3', icon: 'close', text: '关闭其它' }
|
||||
]
|
||||
menuVisible: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState('setting', ['multiPage', 'animate', 'layout', 'dustbins', 'routesI18n'])
|
||||
...mapState('setting', ['multiPage', 'animate', 'layout', 'dustbins', 'routesI18n']),
|
||||
menuItemList() {
|
||||
return [
|
||||
{ key: '1', icon: 'vertical-right', text: this.$t('closeLeft') },
|
||||
{ key: '2', icon: 'vertical-left', text: this.$t('closeRight') },
|
||||
{ key: '3', icon: 'close', text: this.$t('closeOthers') }
|
||||
]
|
||||
}
|
||||
},
|
||||
created () {
|
||||
const route = this.$route
|
||||
|
@ -3,10 +3,10 @@ import Cookie from 'js-cookie'
|
||||
axios.defaults.timeout = 5000
|
||||
axios.defaults.withCredentials= true
|
||||
|
||||
const cookies = Cookie.get()
|
||||
Object.keys(cookies).forEach(key => {
|
||||
axios.defaults.headers.common[key] = cookies[key]
|
||||
})
|
||||
// const cookies = Cookie.get()
|
||||
// Object.keys(cookies).forEach(key => {
|
||||
// axios.defaults.headers.common[key] = cookies[key]
|
||||
// })
|
||||
|
||||
const METHOD = {
|
||||
GET: 'get',
|
||||
@ -21,13 +21,16 @@ const METHOD = {
|
||||
* @returns {Promise<AxiosResponse<T>>}
|
||||
*/
|
||||
async function request(url, method, params) {
|
||||
// header 加入 token
|
||||
const token = Cookie.get('Authorization')
|
||||
const config = token ? {headers: {Authorization: token}} : {}
|
||||
switch (method) {
|
||||
case METHOD.GET:
|
||||
return axios.get(url, {params})
|
||||
return axios.get(url, {params, ...config})
|
||||
case METHOD.POST:
|
||||
return axios.post(url, params)
|
||||
return axios.post(url, params, config)
|
||||
default:
|
||||
return axios.get(url, {params})
|
||||
return axios.get(url, {params, ...config})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user