shish il y a 4 ans
Parent
commit
926e8eca9f

+ 7 - 5
ghsApp/src/admin/home/workbench.vue

@@ -98,9 +98,7 @@ import productMins from "@/mixins/product";
 import { allProduct } from '@/api/product'
 export default {
 	name: "admin-workbench",
-	components: {
-		NotLogin
-	},
+	components: { NotLogin },
 	mixins: [productMins],
 	data() {
 		return {
@@ -134,7 +132,8 @@ export default {
 			pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`,
 			skSrc3: `${this.$constant.imgUrl}/ghs/home/sk3.jpg`,
 			pfSrc3: `${this.$constant.imgUrl}/ghs/home/pf3.jpg`,
-			isScanEnv:false
+			isScanEnv:false,
+			isMini:0
 		};
 	},
 	onShareAppMessage(res) {
@@ -222,7 +221,10 @@ export default {
 			this.setIndex()
 		},
 		setIndex(){
-			consoleIndex().then(res => {
+			// #ifdef MP-WEIXIN
+			this.isMini = 1
+			// #endif
+			consoleIndex({isMini:this.isMini}).then(res => {
 				this.data = res.data;
 				const { asset,menu } = res.data;
 				this.tabsData = menu

+ 12 - 3
ghsApp/src/components/not-login.vue

@@ -2,7 +2,7 @@
   <view class="model" v-if="showModel" @click="pageTo({url:'/admin/home/login'})"></view>
 </template>
 <script>
-import { mapGetters,mapActions } from "vuex";
+import { mapGetters} from "vuex";
 export default {
 	name: "not-login",
 	components: {},
@@ -13,10 +13,19 @@ export default {
     }
   },
 	computed: {
-		...mapGetters({ loginInfo: "getLoginInfo" })
+		...mapGetters(["getLoginInfo"])
+	},
+	watch: {
+		getLoginInfo: {
+			handler(newValue) {
+        if(this.$util.isEmpty(newValue.admin) == false && newValue.admin.currentShopId > 0){
+          this.showModel = false
+        }				
+			}
+		}
 	},
 	mounted() {
-    if(this.$util.isEmpty(this.loginInfo.admin) || this.loginInfo.admin.currentShopId == 0){
+    if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
       this.showModel = true
     }
 	},

+ 12 - 3
hdApp/src/components/not-login.vue

@@ -2,7 +2,7 @@
   <view class="model" v-if="showModel" @click="pageTo({url:'/admin/home/login'})"></view>
 </template>
 <script>
-import { mapGetters,mapActions } from "vuex";
+import { mapGetters } from "vuex";
 export default {
 	name: "not-login",
 	components: {},
@@ -13,10 +13,19 @@ export default {
     }
   },
 	computed: {
-		...mapGetters({ loginInfo: "getLoginInfo" })
+		...mapGetters(["getLoginInfo"])
+	},
+	watch: {
+		getLoginInfo: {
+			handler(newValue) {
+        if(this.$util.isEmpty(newValue.admin) == false && newValue.admin.currentShopId > 0){
+          this.showModel = false
+        }				
+			}
+		}
 	},
 	mounted() {
-    if(this.$util.isEmpty(this.loginInfo.admin) || this.loginInfo.admin.currentShopId == 0){
+    if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
       this.showModel = true
     }
 	},