Browse Source

mixins store

shish 6 years ago
parent
commit
0c32a32bd5
1 changed files with 6 additions and 6 deletions
  1. 6 6
      store/src/mixins/globalMixins.js

+ 6 - 6
store/src/mixins/globalMixins.js

@@ -19,7 +19,7 @@ export default {
 	// 	...mapGetters({ userInfo: 'getUser' })
 	// },
 	// 页面生命周期才触发
-	onLoad: function(option) {
+	onLoad: function (option) {
 		this.option = option || null
 		if (option.token) {
 			uni.setStorageSync('token', option.token)
@@ -34,11 +34,11 @@ export default {
 		}
 		uni.setStorageSync('currentQuery', JSON.stringify(option))
 		// 登录
-		if (constant.source == 'business' || constant.source == 'mobile') {
+		if (constant.source == 'store' || constant.source == 'mobile') {
 			if (isLogin()) {
 				// #ifdef H5
 				if (this.init) {
-					if (constant.source == 'business') {
+					if (constant.source == 'store') {
 						getUser()
 					}
 					this.init()
@@ -48,7 +48,7 @@ export default {
 				// #ifdef MP-WEIXIN
 				wxLoginFn().then(res => {
 					if (this.init) {
-						if (constant.source == 'business') {
+						if (constant.source == 'store') {
 							getUser()
 						}
 						this.init()
@@ -58,7 +58,7 @@ export default {
 			} else {
 				// #ifdef H5
 				getCheckLogin().then(res => {
-					if (constant.source == 'business') {
+					if (constant.source == 'store') {
 						if (res) {
 							getUser()
 						}
@@ -68,7 +68,7 @@ export default {
 				// #ifdef MP-WEIXIN
 				wxLoginFn().then(res => {
 					if (this.init) {
-						if (constant.source == 'business') {
+						if (constant.source == 'store') {
 							getUser()
 						}
 						this.init()