lyuis преди 7 месеца
родител
ревизия
76a5867fd8
променени са 4 файла, в които са добавени 99 реда и са изтрити 20 реда
  1. 10 0
      common/queue.js
  2. 1 2
      manifest.json
  3. 0 16
      pages/public/login.vue
  4. 88 2
      pages/public/register.vue

+ 10 - 0
common/queue.js

@@ -37,6 +37,16 @@ module.exports = {
 		this.remove("userType");
 		this.remove("member");
 		this.remove('companyId')
+		this.remove('avatar')
+		this.remove('age')
+		this.remove('companyName')
+		this.remove('companyStatus')
+		this.remove('isVip')
+		this.remove('vipMsgNum')
+		this.remove('vipMsgPrice')
+		this.remove('vipDueTimes')
+		this.remove('msgNum')
+		this.remove('msgPrice')
 	},
 	loginClear() {
 		this.remove("token");

+ 1 - 2
manifest.json

@@ -99,8 +99,7 @@
                         "appsecret" : "30d3fd06ab473f07b0a4b45e1048b5cb",
                         "UniversalLinks" : "https://h5.bosszan.com/appleauth/"
                     },
-                    "apple" : {},
-                    "univerify" : {}
+                    "apple" : {}
                 },
                 "ad" : {},
                 "maps" : {

+ 0 - 16
pages/public/login.vue

@@ -103,7 +103,6 @@
 				phoneNum: false,
 				isopen: false,
 				isAndroid:false,
-				oneLogin:false
 			};
 		},
 		onLoad(e) {
@@ -151,21 +150,6 @@
 			}
 			this.selbindwx();
 			// #endif
-			var that=this
-			/* // #ifdef APP-PLUS
-			uni.preLogin({
-				provider: 'univerify',
-				success(){  //预登录成功
-					that.oneLogin=true
-					// 显示一键登录选项
-				},
-				fail(res){  // 预登录失败
-					// 不显示一键登录选项(或置灰)
-			    // 根据错误信息判断失败原因,如有需要可将错误提交给统计服务器
-					console.log(res.errMsg)
-				}
-			})
-			// #endif */
 		},
 		methods: {
 			selbindwx() {

+ 88 - 2
pages/public/register.vue

@@ -323,6 +323,7 @@ export default {
           })
           .then((res) => {
             if (res.code === 0) {
+				return this.dealUserData(res)
               this.$queue.showToast("注册成功");
 
               this.$queue.setData("token", res.token);
@@ -417,11 +418,12 @@ export default {
           this.userName = res.data.userName;
           this.invitationCode = res.data.invitationCode;
           uni.setStorageSync("invitationCode", res.data.invitationCode);
-          setTimeout(function () {
+          /* setTimeout(function () {
             uni.reLaunch({
               url: "/pages/my/jobApplicant/registerSuccess",//pages/my/jobApplicant/registerSuccess
             });
-          }, 1000);
+          }, 1000); */
+		  
 		  return
         } else {
           uni.showModal({
@@ -433,6 +435,90 @@ export default {
         }
       });
     },
+	dealUserData(res){
+		this.$queue.setData("userId", res.user.userId);
+		this.$queue.setData("token", res.token);
+		this.$queue.setData("phone", res.user.phone);
+		this.$queue.setData("userName", res.user.userName);
+		this.$queue.setData("avatar", res.user.avatar);
+		if(res.user.invitationCode)
+		this.$queue.setData("invitationCode", res.user.invitationCode);
+		if(res.user.inviterCode)
+		this.$queue.setData("inviterCode", res.user.inviterCode);
+		this.$queue.setData("isVip", false);
+		uni.hideLoading();
+		if(res.user.userType)
+		this.$queue.setData("userType", res.user.userType);
+		this.$queue.connectSocket()
+		//判断是否开启身份选择 是/否
+		this.$Request.get("/app/common/type/339").then((rest) => {
+			if (rest.code == 0) {
+				if (rest.data.value == "是") {
+					// 这里是跳转到选择职场身份的界面
+					uni.reLaunch({
+						url: "/pages/public/selectIdentity/selectIdentity",
+					});
+				} else {
+					if (res.user.userType == 2) { //企业
+						// 原有的。判断第一次根据userType  ==null
+						uni.reLaunch({
+							url: "/pages/my/index",
+						});
+						// 这里判断一下看是否是第一次登录如果是就跳到引导页,如果不是就正常跳
+						// let firstLogin = uni.getStorageSync("firstLogin") || false;
+						// if (!firstLogin) {
+						//   uni.navigateTo({
+						//     url: "/pages/my/jobApplicant/guidePage",
+						//   });
+						// } else {
+						//   uni.reLaunch({
+						//     url: "/pages/my/index",
+						//   });
+						// }
+					} else if (res.user.userType == 1) {
+						uni.reLaunch({
+							url: "/pages/my/index",
+						});
+						// 这里判断一下看是否是第一次登录如果是就跳到引导页,如果不是就正常跳
+						// let firstLogin = uni.getStorageSync("firstLogin") || false;
+						// if (!firstLogin) {
+						//   uni.navigateTo({
+						//     url: "/pages/my/jobApplicant/guidePage",
+						//   });
+						// } else {
+						//   uni.reLaunch({
+						//     url: "/pages/my/index",
+						//   });
+						// }
+					} else {
+						//表示是第一次进来,走引导页
+						uni.navigateTo({
+							url: "/pages/my/jobApplicant/guidePage",
+						});
+					}
+				}
+			} else {
+		
+				if (res.user.userType == 2) { //企业
+					// 原有的。判断第一次根据userType  ==null
+					uni.reLaunch({
+						url: "/pages/my/index",
+					});
+		
+				} else if (res.user.userType == 1) {
+					uni.reLaunch({
+						url: "/pages/my/index",
+					});
+		
+				} else {
+					//表示是第一次进来,走引导页
+					uni.navigateTo({
+						url: "/pages/my/jobApplicant/guidePage",
+					});
+				}
+			}
+		});
+	}
   },
 };
 </script>