|
@@ -49,7 +49,7 @@ import { mapGetters } from 'vuex'
|
|
|
import Breadcrumb from '@/components/Breadcrumb'
|
|
|
import Hamburger from '@/components/Hamburger'
|
|
|
import modPassword from '@/components/_dialog/modPassword'
|
|
|
-import { getBarId, getBarName } from '@/utils/auth'
|
|
|
+import { getBarId, getBarName, setBarId, setBarName } from '@/utils/auth'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -94,7 +94,6 @@ export default {
|
|
|
await this.$store.dispatch('user/logout')
|
|
|
this.$router.push(`/login`)
|
|
|
},
|
|
|
- // TODO 切换门店接口
|
|
|
handleSelectOutlet (item) {
|
|
|
if (item.id.toString() === this.barId) {
|
|
|
return
|
|
@@ -106,8 +105,12 @@ export default {
|
|
|
}).then(async () => {
|
|
|
const data = await this.$fetch('/v1/user/member/changeBar', { id: item.id })
|
|
|
if (data.code === 200) {
|
|
|
- this.$message.success('切换成功成功,请重新登录')
|
|
|
- this.logout()
|
|
|
+ this.$message.success('切换成功成功')
|
|
|
+ setBarId(item.id)
|
|
|
+ setBarName(item.bar_name)
|
|
|
+ setTimeout(() => {
|
|
|
+ location.reload()
|
|
|
+ }, 2000)
|
|
|
}
|
|
|
}).catch(() => {})
|
|
|
}
|