mirror of
https://github.com/iczer/vue-antd-admin.git
synced 2025-04-06 03:57:44 +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 {
|
return {
|
||||||
pageList: [],
|
pageList: [],
|
||||||
activePage: '',
|
activePage: '',
|
||||||
menuVisible: false,
|
menuVisible: false
|
||||||
menuItemList: [
|
|
||||||
{ key: '1', icon: 'arrow-left', text: '关闭左侧' },
|
|
||||||
{ key: '2', icon: 'arrow-right', text: '关闭右侧' },
|
|
||||||
{ key: '3', icon: 'close', text: '关闭其它' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
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 () {
|
created () {
|
||||||
const route = this.$route
|
const route = this.$route
|
||||||
|
@ -3,10 +3,10 @@ import Cookie from 'js-cookie'
|
|||||||
axios.defaults.timeout = 5000
|
axios.defaults.timeout = 5000
|
||||||
axios.defaults.withCredentials= true
|
axios.defaults.withCredentials= true
|
||||||
|
|
||||||
const cookies = Cookie.get()
|
// const cookies = Cookie.get()
|
||||||
Object.keys(cookies).forEach(key => {
|
// Object.keys(cookies).forEach(key => {
|
||||||
axios.defaults.headers.common[key] = cookies[key]
|
// axios.defaults.headers.common[key] = cookies[key]
|
||||||
})
|
// })
|
||||||
|
|
||||||
const METHOD = {
|
const METHOD = {
|
||||||
GET: 'get',
|
GET: 'get',
|
||||||
@ -21,13 +21,16 @@ const METHOD = {
|
|||||||
* @returns {Promise<AxiosResponse<T>>}
|
* @returns {Promise<AxiosResponse<T>>}
|
||||||
*/
|
*/
|
||||||
async function request(url, method, params) {
|
async function request(url, method, params) {
|
||||||
|
// header 加入 token
|
||||||
|
const token = Cookie.get('Authorization')
|
||||||
|
const config = token ? {headers: {Authorization: token}} : {}
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case METHOD.GET:
|
case METHOD.GET:
|
||||||
return axios.get(url, {params})
|
return axios.get(url, {params, ...config})
|
||||||
case METHOD.POST:
|
case METHOD.POST:
|
||||||
return axios.post(url, params)
|
return axios.post(url, params, config)
|
||||||
default:
|
default:
|
||||||
return axios.get(url, {params})
|
return axios.get(url, {params, ...config})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user