xuqiaoying 2 سال پیش
والد
کامیت
5c22f7da98
2فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 1 0
      common/methodTool.js
  2. 1 3
      pages/index/index.vue

+ 1 - 0
common/methodTool.js

@@ -61,6 +61,7 @@ export default {
 	exit() {
 		uni.removeStorageSync('user_account')
 		uni.removeStorageSync('token')
+		uni.removeStorageSync('h5_code')
 		store.state.userInfo = null
 		uni.reLaunch({
 			url: '/pages/index/index'

+ 1 - 3
pages/index/index.vue

@@ -330,7 +330,6 @@ export default {
 	},
 	async onShow() {
 		// #ifdef H5
-		// this.OfficialLogin()
 		if (location.search) {
 			let arrs = location.search.slice(1).split("&")
 			for (let i = 0; i < arrs.length; i++) {
@@ -338,7 +337,6 @@ export default {
 			}
 			console.log('optObj:', this.optObj);
 			uni.setStorageSync('h5_code', this.optObj.code)
-			// this.OfficialLogin()
 		} else {
 			// 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名,这时候你就拿到code了
 			if (!uni.getStorageSync('h5_code')) {
@@ -347,7 +345,7 @@ export default {
 					"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6f48f721d18244eb" +
 					"&redirect_uri=" +
 					encodeURIComponent('https://www.xyyxt.net/?ask_type=h.xyyxt.net') +
-					"&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect"
+					"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"
 				)
 				return
 			} else {