Explorar el Código

其他浏览器

zhengkaixin hace 1 año
padre
commit
a2ad5e3956
Se han modificado 1 ficheros con 11 adiciones y 2 borrados
  1. 11 2
      utils/init.js

+ 11 - 2
utils/init.js

@@ -24,15 +24,24 @@ var app = {
 			} else{
 				var NODE_NAME=  process.env['NODE_NAME']
 				if(NODE_NAME=="production"){
-					alert("请使用微信打开本页面")
+					// alert("请使用微信打开本页面")
+					carhelp.setOpenId(this.guid())
 				}
 			}
 		}else{
-			carhelp.setOpenId(process.car.openId)
+			//carhelp.setOpenId(process.car.openId)
+			carhelp.setOpenId(this.guid())
 			//this.getPersion(process.car.openId)
 		}
 		
 		
+	},
+	 guid() {
+	    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+	        var r = Math.random() * 16 | 0,
+	            v = c == 'x' ? r : (r & 0x3 | 0x8);
+	        return v.toString(16);
+	    });
 	},
 	 getPersion(thisopenId){
 		 var tdate=new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().substr(0,15).replace("T"," ")