Parcourir la source

Merge branch 'master' of https://git.nanodreamtech.com/Boss/yizhizan-h5

il y a 7 mois
Parent
commit
758fbe6c06

+ 1 - 1
common/config.js

@@ -4,7 +4,7 @@ let mobile=0;
 // #ifdef APP-PLUS
 mobile=1
 //#endif
-if (process.env.NODE_ENV !== 'development'||mobile || true) {
+if (process.env.NODE_ENV !== 'development'||mobile) {
 	//正式环境
 	const ROOTPATH = "http://www.bosszan.com/sqx_fast";
 	const ROOTPATH1 = "http://www.bosszan.com/sqx_fast";

+ 65 - 69
common/queue.js

@@ -466,73 +466,69 @@ module.exports = {
 	},
 	//APP获取手机权限鉴权
 	// APP获取手机权限鉴权(优化版,兼容全权限+多系统)
-	checkPermission: function(permission, tip) {
-		return new Promise((resolve) => {
-			const permisionObj = uni.getAppAuthorizeSetting();
-			const system = uni.getSystemInfoSync().platform; // 获取系统类型(ios/android)
-
-			// 步骤1:统一权限scope映射(解决不同系统/权限的scope差异)
-			let realScope = permission;
-			const scopeMap = {
-				// 基础权限(双端通用)
-				'microphone': 'microphone', // 麦克风
-				'camera': 'camera', // 相机
-				'location': 'scope.userLocation', // 定位(小程序/APP通用)
-				// 相册权限(系统差异化处理)
-				'albumRead': system === 'ios' ? 'photos' : 'storage', // 读取相册
-				'albumWrite': system === 'ios' ? 'writePhotosAlbum' : 'storage', // 写入相册
-			};
-			// 兼容传入的permission别名(如传入'album'自动映射为对应系统的读取权限)
-			if (permission === 'album') realScope = scopeMap.albumRead;
-			else if (permission === 'albumWrite') realScope = scopeMap.albumWrite;
-			else if (scopeMap[permission]) realScope = scopeMap[permission];
-
-			// 步骤2:获取权限状态并校验
-			permisionObj.getSetting({
-				success: (res) => {
-					const authStatus = res.authSetting[realScope];
-					// 已授权
-					if (authStatus === true) {
-						resolve(true);
-					}
-					// 已拒绝(引导到设置页)
-					else if (authStatus === false) {
-						uni.showModal({
-							title: '权限不足',
-							content: `${tip},请前往设置开启权限`,
-							confirmText: '去设置',
-							cancelText: '取消',
-							success: (modalRes) => {
-								if (modalRes.confirm) {
-									permisionObj.openAppAuthorizeSetting({
-										success: () => resolve(
-										false), // 跳转设置页后不自动重试,需用户手动开启后返回
-										fail: () => resolve(false)
-									});
-								} else {
-									resolve(false);
-								}
-							}
-						});
-					}
-					// 未授权过(发起系统授权请求)
-					else {
-						permisionObj.authorize({
-							scope: realScope,
-							success: () => resolve(true),
-							fail: (err) => {
-								console.log(`权限授权失败:${permission}`, err);
-								resolve(false);
-							}
-						});
-					}
-				},
-				fail: (err) => {
-					console.log(`获取权限设置失败:${permission}`, err);
-					resolve(false);
-				}
-			});
-		});
-	},
-
+	checkPermission(permission, tip) {
+	  return new Promise((resolve) => {
+	    const permisionObj = uni.getAppAuthorizeSetting && uni.getAppAuthorizeSetting();
+	    if (!permisionObj || !permisionObj.getSetting) {
+	      console.log('当前环境不支持 getAppAuthorizeSetting');
+	      resolve(true); // 默认放行
+	      return;
+	    }
+	
+	    const system = uni.getSystemInfoSync().platform;
+	    let realScope = permission;
+	    const scopeMap = {
+	      'microphone': 'microphone',
+	      'camera': 'camera',
+	      'location': 'scope.userLocation',
+	      'albumRead': system === 'ios' ? 'photos' : 'storage',
+	      'albumWrite': system === 'ios' ? 'writePhotosAlbum' : 'storage',
+	    };
+	    if (permission === 'album') realScope = scopeMap.albumRead;
+	    else if (permission === 'albumWrite') realScope = scopeMap.albumWrite;
+	    else if (scopeMap[permission]) realScope = scopeMap[permission];
+	
+	    console.log('准备检测权限:', realScope);
+	
+	    permisionObj.getSetting({
+	      success: (res) => {
+	        console.log('权限状态', res.authSetting);
+	        const authStatus = res.authSetting[realScope];
+	        if (authStatus === true) {
+	          resolve(true);
+	        } else if (authStatus === false) {
+	          uni.showModal({
+	            title: '权限不足',
+	            content: `${tip},请前往设置开启权限`,
+	            confirmText: '去设置',
+	            cancelText: '取消',
+	            success: (modalRes) => {
+	              if (modalRes.confirm) {
+	                permisionObj.openAppAuthorizeSetting({
+	                  success: () => resolve(false),
+	                  fail: () => resolve(false)
+	                });
+	              } else {
+	                resolve(false);
+	              }
+	            }
+	          });
+	        } else {
+	          permisionObj.authorize({
+	            scope: realScope,
+	            success: () => resolve(true),
+	            fail: (err) => {
+	              console.log('权限授权失败', err);
+	              resolve(false);
+	            }
+	          });
+	        }
+	      },
+	      fail: (err) => {
+	        console.log('getSetting失败', err);
+	        resolve(false);
+	      }
+	    });
+	  });
+	}
 };

+ 2 - 2
components/hg-level4-address/hgLevel4Address.vue

@@ -214,13 +214,13 @@
 	.address-page {
 		display: flex;
 		flex-direction: column;
-		height: 100%;
 		background: #FBFBFB;
 		margin: 0 16rpx;
+		flex: 1;
+		box-sizing: border-box;
 	}
 	.picker-content {
 		display: flex;
-		flex: 1;
 		overflow: auto;
 		gap: 16rpx;
 	}

+ 4 - 0
manifest.json

@@ -149,6 +149,10 @@
                         "spotlight@3x" : "unpackage/res/icons/120x120.png"
                     }
                 }
+            },
+            "splashscreen" : {
+                "useOriginalMsgbox" : true,
+                "androidStyle" : "common"
             }
         },
         "nvueCompiler" : "uni-app",

+ 2 - 1
package/jobIntention/city.vue

@@ -129,6 +129,7 @@
 			 * 定位获取经纬度
 			 */
 			async getLatOrLng() {
+				// #ifdef APP
 				let that = this;
 				  const hasPermission = await this.$queue.checkPermission(
 				    'location', // 固定传 'location',双端通用
@@ -139,7 +140,7 @@
 				    uni.showToast({ title: '未获取定位权限,无法推荐附近岗位', icon: 'none' });
 				    return;
 				  }
-				
+				// #endif
 				
 				
 				uni.getLocation({

+ 14 - 12
package/screen/city.vue

@@ -1,6 +1,6 @@
 <template>
-	<view style="display: flex;flex-direction: column;height: 100vh;background: #FBFBFB;">
-		<view class="custom-navbar" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
+	<view class="page-container" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
+		<view class="custom-navbar">
 			<view class="navbar-content">
 				<view class="nav-left" @click="goBack">
 					<u-icon name="close" color="#333" size="32"></u-icon>
@@ -11,12 +11,8 @@
 				</view>
 			</view>
 		</view>
-		 <view class="content">
-			<hg-level4-address :city="city" :county="county" :street="street"
-			  placeholder="请选择地址"
-			  @confirm="onAddressConfirm"
-			  >         
-			</hg-level4-address>
+		<view class="page-content">
+		  <hg-level4-address :city="city" :county="county" :street="street" @confirm="onAddressConfirm"></hg-level4-address>
 		</view>
 	</view>
 </template>
@@ -71,11 +67,18 @@
 </script>
 
 <style lang="scss" scoped>
+	.page-container{
+		display: flex;
+		flex-direction: column;
+		height: 100vh;
+		background: #FBFBFB;
+	}
 	.custom-navbar {
 		width: 100%;
 		height: 88rpx;
-		margin-bottom: 20rpx;
 		box-sizing: border-box;
+		display: flex;
+		flex-direction: column;
 		.navbar-content {
 			display: flex;
 			align-items: center;
@@ -116,10 +119,9 @@
 			}
 		}
 	}
-	.content{
+	.page-content {
 		flex: 1;
-		display: flex;
-		flex-direction: column;
 		overflow: hidden;
+		display: flex;
 	}
 </style>

+ 4 - 3
package/search/search.vue

@@ -252,7 +252,7 @@
 		data() {
 			return {
 				statusBarHeight: 0, // 状态栏高度
-				show: false,
+				show: true,
 				keyword: '',
 				currentSx: 0,
 				sxTypeList: [{
@@ -328,7 +328,7 @@
 					console.log(res, '地理位置');
 					that.latitude = res.latitude;
 					that.longitude = res.longitude;
-					that.getUserList();
+					// that.getUserList();
 				},
 				fail: function() {
 					console.log('获取地址失败');
@@ -378,6 +378,7 @@
 					content: "确定删除吗?",
 					confirmColor: "#016BF6",
 					success: function(res) {
+						if(res.cancel)return;
 						that.$Request.post('/app/record/deleteRecord', {recordId:''}).then(res => {
 							if (res.code == 0) {
 								that.searchList = []
@@ -631,7 +632,7 @@
 		// right: 0;
 		width: 100%;
 		// padding-top: 80rpx;
-		height: 88rpx;
+		// height: 88rpx;
 		background-color: #ffffff;
 		z-index: 10000;
 		

+ 6 - 6
pages/index/game/gameList.vue

@@ -497,7 +497,7 @@ export default {
     // 获取位置信息
     async getLocation() {
       let that = this;
-	  
+	  // #ifdef APP
 	  const hasPermission = await this.$queue.checkPermission(
 	    'location', // 固定传 'location',双端通用
 	    '获取您的位置用于推荐附近的求职岗位' // 提示文案也无需区分系统(统一表述即可)
@@ -507,7 +507,7 @@ export default {
 	    uni.showToast({ title: '未获取定位权限,无法推荐附近岗位', icon: 'none' });
 	    return;
 	  }
-	  				
+	  // #endif
 	  
 	  
       uni.getLocation({
@@ -518,7 +518,7 @@ export default {
           that.getSelectCity(res.longitude,res.latitude)
         },
         fail: function () {
-			this.getTypeList();
+			that.getTypeList();
         },
       });
     },
@@ -527,7 +527,7 @@ export default {
 		this.$Request.get('/app/Login/selectCity?lat=' + latitude + '&lng=' + longitude).then(res => {
 			if (res.code == 0) {
 				// console.log(res, '获取地址信息')
-				this.city = res.data.city ? res.data.city : '区域'
+				that.city = res.data.city ? res.data.city : '区域'
 				uni.setStorageSync('city', res.data.city)
 				that.getTypeList();
 			}
@@ -541,7 +541,7 @@ export default {
         postType: this.typeList.length > 0 ? this.typeList[this.current].name : "",
 		ruleClassifyName: this.typeList.length > 0 ? this.typeList[this.current].name : "", //岗位名称
         screen: +this.currentSx + 1, //1推荐 2最新
-        city: this.city == "全国" ? "" : this.city,
+        city: this.city == "区域" || this.city == "全国"? "" : this.city,
         lng: this.longitude,
         lat: this.latitude,
 		isDue:1,
@@ -600,7 +600,7 @@ export default {
         limit: this.searchLimit,
         postType: this.typeList.length > 0 ? this.typeList[this.current].name : "",
         screen: +this.currentSx + 1, //1推荐 2最新
-        city: this.city == "全国" ? "" : this.city,
+        city: this.city == "区域" || this.city == "全国"? "" : this.city,
         lng: this.longitude,
         lat: this.latitude,
 		isDue:1,

+ 5 - 3
pages/index/game/order.vue

@@ -629,6 +629,8 @@
 			},
 			//一键投递
 			oneClickApply(item) {
+				if(!this.info.user||!this.info.user.userId)
+					return this.$queue.showToast('岗位发布者已不知所踪,请联系管理员😂😂😂😂😂😂')
 				if (uni.getStorageSync('token')) {
 					this.$Request.get('/app/resumes/selectResumesByUserId').then(res => {
 						if (res.code == 0) {
@@ -649,9 +651,9 @@
 								})
 							} else {
 								// 执行一键投递逻辑
-								this.$Request.postT("/app/sendRecord/addSendRecord", {
-									postPushId: this.postPushId,
-									resumesId: res.data.resumesId,
+								this.$Request.postT("/app/resumes/sendResumes", {
+									to: this.info.user.userId, //接收人的userId
+									postPushId: this.postPushId, //岗位id
 									resumesAttachmentId:item.resumesAttachmentId
 								}).then(res => {
 									if (res.code == 0) {

+ 30 - 103
pages/index/index.vue

@@ -34,69 +34,13 @@
 		</block>
 		<block v-else>
 			<!-- 用户端 -->
-			<block v-if="userType==1">
-				<!-- <view class="topbg"> -->
-				<!-- 顶部图片区 -->
-				<!-- #ifdef H5 -->
-				<!-- <view class="banner flex justify-center" style="padding-top: 20rpx;"
-						v-if="bannerListuser.length!=0"> -->
-				<!-- #endif -->
-				<!-- #ifndef H5 -->
-				<!-- <view class="banner flex justify-center" v-if="bannerListuser.length!=0"> -->
-				<!-- #endif -->
-				<!-- <view class="banner-box">
-								<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true"
-									:interval="5000" :duration="300">
-									<swiper-item v-for="(item,index) in bannerListuser" :key="index"
-										@click="goNave(item.url)">
-										<view class="swiper-item" style="width: 100%;height: 100%;">
-											<image :src="item.imageUrl"
-												style="width: 100%;height: 100%;border-radius: 24rpx;"
-												mode="scaleToFill">
-											</image>
-										</view>
-									</swiper-item>
-								</swiper>
-							</view>
-						</view> -->
-				<!-- 公告区 -->
-				<!-- <view class="announcement" v-if="gongao.length!=0">
-							<view class="announcementbox">
-								<view class="anount">最新公告</view>
-								<view class="anounts flex align-center" v-if="gongao.length>0">
-									<view class="" style="width: 100%;">
-										<u-notice-bar color="#333" bg-color="#e5fff2" padding="0rpx 24rpx 4rpx 24rpx"
-											:volume-icon="false" style="height: 100%;" mode="vertical"
-											:list="gongao"></u-notice-bar>
-									</view>
-								</view>
-								<view class="anounts flex align-center" style="padding-left: 30rpx;" v-else>
-									暂无公告
-								</view>
-							</view>
-						</view> -->
-
-				<!-- 企业端 -->
-				<!-- <view v-if="gridlist.length!=0">
-							<u-grid :col="4" :border="false">
-								<u-grid-item bg-color="#00DD9A">
-									<view v-for="(item,index) in gridlist" :key="index" style="text-align: center;"
-										@click="goNave(item.url)">
-										<image :src="item.imageUrl"
-											style="width:80rpx;height: 80rpx;border-radius: 50%;">
-										</image>
-										<view style="color: #FFFFFF;">{{item.name}}</view>
-									</view>
-								</u-grid-item>
-
-							</u-grid>
-						</view> -->
-				<!-- </view> -->
+			<view v-if="userType==1" class="page-container" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
+				
 				<view class="topbg-sticky">
 					<image class="top-bg" src="/static/images/index/index-bg.png" mode="widthFix" />
 					<!-- <view class="top-bg"></view> -->
 					<!-- 标题-搜索 -->
-					<view class="topbg-sticky-box" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
+					<view class="topbg-sticky-box" >
 						<view class="topbg-sticky-title flex justify-between align-center">
 							<view class="topbg-sticky-title-left flex align-center">
 								<image src="../../static/images/index/xingIcon.svg" class="xing-icon" />
@@ -221,7 +165,7 @@
 				<block v-if="current != typeList.length - 1">
 					<view class="gwList flex justify-center" v-if="dataList.length>0">
 						<view class="gwList-box">
-							<scroll-view scroll-y="true" style="width: 100%;height: 60vh;">
+							<scroll-view scroll-y="true" style="width: 100%;height: 100%;">
 								<view class="gwList-box-item flex justify-center" @click="gotoInfo(item.postPushId)"
 									v-for="(item,index) in dataList" :key="index">
 									<view class="gwList-box-item-box">
@@ -295,31 +239,12 @@
 				<view class="gwList" v-if="current == typeList.length - 1 && companList.length==0">
 					<empty />
 				</view>
-			</block>
+			</view>
 			<!-- 企业版 -->
-			<block v-else>
-				<!-- 顶部banner图片 -->
-				<!-- 
-					<view class="banner flex justify-center">
-						<view class="banner-box">
-							<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true"
-								:interval="5000" :duration="300">
-								<swiper-item v-for="(item,index) in bannerList" :key="index">
-									<view class="swiper-item" style="width: 100%;height: 100%;">
-										<image :src="item.imageUrl" style="width: 100%;height: 100%;border-radius: 24rpx;"
-											mode="scaleToFill"></image>
-									</view>
-								</swiper-item>
-							</swiper>
-						</view>
-					</view>
-				-->
-
+			<view v-else class="page-container" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
 				<view class="topbg-sticky">
-					<!-- 			<image class="top-bg" src="/static/images/index/index-bg1.png" mode="widthFix" /> -->
-					<!-- <view class="top-bg"></view> -->
 					<!-- 标题-搜索 -->
-					<view class="topbg-sticky-box" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
+					<view class="topbg-sticky-box">
 						<view class="topbg-sticky-title flex justify-between align-center">
 							<view class="topbg-sticky-title-left flex align-center">
 								<image src="../../static/images/index/xingIcon.svg" class="xing-icon" />
@@ -329,12 +254,7 @@
 						</view>
 						<view class="topbg-sticky-subtitle">亿职赞,愿你在逐梦路上找到心仪伙伴</view>
 					</view>
-
-					<!-- tabs和筛选 -->
 				</view>
-
-
-
 				<!-- 最新公告 -->
 				<view class="announcement" v-if="gongao.length!=0">
 					<view class="announcementbox">
@@ -508,8 +428,7 @@
 						<empty :isShow="false" v-if="datasList.length==0" />
 					</view>
 				</view>
-
-			</block>
+			</view>
 		</block>
 
 		<view v-if="goback==true" class="goback" @click="gotoBack">
@@ -710,7 +629,7 @@
 			this.statusBarHeight = systemInfo.statusBarHeight || 0;
 			this.companyId = uni.getStorageSync('companyId');
 			// #ifdef APP
-			this.getAudioPermision()
+			/* this.getAudioPermision() */
 			// #endif
 			// 获取邀请码保存到本地
 			if (e.invitation) {
@@ -723,9 +642,9 @@
 			}
 			// #endif
 			// this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
-			uni.showLoading({
-				title: '加载中'
-			})
+			// uni.showLoading({
+			// 	title: '加载中'
+			// })
 
 			if (uni.getStorageSync('userType')) {
 				this.userType = uni.getStorageSync('userType');
@@ -744,7 +663,7 @@
 			})
 
 
-
+			this.getLocalJobs();
 			this.getDomWidth()
 			this.$Request.getT('/app/common/type/255').then(res => {
 				if (res.code === 0) {
@@ -879,7 +798,6 @@
 			}
 			if (this.token) {
 				this.getUserInfo();
-
 				if (this.userType == 1) {
 					this.getJobType();
 				} else {
@@ -954,11 +872,14 @@
 			},
 			// 
 			async getLocalJobs() {
+				// #ifdef APP
 				const hasLocation = await this.$queue.checkPermission(
 					'location',
 					'获取位置需要定位权限,用于推荐同城的求职岗位'
 				);
 				if (!hasLocation) return;
+				// #endif
+				let that = this;
 				// 权限通过,调用定位API
 				uni.getLocation({
 					type: 'wgs84', //wgs84  gcj02
@@ -1301,7 +1222,7 @@
 					page: this.page,
 					limit: this.limit,
 					postType: '', //工作性质
-					expectedPosition: this.jobSxTypeList[this.currentJobSx].projectName, //岗位名称
+					expectedPosition: this.jobSxTypeList.length>0?this.jobSxTypeList[this.currentJobSx].projectName:'', //岗位名称
 					screen: +this.currentJobSxs + 1, //1推荐 2最新
 					expectedCity: this.city == '全国' ? '' : this.city, //城市
 					salaryRange: this.salaryRange, //薪资范围
@@ -1467,7 +1388,7 @@
 					page: this.page,
 					limit: this.limit,
 					//postType: this.typeList.length > 0 ? this.typeList[this.current].id : '',
-					ruleClassifyName: this.typeList[this.current].name, //岗位名称
+					ruleClassifyName: this.typeList.length>0?this.typeList[this.current].name:'', //岗位名称
 					screen: +this.currentSx + 1, //1推荐 2最新
 					county: this.county, //区
 					city: this.city == '全国' ? '' : this.city, //城市
@@ -1595,11 +1516,11 @@
 				this.$Request.get("/app/user/selectUserById").then(res => {
 					if (res.code == 0) {
 						console.log(res.data)
-						this.$queue.setData('weChatNum', res.data.weChatNum)
-						if (res.data.companyId) {
-							uni.setStorageSync('companyId', res.data.companyId)
+						this.$queue.setData('weChatNum', res.data?.weChatNum)
+						if (res.data && res.data.companyId) {
+							uni.setStorageSync('companyId', res.data?.companyId)
 						}
-						if (res.data.userType == 1 || res.data.userType == null) {
+						if (res.data?.userType == 1 || res.data?.userType == null) {
 							this.userType = 1
 							uni.setStorageSync('userType', 1)
 						} else {
@@ -1814,6 +1735,11 @@
 </script>
 
 <style lang="scss">
+	.page-container{
+		display: flex;
+		flex-direction: column;
+		height: calc(100vh - 50px);
+	}
 	page {
 		background: #F2F2F7;
 	}
@@ -2358,8 +2284,9 @@
 
 	.gwList {
 		width: 100%;
-		// margin-top: 220rpx;
-
+		flex: 1;
+		overflow: auto;
+		margin-bottom: 10rpx;
 		.gwList-box {
 			width: 710rpx;
 			height: 100%;

+ 17 - 0
pages/msg/im.vue

@@ -875,6 +875,7 @@
 	import configdata from '../../common/config.js';
 	import emoji from '../../common/emoji.json';
 	import attachment from '../../components/attachment.vue'
+	import permision from '@/js_sdk/wa-permission/permission.js'
 	export default {
 		components: {
 			attachment
@@ -1109,6 +1110,9 @@
 				}
 				uni.hideLoading();
 			});
+			// #ifdef APP
+				this.getAudioPermision()
+			// #endif
 		},
 		onShow() {
 			if (this.chatConversationId) {
@@ -1155,6 +1159,19 @@
 			goBack() {
 				uni.navigateBack();
 			},
+			//获取麦克风/摄像头权限
+			async getAudioPermision() {
+				let status = permision.isIOS ? await permision.judgeIosPermission("record") : await permision
+					.requestAndroidPermission("android.permission.RECORD_AUDIO")
+				let status2 = permision.isIOS ? await permision.judgeIosPermission("camera") : await permision
+					.requestAndroidPermission("android.permission.CAMERA")
+				if (status === null || status === 1 || status == true) { //已经同意授权
+					console.log('获取到权限了')
+			
+				} else { //未授权的
+					this.popupshowsq = true
+				}
+			},
 			// 显示更多选项
 			showMoreOptions() {
 				return this.$queue.showToast('waiting...')

+ 8 - 8
pages/my/index.vue

@@ -1341,24 +1341,24 @@
 			getUserInfo() {
 				this.$Request.get("/app/user/selectUserById").then((res) => {
 					if (res.code == 0) {
-						uni.setStorageSync("weChatNum", res.data.weChatNum);
-						uni.setStorageSync("zhiRate", res.data.zhiRate);
-						if (res.data.avatar) {
+						uni.setStorageSync("weChatNum", res.data?.weChatNum);
+						uni.setStorageSync("zhiRate", res.data?.zhiRate);
+						if (res.data?.avatar) {
 							this.avatar = res.data.avatar;
 						}
-						if (res.data.userName) {
+						if (res.data?.userName) {
 							this.userName = res.data.userName;
 						}
-						uni.setStorageSync("userId", res.data.userId);
-						if (res.data.companyId) {
+						uni.setStorageSync("userId", res.data?.userId);
+						if (res.data?.companyId) {
 							uni.setStorageSync("companyId", res.data.companyId);
 						}
-						if (res.data.userType == 1 || res.data.userType == null) {
+						if (res.data?.userType == 1 || res.data?.userType == null) {
 							
 							this.userType = 1;
 							uni.setStorageSync("userType", 1);
 							
-							if (res.data.isUserVip == 1) {
+							if (res.data?.isUserVip == 1) {
 								//判断用户是否是vip
 								this.isVip = true;
 								uni.setStorageSync("isUserVip", 1);