2 Коммиты 1a24dc4f61 ... de9a7e8658

Автор SHA1 Сообщение Дата
  chending1994 de9a7e8658 '展会' 4 лет назад
  chending1994 2109d0adcd 'app.vue' 4 лет назад
1 измененных файлов с 3 добавлено и 25 удалено
  1. 3 25
      src/App.vue

+ 3 - 25
src/App.vue

@@ -1,6 +1,5 @@
 <script>
 	import { isWechat, wxConfigH5, weixinLogin, getQueryString } from '@/utils/utils';
-	import { wxUserInfo } from '@/api/userInfo';
 
 	export default {
 		async onLaunch(options) {
@@ -12,40 +11,19 @@
 		},
 		methods: {
 			async initData() {
-	      this.$mStore.dispatch('getCompetitionId')
 				// #ifdef H5
 				if (isWechat()) {
 					const url = window.location.href.split('#')[0];
 					await wxConfigH5(url);
 				}
 				// #endif
-				const token = uni.getStorageSync('accessToken');
 				// 获取页面设置配置
 				if(process.env.NODE_ENV === 'production') {
-					const token = uni.getStorageSync('accessToken');
-					const wxUser = uni.getStorageSync('wxUser');
 					const code = getQueryString('code');
-					if (!wxUser && !code) {
+					const storageCode = uni.getStorageInfoSync('code');
+					if((code && !storageCode) || (storageCode && code != storageCode)) {
+						uni.setStorageSync('code', code)
 						weixinLogin();
-					} else if (!wxUser && code) {
-						this.$http.get(wxUserInfo, {
-							'code': code
-						})
-							.then((res) => {
-								this.$mStore.commit('wxUser', res.data);
-								if (!this.$mStore.getters.hasLogin) {
-									this.$mRouter.push({
-										route: '/pages/login/index'
-									})
-								}
-							})
-							.catch(() => {
-								this.$mHelper.toast('获取用户失败');
-							})
-					} else if (wxUser && !code) {
-	
-					} else if (wxUser && code) {
-	
 					}
 				}
 			}