Browse Source

auto commit

gcz 4 years ago
parent
commit
b971b03939

+ 10 - 3
pages/login/loginType.vue

@@ -87,14 +87,21 @@
 							uni.getStorage({
 							    key: 'userInfo',
 							    success: function (res) {
-							        // console.log('userInfo',res.data);
-									if(res.data.phone){
+							        console.log('userInfo',res.data);
+									if(res.data.phone){										
 										serf.havePhone = true;
 										serf.loginSuccess();										
 									}else{
 										return;
 									}
-							    }
+							    },
+								fail:function(err){
+									serf.$api.msg('本次获取手机信息失败,将在下次检查!',2000);
+									setTimeout(()=>{
+										serf.loginSuccess();
+									},2000);
+									console.log('getStorage err',err);
+								}
 							});
 							
 							

+ 1 - 0
pages/usercenter/certificateList/certificate/certificate.vue

@@ -37,6 +37,7 @@
 
 <script>
 	const wxml2canvas = require('@/utils/wxml2canvas.js');
+	const html2canvas = require('@/utils/html2canvas.min.js');
 	export default {
 		data() {
 			return {

+ 10 - 3
store/index.js

@@ -53,6 +53,11 @@ export default new Vuex.Store({
 		 * 退出登录,传入false只更新缓存不跳转
 		 */
 		logout(state, v = true) {
+			const token = uni.getStorageSync(sysTokenKey);			
+			let thetoken = 'Bearer ' + token.accessToken;
+			http.get(config.apiBaseurl + '/carbon-h5/wap/customer/logout',{header: {Authorization:thetoken}}).then(res =>{
+				console.log('res',res)
+			});
 			state.hasLogin = false;
 			state.userInfo = {};
 			state.token = '';
@@ -79,8 +84,10 @@ export default new Vuex.Store({
 		// },
 		
 		async upInfo(state, provider = {}) {
-			const token = uni.getStorageSync(sysTokenKey);
-			let thetoken = 'Bearer ' + token.accessToken;
+			// const token = uni.getStorageSync(sysTokenKey);
+			// let thetoken = 'Bearer ' + token.accessToken;
+			const token = state.token;
+			let thetoken = 'Bearer ' + token;
 			//用户信息结构
 			const infoObj = {
 				"page": 0,
@@ -151,7 +158,7 @@ export default new Vuex.Store({
 			//在线更新取得用户信息
 			then(await(
 					http.get(config.apiBaseurl + '/carbon-h5/wap/customer/getCustomerByToken',{header: {Authorization:thetoken}}).then(res => {
-						// console.log('getCustomerByToken', res.data);
+						console.log('getCustomerByToken', res);
 						if(res.data.retHead.errCode == 0){res.data.code = 0;}
 						// 处理非微信头像
 						let headImage = res.data.retBody.headImage;

File diff suppressed because it is too large
+ 20 - 0
utils/html2canvas.min.js