ソースを参照

调整单点登录逻辑

howard 1 年間 前
コミット
f2efecfe26
共有8 個のファイルを変更した256 個の追加13491 個の削除を含む
  1. 4 0
      main.js
  2. 7 1
      openmerchant/amountopening/index.vue
  3. 194 13483
      package-lock.json
  4. 2 1
      package.json
  5. 1 1
      pages/cashier/index.vue
  6. 1 1
      pages/my/index.vue
  7. 2 2
      uni_modules/ws-wx-privacy/components/ws-wx-privacy/ws-wx-privacy.vue
  8. 45 2
      utils/readAppInfo.js

+ 4 - 0
main.js

@@ -6,6 +6,10 @@ import time from '@/commit/item.js';
6
 import store from '@/store/index.js'
6
 import store from '@/store/index.js'
7
 import uView from '@/uni_modules/uview-ui';
7
 import uView from '@/uni_modules/uview-ui';
8
 
8
 
9
+// import VConsole from 'vconsole'
10
+// const vConsole = new VConsole();
11
+// console.log('vConsole is running!');
12
+
9
 Vue.config.productionTip = false
13
 Vue.config.productionTip = false
10
 Vue.prototype.$time = time 
14
 Vue.prototype.$time = time 
11
 Vue.prototype.$store = store 
15
 Vue.prototype.$store = store 

+ 7 - 1
openmerchant/amountopening/index.vue

@@ -64,7 +64,7 @@
64
 					兑换激活码
64
 					兑换激活码
65
 				</view>
65
 				</view>
66
 				<view class="cv">
66
 				<view class="cv">
67
-					<view class="cv-title">输入激活码,兑换储蓄保一壶茶商户</view>
67
+					<view class="cv-title">输入激活码,兑换幸福保商户</view>
68
 					<input class="cv-input" type="text" placeholder="输入激活码" v-model="useCode">
68
 					<input class="cv-input" type="text" placeholder="输入激活码" v-model="useCode">
69
 				</view>
69
 				</view>
70
 				<view class="ft" @click="immediateUse">
70
 				<view class="ft" @click="immediateUse">
@@ -201,6 +201,12 @@
201
 			},
201
 			},
202
 			
202
 			
203
 			pushToUserApplet() {
203
 			pushToUserApplet() {
204
+				
205
+				uni.showToast({
206
+					title: '功能开发中,请使用激活码开通',
207
+					icon: "none"
208
+				})
209
+					
204
 				uni.navigateToMiniProgram({
210
 				uni.navigateToMiniProgram({
205
 					// appid  写你要跳转的小程序的 appid
211
 					// appid  写你要跳转的小程序的 appid
206
 					appId:'wx9082e5ac2fdb513f',
212
 					appId:'wx9082e5ac2fdb513f',

File diff suppressed because it is too large
+ 194 - 13483
package-lock.json


+ 2 - 1
package.json

@@ -4,6 +4,7 @@
4
     "crypto-js": "^4.1.1",
4
     "crypto-js": "^4.1.1",
5
     "easemob-websdk": "^4.6.0",
5
     "easemob-websdk": "^4.6.0",
6
     "html2canvas": "^1.4.1",
6
     "html2canvas": "^1.4.1",
7
-    "pinia": "^2.1.0"
7
+    "pinia": "^2.1.0",
8
+    "vconsole": "^3.15.1"
8
   }
9
   }
9
 }
10
 }

+ 1 - 1
pages/cashier/index.vue

@@ -190,7 +190,7 @@
190
 			this.mer_id = selectmerchant.merId
190
 			this.mer_id = selectmerchant.merId
191
 			let jurisdiction = uni.getStorageSync('jurisdiction')
191
 			let jurisdiction = uni.getStorageSync('jurisdiction')
192
 			
192
 			
193
-			if(jurisdiction!=null){
193
+			if(jurisdiction){
194
 			jurisdiction.forEach((res,index)=>{
194
 			jurisdiction.forEach((res,index)=>{
195
 				if(res==7){
195
 				if(res==7){
196
 					this.zhuangi = res
196
 					this.zhuangi = res

+ 1 - 1
pages/my/index.vue

@@ -66,7 +66,7 @@
66
 			let jurisdiction = uni.getStorageSync('jurisdiction')
66
 			let jurisdiction = uni.getStorageSync('jurisdiction')
67
 			console.log('jurisdiction', jurisdiction)
67
 			console.log('jurisdiction', jurisdiction)
68
 			let mnuList = this.mnu
68
 			let mnuList = this.mnu
69
-			if (jurisdiction!=null) {
69
+			if (jurisdiction) {
70
 				jurisdiction.forEach((res, index) => {
70
 				jurisdiction.forEach((res, index) => {
71
 					mnuList.forEach((result, i) => {
71
 					mnuList.forEach((result, i) => {
72
 						if (res == result.id) {
72
 						if (res == result.id) {

+ 2 - 2
uni_modules/ws-wx-privacy/components/ws-wx-privacy/ws-wx-privacy.vue

@@ -57,12 +57,12 @@
57
 			// 隐私保护指引名称
57
 			// 隐私保护指引名称
58
 			protocol: {
58
 			protocol: {
59
 				type: String,
59
 				type: String,
60
-				default: '《储蓄保一壶茶商户小程序隐私保护指引》'
60
+				default: '《幸福保商户小程序隐私保护指引》'
61
 			},
61
 			},
62
 			// 子描述
62
 			// 子描述
63
 			subDesc: {
63
 			subDesc: {
64
 				type: String,
64
 				type: String,
65
-				default: '。如果你同意《储蓄保一壶茶商户小程序隐私保护指引》,请点击“同意开始使用。”'
65
+				default: '。如果你同意《幸福保商户小程序隐私保护指引》,请点击“同意开始使用。”'
66
 			}
66
 			}
67
 		},
67
 		},
68
 		mounted() {
68
 		mounted() {

+ 45 - 2
utils/readAppInfo.js

@@ -99,7 +99,9 @@ const func = async () => {
99
 		const paramsData = readQuery()
99
 		const paramsData = readQuery()
100
 		if(!paramsData) {
100
 		if(!paramsData) {
101
 			return;
101
 			return;
102
-		}
102
+		}
103
+		
104
+		console.log('%c [ 1. 读取url登录信息url参数 ]-4', 'font-size:13px; background:pink; color:#bf2c9f;', paramsData)
103
 
105
 
104
 		const paramsData1 = {
106
 		const paramsData1 = {
105
 			"storeStaff": null,
107
 			"storeStaff": null,
@@ -143,7 +145,48 @@ const func = async () => {
143
 		const userInfoData = await selectMerchant({
145
 		const userInfoData = await selectMerchant({
144
 			uid: paramsData.user.uid
146
 			uid: paramsData.user.uid
145
 		});
147
 		});
146
-		console.log(userInfoData)
148
+		
149
+		console.log('%c [ 2. 获取用户信息 ]-4', 'font-size:13px; background:pink; color:#bf2c9f;', userInfoData)
150
+		
151
+		if(userInfoData.data.status === 200) {
152
+			// 新逻辑
153
+			uni.setStorageSync('selectmerchant', userInfoData.data.data);
154
+			let storeStaff = uni.getStorageSync('storeStaff')
155
+			console.log('%c [ storeStaff ]-4', 'font-size:13px; background:pink; color:#bf2c9f;', storeStaff, storeStaff != null)
156
+			console.log('%c [ 本地存储用户信息 userInfo ]-4', 'font-size:13px; background:pink; color:#bf2c9f;', uni.getStorageSync('userinfo'))
157
+			localStorage.setItem('aaa', '33333')
158
+			console.log('读原生的', localStorage.getItem('aaa'))
159
+			
160
+			if (storeStaff) {
161
+				queryStoreBranch({
162
+					id: storeStaff.department
163
+				}).then(res => {
164
+					if (res.data.status == 200) {
165
+						uni.setStorageSync('jurisdiction', res.data.data.jurisdiction);
166
+					}
167
+				})
168
+			} else {
169
+				uni.setStorageSync('jurisdiction', [7, 9, 5, 3]);
170
+			}
171
+			// uni.showToast({
172
+			// 	title: res.data.message,
173
+			// 	icon: "none"
174
+			// })
175
+			setTimeout(function() {
176
+				console.log('%c [ 3. 获取用户信息成功,跳转页面 ]-4', 'font-size:13px; background:pink; color:#bf2c9f;')
177
+				uni.switchTab({
178
+					url: '../../cashier/index'
179
+				});
180
+			}, 700);
181
+		}
182
+		
183
+		
184
+		
185
+		
186
+		return;
187
+		// 之前的逻辑
188
+		
189
+		uni.setStorageSync('selectmerchant', data.data.data);
147
 
190
 
148
 		const {
191
 		const {
149
 			merchantIntention = {},
192
 			merchantIntention = {},