|
|
@@ -94,6 +94,7 @@
|
|
|
import DorpdownSelect from "@/components/module/dorpdownSelect";
|
|
|
import { selectShop } from '@/mixins'
|
|
|
import { getUser } from '@/utils/auth'
|
|
|
+ import { mapGetters } from 'vuex'
|
|
|
export default { // 我的
|
|
|
name:"Me",
|
|
|
components:{
|
|
|
@@ -102,6 +103,9 @@
|
|
|
DorpdownSelect
|
|
|
},
|
|
|
mixins:[selectShop],
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getLoginInfo"])
|
|
|
+ },
|
|
|
data(){
|
|
|
return {
|
|
|
constant: this.$constant,
|
|
|
@@ -122,7 +126,12 @@
|
|
|
title: '加载中'
|
|
|
});
|
|
|
try {
|
|
|
- let res = await toggleShop({ shopId});
|
|
|
+ let {data} = await toggleShop({ shopId});
|
|
|
+ this.$store.commit('setLoginInfo', {
|
|
|
+ ...this.getLoginInfo,
|
|
|
+ shopId: data.shopId, // 门店id
|
|
|
+ shopAdminId: data.id //员工id
|
|
|
+ })
|
|
|
getUser(true)
|
|
|
this.init()
|
|
|
} finally {
|
|
|
@@ -131,8 +140,7 @@
|
|
|
|
|
|
},
|
|
|
changeShop(){
|
|
|
- console.log(this.userShopAll)
|
|
|
- let idx = this.userShopAll.findIndex(i=>i.shopId === '2')
|
|
|
+ let idx = this.userShopAll.findIndex(i=>i.id == this.getLoginInfo.shopId)
|
|
|
let shopId = null
|
|
|
if(idx === this.userShopAll.length - 1) {
|
|
|
shopId = this.userShopAll[0].id
|