fix(logout): 登出问题修复
This commit is contained in:
parent
3ad71821ba
commit
4c1dadd8ba
|
|
@ -5,37 +5,54 @@
|
||||||
<breadcrumb class="breadcrumb-container" />
|
<breadcrumb class="breadcrumb-container" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<div class="check" v-if="user.userType!=9">
|
<div v-if="user.userType!=9" class="check">
|
||||||
<el-select v-model="languageItem"
|
<el-select
|
||||||
@change="setLanguage"
|
v-model="languageItem"
|
||||||
popper-class="selectCls"
|
popper-class="selectCls"
|
||||||
size="mini">
|
size="mini"
|
||||||
<el-option v-for="item in languageList"
|
@change="setLanguage"
|
||||||
:key="item.value"
|
>
|
||||||
:label="item.label"
|
<el-option
|
||||||
:value="item.value">
|
v-for="item in languageList"
|
||||||
</el-option>
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-dropdown trigger="click"
|
<el-dropdown
|
||||||
placement="bottom-start">
|
trigger="click"
|
||||||
|
placement="bottom-start"
|
||||||
|
>
|
||||||
<div class="kuang">
|
<div class="kuang">
|
||||||
<div class="dropdown_i">
|
<div class="dropdown_i">
|
||||||
<img :src="ruleForm.nationalFlag2"
|
<img
|
||||||
alt="">
|
:src="ruleForm.nationalFlag2"
|
||||||
|
alt=""
|
||||||
|
>
|
||||||
<div>{{ ruleForm.name }}</div>
|
<div>{{ ruleForm.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<i slot="suffix"
|
<i
|
||||||
class="el-icon-arrow-down"></i>
|
slot="suffix"
|
||||||
|
class="el-icon-arrow-down"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown"
|
<el-dropdown-menu
|
||||||
class="dropdown-container">
|
slot="dropdown"
|
||||||
<el-dropdown-item v-for="(item, i) in countryList"
|
class="dropdown-container"
|
||||||
:key="i">
|
>
|
||||||
<div class="dropdown_i"
|
<el-dropdown-item
|
||||||
@click="handleClick(item)">
|
v-for="(item, i) in countryList"
|
||||||
<img :src="item.nationalFlag2"
|
:key="i"
|
||||||
alt="">
|
>
|
||||||
|
<div
|
||||||
|
class="dropdown_i"
|
||||||
|
@click="handleClick(item)"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="item.nationalFlag2"
|
||||||
|
alt=""
|
||||||
|
>
|
||||||
<div>{{ item.name }}</div>
|
<div>{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -43,8 +60,10 @@
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="login"
|
<div
|
||||||
@click="logout">退出登录</div>
|
class="login"
|
||||||
|
@click="logout"
|
||||||
|
>退出登录</div>
|
||||||
<!-- <el-dropdown class="avatar-container" trigger="click">
|
<!-- <el-dropdown class="avatar-container" trigger="click">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
|
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
|
||||||
|
|
@ -74,10 +93,10 @@ import { userCountryList, changeList, languages } from '@/api/user'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
Hamburger,
|
Hamburger
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['sidebar', 'avatar', 'user']),
|
...mapGetters(['sidebar', 'avatar', 'user'])
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -85,14 +104,14 @@ export default {
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
pkCountry: '',
|
pkCountry: '',
|
||||||
nationalFlag2: '',
|
nationalFlag2: '',
|
||||||
name: '',
|
name: ''
|
||||||
},
|
},
|
||||||
languageList: [],
|
languageList: [],
|
||||||
languageItem: 0,
|
languageItem: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this
|
const that = this
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 获取结算国列表
|
// 获取结算国列表
|
||||||
that.getJScountry()
|
that.getJScountry()
|
||||||
|
|
@ -160,16 +179,16 @@ export default {
|
||||||
this.$confirm('确定注销并退出系统吗?', this.$t('w_0034'), {
|
this.$confirm('确定注销并退出系统吗?', this.$t('w_0034'), {
|
||||||
confirmButtonText: this.$t('w_0035'),
|
confirmButtonText: this.$t('w_0035'),
|
||||||
cancelButtonText: this.$t('ENU_P_TYPE0'),
|
cancelButtonText: this.$t('ENU_P_TYPE0'),
|
||||||
type: 'warning',
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$store.dispatch('user/LogOut').then(() => {
|
this.$store.dispatch('user/LogOut').then(() => {
|
||||||
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
|
this.$router.push(`/login?redirect=${encodeURIComponent(this.$route.fullPath)}`)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ export default {
|
||||||
this.$store
|
this.$store
|
||||||
.dispatch('user/login', this.loginForm)
|
.dispatch('user/login', this.loginForm)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$router.push({ path: this.redirect || '/' })
|
this.$router.push({ path: decodeURIComponent(this.redirect) || '/' })
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue