切换公司2
This commit is contained in:
parent
b89a685ffb
commit
3d95f8635d
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -16,7 +16,7 @@ import { USER_MODEL } from '@/services/base/api.js';
|
||||||
//封装 登录的相关操作
|
//封装 登录的相关操作
|
||||||
export default {
|
export default {
|
||||||
name: 'loginActions',
|
name: 'loginActions',
|
||||||
components: { },
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
logging: false,
|
logging: false,
|
||||||
|
|
@ -48,7 +48,7 @@ export default {
|
||||||
return USER_MODEL == "AdminUser";
|
return USER_MODEL == "AdminUser";
|
||||||
},
|
},
|
||||||
|
|
||||||
afterLoginSuccess({ token, access_expire, uid, msg = '登录成功',pushTo = '/dashboard/workplace' }) {
|
afterLoginSuccess({ closeOthers, token, access_expire, uid, msg = '登录成功', pushTo = '/dashboard/workplace' }) {
|
||||||
|
|
||||||
setAuthorization({ token: token, expireAt: new Date(access_expire * 1000) }) // 设置token
|
setAuthorization({ token: token, expireAt: new Date(access_expire * 1000) }) // 设置token
|
||||||
|
|
||||||
|
|
@ -74,8 +74,13 @@ export default {
|
||||||
const routesConfig = result.data.data
|
const routesConfig = result.data.data
|
||||||
this.setRoutesConfig(routesConfig)
|
this.setRoutesConfig(routesConfig)
|
||||||
loadRoutes([routesConfig])
|
loadRoutes([routesConfig])
|
||||||
//this.$router.push(pushTo)
|
|
||||||
this.$closeOthers(pushTo)
|
if (closeOthers) {
|
||||||
|
this.$closeOthers(pushTo)
|
||||||
|
} else {
|
||||||
|
this.$router.push(pushTo)
|
||||||
|
}
|
||||||
|
|
||||||
this.$message.success(msg, 3)
|
this.$message.success(msg, 3)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue