Преглед на файлове

调整单点登录逻辑

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 6
 import store from '@/store/index.js'
7 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 13
 Vue.config.productionTip = false
10 14
 Vue.prototype.$time = time 
11 15
 Vue.prototype.$store = store 

+ 7 - 1
openmerchant/amountopening/index.vue

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

Файловите разлики са ограничени, защото са твърде много
+ 194 - 13483
package-lock.json


+ 2 - 1
package.json

@@ -4,6 +4,7 @@
4 4
     "crypto-js": "^4.1.1",
5 5
     "easemob-websdk": "^4.6.0",
6 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 190
 			this.mer_id = selectmerchant.merId
191 191
 			let jurisdiction = uni.getStorageSync('jurisdiction')
192 192
 			
193
-			if(jurisdiction!=null){
193
+			if(jurisdiction){
194 194
 			jurisdiction.forEach((res,index)=>{
195 195
 				if(res==7){
196 196
 					this.zhuangi = res

+ 1 - 1
pages/my/index.vue

@@ -66,7 +66,7 @@
66 66
 			let jurisdiction = uni.getStorageSync('jurisdiction')
67 67
 			console.log('jurisdiction', jurisdiction)
68 68
 			let mnuList = this.mnu
69
-			if (jurisdiction!=null) {
69
+			if (jurisdiction) {
70 70
 				jurisdiction.forEach((res, index) => {
71 71
 					mnuList.forEach((result, i) => {
72 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 58
 			protocol: {
59 59
 				type: String,
60
-				default: '《储蓄保一壶茶商户小程序隐私保护指引》'
60
+				default: '《幸福保商户小程序隐私保护指引》'
61 61
 			},
62 62
 			// 子描述
63 63
 			subDesc: {
64 64
 				type: String,
65
-				default: '。如果你同意《储蓄保一壶茶商户小程序隐私保护指引》,请点击“同意开始使用。”'
65
+				default: '。如果你同意《幸福保商户小程序隐私保护指引》,请点击“同意开始使用。”'
66 66
 			}
67 67
 		},
68 68
 		mounted() {

+ 45 - 2
utils/readAppInfo.js

@@ -99,7 +99,9 @@ const func = async () => {
99 99
 		const paramsData = readQuery()
100 100
 		if(!paramsData) {
101 101
 			return;
102
-		}
102
+		}
103
+		
104
+		console.log('%c [ 1. 读取url登录信息url参数 ]-4', 'font-size:13px; background:pink; color:#bf2c9f;', paramsData)
103 105
 
104 106
 		const paramsData1 = {
105 107
 			"storeStaff": null,
@@ -143,7 +145,48 @@ const func = async () => {
143 145
 		const userInfoData = await selectMerchant({
144 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 191
 		const {
149 192
 			merchantIntention = {},