Browse Source

login url

zizhong.wang 1 year ago
parent
commit
00871750f2
1 changed files with 8 additions and 14 deletions
  1. 8 14
      App.vue

+ 8 - 14
App.vue

@@ -2,8 +2,7 @@
 import md5 from '@/common/md5.js';
 export default {
   globalData: {
-    shareUrl: "",
-	//shareUrl:"",
+    shareUrl: "https://xnh.xazhima.com/prod-api/wap/business/weixin/",
     globalTimestamp: Date.now().toString(),
     secret: "AirQK_weichat_app_zhima",
     selectedIndex:0,
@@ -57,24 +56,19 @@ export default {
 	  },
 	  loginRequest(codeRes){
 		let that = this;
-	  	let md5Sign = md5("method="+'user'+"&timestamp="+getApp().globalData.globalTimestamp+"&secret="+getApp().globalData.secret)
-	  	let url = getApp().globalData.shareUrl+'api/api.php'+'?method=user&action=login&timestamp='+getApp().globalData.globalTimestamp +'&sign='+md5Sign
-	  	uni.request({
+	  	let url = getApp().globalData.shareUrl+"login/" + codeRes;
+		uni.request({
 	  		url:url,
-	  		method: 'POST',
+	  		method: 'GET',
 	  		header: {
 	  			'content-type': 'application/x-www-form-urlencoded'
 	  		},
-	  		data: {
-	  			code:codeRes
-	  		},
+	  		
 	  		success: (res) => {
 	  			console.log(res)
-	  			if(res.data.code === 200){
-	  				getApp().globalData.open_id = res.data.data.openid;
-					getApp().globalData.user_status = res.data.data.status;
-					getApp().globalData.session_key = res.data.data.session_key
-					getApp().globalData.user_phone = res.data.data.phone;
+	  			if(res.code === 200){
+	  				getApp().globalData.open_id = res.data.openid;
+					getApp().globalData.session_key = res.data.session_key
 					that.$isResolve();
 				//	uni.hideLoading() 
 	  			}