切换公司2

This commit is contained in:
xielue 2022-12-15 19:15:49 +08:00
parent b89a685ffb
commit 3d95f8635d
1 changed files with 22 additions and 17 deletions

View File

@ -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)
} }
}) })