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