Explorar el Código

1. 修改 clientId 的保存 2. manifest.json 关闭微信的 unipush

shizhongqi hace 9 meses
padre
commit
019be9f827

+ 7 - 8
ghsApp/src/admin/home/login.vue

@@ -265,12 +265,12 @@ export default {
 									uni.navigateBack()
 
 									// #ifdef APP-PLUS
-									//保存安卓的clientId
-									let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+									//保存 clientId
+									//let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
 									const clientInfo = plus.push.getClientInfo()
 									let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-									if(hasClientId == '' || hasClientId != currentClientId){
-										replaceClientId({id:currentClientId})
+									if(currentClientId != ''){
+										replaceClientId({id:currentClientId, auto:0})
 									}
 									// #endif
 								}
@@ -348,12 +348,11 @@ export default {
 					uni.navigateBack()
 
 					// #ifdef APP-PLUS
-					//保存安卓的clientId
-					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+					//保存 clientId
 					const clientInfo = plus.push.getClientInfo()
 					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-					if(hasClientId == '' || hasClientId != currentClientId){
-						replaceClientId({id:currentClientId})
+					if(currentClientId != ''){
+						replaceClientId({id:currentClientId, auto:0})
 					}
 					// #endif
 				}

+ 4 - 3
ghsApp/src/manifest.json

@@ -186,7 +186,8 @@
             }
         },
         "uniStatistics" : {
-            "enable" : true
+            "enable" : true,
+            "debug" : true
         }
     },
     /* 快应用特有相关 */
@@ -207,12 +208,12 @@
         "optimization" : {
             "subPackages" : true
         },
-        "lazyCodeLoading":"requiredComponents",
+        "lazyCodeLoading" : "requiredComponents",
         "uniStatistics" : {
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 7 - 2
ghsApp/src/mixins/globalMixins.js

@@ -4,6 +4,7 @@ import { pageTo, isLogin } from '@/utils/util.js'
 import { getShopInfo, wxMiniLogin } from '@/utils/auth'
 import { postWxCode, getDictionaries } from '@/api/mini'
 import { getStaffApi,hasTokenAutoLogin } from '@/api/common'
+import { replaceClientId } from '@/api/admin'
 import { codePay} from "@/api/order/index";
 
 export default {
@@ -109,11 +110,15 @@ export default {
           this.skCustomId = subRes.data.skCustomId
 
           this.listenPDAkd()
-
           this.setUserShopAll()
-          
           this.init()
           
+          //更新 clientId
+          const clientInfo = plus.push.getClientInfo()
+          let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+          if(currentClientId != ''){
+            replaceClientId({id:currentClientId, auto: 1})
+          }
         })
       }
       // #endif 

+ 8 - 11
hdApp/src/admin/home/login.vue

@@ -65,7 +65,7 @@ import { mapActions } from "vuex";
 import { getShopInfo} from "@/utils/auth";
 import {appLogin} from '@/api/common'
 import { getDictionaries,postWxCode } from '@/api/mini'
-//import { replaceClientId } from '@/api/admin'
+import { replaceClientId } from '@/api/admin'
 import { phoneLogin,wxMobileLogin } from "@/api/auth";
 import { ghsInfo } from "@/api/ghs/index";
 export default {
@@ -306,17 +306,15 @@ export default {
 									let prevPage = pages[ pages.length - 2 ];
 									//修改上一页data里面的xjData
 									prevPage.$vm.backAction = 'login'
-
 									uni.navigateBack()
 
 									// #ifdef APP-PLUS
 									//保存安卓的clientId
-									let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
 									const clientInfo = plus.push.getClientInfo()
 									let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-									if(hasClientId == '' || hasClientId != currentClientId){
-										//replaceClientId({id:currentClientId})
-										console.log("clientId ---------- ", currentClientId)
+									if(currentClientId != ''){
+										replaceClientId({id:currentClientId, auto:0})
+										console.log("mobileLogin - clientId ---------- ", currentClientId)
 									}
 									// #endif
 								}
@@ -400,16 +398,15 @@ export default {
 					let prevPage = pages[ pages.length - 2 ];
 					//修改上一页data里面的xjData
 					prevPage.$vm.backAction = 'login'
-
 					uni.navigateBack()
+
 					// #ifdef APP-PLUS
 					//保存安卓的clientId
-					let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
 					const clientInfo = plus.push.getClientInfo()
 					let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-					if(hasClientId == '' || hasClientId != currentClientId){
-						//replaceClientId({id:currentClientId})
-						console.log("clientId ---------- ", currentClientId)
+					if(currentClientId != ''){
+						replaceClientId({id:currentClientId, auto:0})
+						console.log("loginFun - clientId ---------- ", currentClientId)
 					}
 					// #endif
 				}

+ 9 - 6
hdApp/src/manifest.json

@@ -84,16 +84,19 @@
                     "unipush" : {
                         "version" : "2",
                         "offline" : true,
+                        "hms" : {},
+                        "oppo" : {},
                         "vivo" : {},
+                        "mi" : {},
                         "honor" : {},
                         "icons" : {
                             "small" : {
                                 "xxhdpi" : "unpackage/res/icons/72x72.png"
                             }
-                        },
-                        "hms" : {}
+                        }
                     }
-                }
+                },
+                "statics" : {}
             },
             "orientation" : [ "portrait-primary" ],
             "icons" : {
@@ -188,12 +191,12 @@
         "optimization" : {
             "subPackages" : true
         },
-        "lazyCodeLoading":"requiredComponents",
-       "uniStatistics" : {
+        "lazyCodeLoading" : "requiredComponents",
+        "uniStatistics" : {
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 9 - 1
hdApp/src/mixins/globalMixins.js

@@ -3,6 +3,7 @@ import { pageTo } from '@/utils/util.js'
 import { getShopInfo, wxLoginFn } from '@/utils/auth'
 import { getDictionaries } from '@/api/mini'
 import { hasTokenAutoLogin } from '@/api/common'
+import { replaceClientId } from '@/api/admin'
 import constant from '@/constant'
 export default {
 	data() {
@@ -77,11 +78,11 @@ export default {
 					that.setUserShopAll()
 
 					that.init()
-
 				  }
 				})
 			}
 			// #endif
+
 			//#ifdef APP-PLUS
 			if(!this.$util.isEmpty(token)){
 				hasTokenAutoLogin().then(subRes=>{
@@ -101,6 +102,13 @@ export default {
 						})
 						that.setUserShopAll()
 						that.init()
+
+						//更新 clientId
+						const clientInfo = plus.push.getClientInfo()
+						let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+						if(currentClientId != ''){
+							replaceClientId({id:currentClientId, auto: 1})
+						}
 					}
 				})
 			}

+ 1 - 1
开发http/ghsApp/src/manifest.json

@@ -212,7 +212,7 @@
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 1 - 1
开发http/hdApp/src/manifest.json

@@ -193,7 +193,7 @@
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 1 - 1
开发https/ghsApp/src/manifest.json

@@ -212,7 +212,7 @@
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 1 - 1
开发https/hdApp/src/manifest.json

@@ -193,7 +193,7 @@
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 1 - 1
线上/ghsApp/src/manifest.json

@@ -212,7 +212,7 @@
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {

+ 1 - 1
线上/hdApp/src/manifest.json

@@ -193,7 +193,7 @@
             "enable" : true
         },
         "unipush" : {
-            "enable" : true
+            "enable" : false
         }
     },
     "mp-alipay" : {