Sfoglia il codice sorgente

邮箱密码登录

Xiao_123 2 mesi fa
parent
commit
3a0ae20753

+ 2 - 2
api/common.js

@@ -91,9 +91,9 @@ export const shareUserRegister = (data) => {
 }
 
 // 退出登录
-export const logout = () => {
+export const logout = (token) => {
   return request({
-    url: '/app-api/menduner/system/auth/logout',
+    url: `/app-api/menduner/system/recruit/enterprise/auth/logout-token?token=${token}`,
     method: 'POST',
     custom: {
       showLoading: false,

+ 0 - 13
api/content.js

@@ -1,13 +0,0 @@
-import request from "@/utils/request"
-
-// 获取最新的早报资讯
-export const getMorningNewsArticle = () => {
-  return request({
-    url: '/app-api/menduner/system/morning-news/get',
-    method: 'GET',
-    custom: {
-      showLoading: false,
-      auth: false
-    }
-  })
-}

+ 0 - 26
api/personalCenter.js

@@ -1,26 +0,0 @@
-
-import request from "@/utils/request"
-// 同意邀约面试
-export const userInterviewInviteConsent = async (params) => {
-  return request({
-    url: '/app-api/menduner/system/interview-invite/consent',
-    method: 'POST',
-    params,
-    custom: {
-      showLoading: false,
-      auth: false
-    }
-  })
-}
-
-// 拒绝邀约面试
-export const userInterviewInviteReject = async (id) => {
-  return request({
-    url: `/app-api/menduner/system/interview-invite/reject?id=${id}`,
-    method: 'POST',
-    custom: {
-      showLoading: false,
-      auth: false
-    }
-  })
-}

+ 14 - 1
api/user.js

@@ -17,7 +17,7 @@ export const getBaseInfo = (params) => {
 // 获取用户信息
 export const getUserInfo = (params) => {
   return request({
-    url: '/app-api/menduner/system/mde-user/get',
+    url: '/app-api/menduner/system/recruit/user/get',
     method: 'GET',
     params,
     custom: {
@@ -28,6 +28,19 @@ export const getUserInfo = (params) => {
   })
 }
 
+// 获取账户信息
+export const getUserAccountInfo = () => {
+  return request({
+    url: '/app-api/pay/currency/get',
+    method: 'GET',
+    custom: {
+      openEncryption: true,
+      showLoading: false,
+      auth: true
+    }
+  })
+}
+
 // 获取附件列表
 export const getPersonResumeCv = () => {
   return request({

+ 0 - 11
hooks/useModal.js

@@ -9,28 +9,17 @@ const hideBar = () => {
     return
   }
   const currentTabBar = currentPage[0]?.getTabBar?.();
-  // console.log('打开了', currentTabBar)
   currentTabBar?.setData({ show: false });
-  // uni.hideTabBar({
-  //   success: () => {},
-  //   fail: () => {} // 捕获报错,防止没有tabbar页面调用后控制台报错
-  // }) 
 }
 // 显示TabBar
 const showBar = () => {
-  
   // 打开tabBar
   const currentPage = getCurrentPages()
   if (!currentPage) {
     return
   }
   const currentTabBar = currentPage[0]?.getTabBar?.();
-  // console.log('打开了', currentTabBar)
   currentTabBar?.setData({ show: true });
-  // uni.showTabBar({
-  //   success: () => {},
-  //   fail: () => {} // 捕获报错,防止没有tabbar页面调用后控制台报错
-  // }) 
 }
 
 // 打开授权弹框

+ 3 - 3
layout/components/auth-modal.vue

@@ -1,15 +1,15 @@
 <!--  -->
 <template>
   <view v-if="authType !== ''">
-    <ct-popup :show="authType !== 'necessaryInfo'" round="10" :showClose="true" @close="closeAuthModal">
+    <ct-popup :show="authType !== ''" round="10" :showClose="true" @close="closeAuthModal">
       <login></login>
     </ct-popup>
-    <ct-popup :show="authType === 'necessaryInfo'" round="0" :showClose="false" @close="closeAuthModal">
+    <!-- <ct-popup :show="authType === 'necessaryInfo'" round="0" :showClose="false" @close="closeAuthModal">
       <necessaryInfo></necessaryInfo>
     </ct-popup>
     <ct-popup :show="authType === 'selectUserType'" round="0" :showClose="false" @close="closeAuthModal">
       <selectUserType></selectUserType>
-    </ct-popup>
+    </ct-popup> -->
   </view>
 </template>
 

+ 16 - 90
layout/components/authModal/login/index.vue

@@ -2,53 +2,10 @@
   <view class="ss-p-30 head-box">
     <template v-if="changeType === 'login'">
       <view class="head-title ss-m-b-30">欢迎来到门墩儿</view>
-      <uni-segmented-control
-        class="ss-m-t-30"
-        :current="current"
-        :values="items"
-        style-type="text" 
-        active-color="#00B760" 
-        @clickItem="onClickItem"
-      />
-      <!-- <view class="head-subtitle ss-m-t-10">未注册的手机号,验证后自动注册账号</view> -->
 
       <view class="ss-m-t-30">
-        <!-- 手机号快捷登录 -->
-        <view v-if="current === 0">
-          <button v-if="!protocol" class="send-button" @click="showProtocolToast">手机号快捷登录</button>
-          <button v-else class="send-button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">手机号快捷登录</button>
-        </view>
-
-        <!-- 短信验证码登录 -->
-        <uni-forms
-          v-if="current === 1"
-          ref="smsLoginRef"
-          v-model="state.sms"
-          :rules="state.smsRules"
-          validateTrigger="bind"
-          labelWidth="140"
-          labelAlign="center"
-        >
-          <uni-forms-item name="phone" label="手机号">
-            <uni-easyinput placeholder="请输入手机号" v-model="state.sms.phone" :inputBorder="false" type="number">
-              
-            </uni-easyinput>
-          </uni-forms-item>
-
-          <uni-forms-item name="code" label="验证码">
-            <uni-easyinput placeholder="请输入验证码" v-model="state.sms.code" :inputBorder="false" type="number" maxlength="6">
-              <template v-slot:right>
-                <button class="login-code" :disabled="state.isMobileEnd" :class="{ 'code-btn-end': state.isMobileEnd }" @tap="handleCode">
-                  {{ getSmsTimer('smsLogin') }}
-                </button>
-              </template>
-            </uni-easyinput>
-          </uni-forms-item>
-        </uni-forms>
-
-        <!-- 账号密码登录 -->
+        <!-- 企业邮箱+密码登录 -->
         <uni-forms
-          v-if="current === 2"
           ref="accountLoginRef"
           v-model="state.account"
           :rules="state.rules"
@@ -56,23 +13,20 @@
           labelWidth="140"
           labelAlign="center"
         >
-          <uni-forms-item name="phone" label="账号">
-            <uni-easyinput placeholder="请输入账号" v-model="state.account.phone" :inputBorder="false"></uni-easyinput>
+          <uni-forms-item name="phone" label="企业邮箱">
+            <uni-easyinput placeholder="请输入企业邮箱" v-model="state.account.phone" :inputBorder="false"></uni-easyinput>
           </uni-forms-item>
 
-          <uni-forms-item name="password" label="密码">
+          <uni-forms-item name="password" label="登录密码">
             <uni-easyinput type="password" placeholder="请输入密码" v-model="state.account.password" :inputBorder="false"></uni-easyinput>
           </uni-forms-item>
         </uni-forms>
 
         <view class="quickLogon">
-          <view>
-            <!-- <button v-if="!protocol" class="wxLogon" type="text" :plain="true" @click="showProtocolToast">微信一键登录</button>
-            <button v-else class="wxLogon" type="text" :plain="true" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">微信一键登录</button> -->
-          </view>
+          <view></view>
           <view class="register" @tap="handleChangeRegister">还没有登录账户?去注册</view>
         </view>
-        <button v-if="current !== 0" class="send-button" @tap="handleLogin"> 登 录  </button>
+        <button class="send-button" @tap="handleLogin"> 登 录  </button>
         <view class="agreement-box ss-flex ss-row-center" style="margin-bottom: 30px;">
           <uni-icons size="20" :type="protocol ? 'checkbox-filled' : 'circle'" :color="protocol ? '#00B760' : '#ccc'" @tap="protocol = !protocol"></uni-icons>
           <view class="color-999 ss-flex ss-col-center ss-m-l-8 font-size-13">
@@ -88,6 +42,7 @@
         </view>
       </view>
     </template>
+
     <template v-if="changeType === 'register'">
       <view class="head-title pb-20">手机号注册</view>
 
@@ -146,12 +101,11 @@
 
 <script setup>
 import { ref, unref } from 'vue'
-import { mobile, password, code } from '@/utils/validate'
+import { mobile, password, code, emailRequired } from '@/utils/validate'
 import { getSmsCode, getSmsTimer } from '@/utils/code'
 import { userStore } from '@/store/user'
 
 const useUserStore = userStore()
-const items = ['手机号快捷登录', '短信登录', '账号登录']
 const current = ref(0)
 const accountLoginRef = ref()
 const smsLoginRef = ref()
@@ -169,11 +123,11 @@ const state = ref({
     code: ''
   },
   account: {
-    phone: '',
-    password: ''
+    phone: '1687284007@qq.com',
+    password: 'Citu123456'
   },
   rules: {
-    phone: mobile,
+    phone: emailRequired,
     password,
   },
   smsRules: {
@@ -185,15 +139,12 @@ const state = ref({
 
 // 设置默认账号密码便于开发快捷登录
 if (window && window.location && window.location.hostname && window.location.hostname === 'localhost') {
-  state.value.account.phone = '13229740092'
+  state.value.account.phone = '1687284007@qq.com'
   state.value.account.password = 'Citu123456'
 }
 
 const changeType = ref('login')
 
-// 登录成功后的返回页面
-// const backUrl = getCurrentPages().length ? getCurrentPages()[getCurrentPages().length - 2].route : ''
-
 const onClickItem = (e) => {
   current.value = e.currentIndex
 }
@@ -241,31 +192,6 @@ function handleChangeLogin () {
   changeType.value = 'login'
 }
 
-const showProtocolToast = () => {
-  uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
-}
-
-// 微信登录
-const getPhoneNumber = async (e) => {
-  if (e?.detail?.errMsg !== 'getPhoneNumber:ok') {
-    uni.showToast({ title: '微信登录失败', icon: 'none' })
-    return
-  }
-  changeType.value = 'login'
-  wx.login({
-    success: async (result) => {
-      const wxLoginCode = result?.code || ''
-      const query = {
-        loginCode: wxLoginCode,
-        phoneCode: e.detail.code,
-        state: e.detail.encryptedData,
-      }
-      await useUserStore.handleSmsLogin(query, current.value)
-    },
-    fail:(res)=> { console.log("获取登录凭证code失败!", res) }
-  })
-}
-
 async function handleRegister () {
   const validate = await unref(registerForm).validate()
   if (!validate) return
@@ -280,14 +206,14 @@ async function handleRegister () {
 // 登录
 const handleLogin = async () => {
   if (!protocol.value) return uni.showToast({ title: '请先阅读并同意用户协议和隐私政策', icon: 'none' })
-  const validate = await unref(current.value === 1 ? smsLoginRef : accountLoginRef).validate()
+  const validate = await unref(accountLoginRef).validate()
   if (!validate) return
-  const query = current.value === 1 ? state.value.sms : state.value.account
+  const query = state.value.account
   Object.assign(query, {
     account: query.phone
   })
-  
-  await useUserStore.handleSmsLogin(query, current.value)
+  console.log(query, '登录参数')
+  await useUserStore.handleSmsLogin(query, 1)
 }
 </script>
 

+ 1 - 4
pages.json

@@ -3,10 +3,7 @@
 		{
 			"path": "pages/index/resume",
 			"style": {
-				"navigationBarTitleText": "门墩儿",
-				"enablePullDownRefresh": true,
-				"backgroundColorBottom":"#f4f4f5",
-				"navigationStyle": "custom" 
+				"navigationBarTitleText": "简历"
 			}
 		},
 		{

+ 40 - 156
pages/index/my.vue

@@ -1,26 +1,22 @@
 <template>
   <layout-page>
 		<view class="pb-150">
-			<view class="text-center" :class="vip ? 'vipBox' : 'avatarBox'" @tap="handleTap">
-				<img :src="getUserAvatar(baseInfo?.avatar, baseInfo?.sex)" alt="" class="img-box">
-				<image v-if="vip" src="/static/svg/vip.svg" class="vipIcon" @click.stop="handleToLink({path: '/pagesA/vip/index'})"></image>
+			<view class="text-center ss-p-b-30" :class="vip ? 'vipBox' : 'avatarBox'" @tap="handleTap">
+				<img :src="getUserAvatar(userInfo?.avatar, userInfo?.sex)" alt="" class="img-box">
+				<image v-if="vip" src="/static/svg/vip.svg" class="vipIcon"></image>
 				<view v-if="!useUserStore.isLogin" class="font-weight-bold font-size-20">点击登录</view>
-				<view v-else class="font-weight-bold font-size-20">{{ baseInfo?.name || userInfo?.phone }}</view>
-			</view>
-
-			<view style="padding: 40rpx 0 0 0;">
-				<resume-status></resume-status>
-			</view>
-			
-			<view class="d-flex">
-				<view v-for="(item, index) in itemList" :key="index" @tap="handleToLink(item)" class="parent">
-					<view class="d-flex justify-space-around align-center">
-						<uni-icons color="#00B760" :type="item.icon" size="30"/>
-						<text class="itemText">{{ item.title }}</text>
+				<view v-else>
+					<view>
+						<span class="font-weight-bold font-size-20">{{ userInfo?.name || userInfo?.phone }}</span>
+						<uni-icons @tap="handleEdit('')" class="ss-m-l-10" type="compose" :size="22"></uni-icons>
+					</view>
+					<view style="color: #0E100F" class="ss-m-t-20">
+						<span>{{ formatName(userInfo?.enterpriseAnotherName || userInfo?.enterpriseName) }}</span>
+						<uni-icons @tap="handleEdit('')" class="ss-m-l-10" type="compose" :size="22"></uni-icons>
 					</view>
 				</view>
 			</view>
-	
+
 			<view style="height: 20rpx; background-color: #f8f8fa;"></view>
 	
 			<view class="card">
@@ -44,21 +40,6 @@
 				<uni-popup-dialog type="warn" cancelText="取消" confirmText="确定" title="系统提示" content="确认退出账号?" @confirm="handleLogoutConfirm"
 					@close="handleLogoutClose"></uni-popup-dialog>
 			</uni-popup>
-			<!-- 我的分享码 -->
-			<uni-popup ref="shareQrCodePopup" type="dialog">
-				<view class="shareQrCodePopupContent">
-					<view class="color-primary text">邀请用户注册领50积分</view>
-					<view class="qrCode">
-						<image
-            	v-if="!!shareUrl"
-							:src="shareUrl"
-							:show-menu-by-longpress="true"
-							style="width: 200px;height: 200px; padding: 20rpx;"
-						></image>
-					</view>
-					<view v-if="shareUrl" class="saveImg">长按二维码保存图片</view>
-				</view>
-			</uni-popup>
 
 			<uni-popup ref="inputDialog" type="dialog">
 				<view class="shareQrCodePopupContent">
@@ -72,14 +53,14 @@
 
 <script setup>
 import { ref, computed, watch } from 'vue'
-import ResumeStatus from '@/components/ResumeStatus'
 import { userStore } from '@/store/user'
 import { getUserAvatar } from '@/utils/avatar'
-import { getAccessToken, showNecessaryInfoPopup } from '@/utils/request'
+import { getAccessToken } from '@/utils/request'
 import layoutPage from '@/layout'
+import { formatName } from '@/utils/getText'
 import { showAuthModal } from '@/hooks/useModal'
 import { onShow, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
-import { getJobAdvertisedShareQrcode } from '@/api/user'
+
 // 设置自定义tabbar选中值
 onShow(() => {
     const currentPage = getCurrentPages()[0];  // 获取当前页面实例
@@ -89,61 +70,27 @@ onShow(() => {
     currentTabBar?.setData({ selected: 3 });
 })
 
-// showAuthModal('') //测试 selectUserType
-
 const inputDialog = ref()
 const useUserStore = userStore()
-const baseInfo = computed(() => useUserStore?.baseInfo)
 const userInfo = computed(() => useUserStore?.userInfo)
+
 const vip = computed(() => new Date().getTime() < useUserStore?.userInfo?.vipExpireDate)
 
 const popup = ref()
-const shareQrCodePopup = ref()
-const itemList = [
-	{ title: "我的关注", path: "/pagesA/collect/index", icon: "list" },
-	{ title:'关注我的', path:'/pagesA/seenMe/index', icon:'staff' }
-]
 
 const defaultList = [
-	{	title: '在线简历',	path: '/pagesA/resumeOnline/index'	},					
-	{	title: '附件简历',	path: '/pagesA/resume/index'	},					
-	{ title: '学生专区', path: '/pagesA/student/index', key: 'student', defaultHide: true },
-	{ title: '面试管理', path: '/pagesA/interview/index' },
-	{	title: '会员套餐', path: '/pagesA/vipPackage/index'	},		
-	{	title: '我的分享码',	path: '/pagesB/sharePoster/index'	},					
-	{	title: '新用户邀请记录',	path: '/pagesB/inviteRecord/index'	},
-	{ title: '门墩儿商城', appId: 'wx6decdf12f9e7a061' },
-	{ title: '我要招聘', key: 'recruit' },
+	// {	title: '在线简历',	path: '/pagesA/resumeOnline/index'	},					
+	// {	title: '附件简历',	path: '/pagesA/resume/index'	},					
+	// { title: '学生专区', path: '/pagesA/student/index', key: 'student', defaultHide: true },
+	// { title: '面试管理', path: '/pagesA/interview/index' },
+	// {	title: '会员套餐', path: '/pagesA/vipPackage/index'	},		
+	{ title: '门墩儿商城', showDialog: true }, // wx6decdf12f9e7a061
 	{ title: '联系我们', path: '/pagesB/contactUs/index' },
-	{ title: '协议中心', path: '/pagesB/agreement/index', open: true }
+	{ title: '协议中心', path: '/pagesB/agreement/index', open: true },
+	{ title: '我要求职', appId: 'wx5dd538ccc752b03a' },
 ]
 const list = ref(defaultList.filter(e => !e.defaultHide))
 
-watch(
-  () => baseInfo.value, 
-  (newVal) => {
-		if (newVal) {
-			list.value = defaultList.map(e => { // 不改变原数组,退出登录需要重置菜单
-				let hide = e.defaultHide
-				if (e?.key === 'student' && newVal.type === '1') hide = false // 学生信息管理。 type:0是求职者,1是学生
-				return hide ? null : e
-			}).filter(Boolean)
-		}
-  },
-  { immediate: true },
-  // { deep: true }
-)
-
-watch(
-  () => vip.value, 
-  (newVal) => {
-		if (newVal) list.value.splice(3, 0, {	title: 'vip权益', key: 'vip',	path: '/pagesA/vip/index'	})
-		else list.value = list.value.filter(e => !e.key || e.key !== 'vip')
-  },
-  { immediate: true },
-  // { deep: true }
-)
-
 onLoad(() => {
   wx.showShareMenu({
     withShareTicket: true,
@@ -165,43 +112,20 @@ onLoad(() => {
   })
 })
 
-const openSubscribe = (path) => {
-  wx.requestSubscribeMessage({
-    tmplIds: ['2dByiI4wf6D3ZmxDH1QywH264F3N-9ysnvsS7xQm4PE'],
-    success:(res)=>{
-      console.log(res, 'uni.requestSubscribeMessage-res')
-			uni.navigateTo({
-				url: path
-			})
-    },
-    fail:(err)=>{
-      console.log('订阅失败', err)
-			uni.navigateTo({
-				url: path
-			})
-    }
-  })
-}
-
 // 列表跳转
 const dialogType = ref('')
 const handleToLink = (item) => {
 	if (item.open && item.path) return uni.navigateTo({ url: item.path })
 	if (item.appId) {
-		// uni.navigateToMiniProgram({
-		// 	appId: item.appId,
-		// })
-		// return
-		// uni.showToast({
-		// 	title: '请前往网页版门墩儿商城',
-		// 	icon: 'none'
-		// })
-		dialogType.value = 0
-		inputDialog.value.open()
+		uni.navigateToMiniProgram({
+			appId: item.appId,
+		})
+		return
 	}
-	if (item.key === 'recruit') {
-		dialogType.value = 1
+	if (item?.showDialog) {
+		dialogType.value = 0
 		inputDialog.value.open()
+		return
 	}
 	if (!item.path) return
   if (!getAccessToken()) {
@@ -212,59 +136,19 @@ const handleToLink = (item) => {
 		showAuthModal()
 		return
 	}
-  if (showNecessaryInfoPopup()) {
-		uni.showToast({
-			title: '请先完善基本信息',
-			icon: 'none'
-		})
-		showAuthModal('necessaryInfo')
-		return
-	}
-  if (item.path === 'shareQrCode') {
-		handleShareCode()
-		return
-	}
-	// 点击在线简历需调起订阅消息
-	if (item.title === '在线简历'){
-		openSubscribe(item.path)
-		return
-	}
 	uni.navigateTo({
 		url: item.path
 	})
 }
 
-const shareUrl = ref()
-// 生成分享二维码
-const handleShareCode = async () => {
-	const userId = useUserStore?.accountInfo?.userId || ''
-	if (!userId) {
-		uni.showToast({
-			title: '请先登录',
-			icon: 'none'
-		})
-		showAuthModal()
-		return
-	}
-  if (showNecessaryInfoPopup()) {
-		uni.showToast({
-			title: '请先完善基本信息',
-			icon: 'none'
-		})
-		showAuthModal('necessaryInfo')
-		return
-	}
-	const query = {
-		scene: 'shareId=' + userId,
-		path: 'pages/login/index',
-		width: 200,
-		autoColor: false,
-		checkPath: true,
-		hyaline: true
-	}
-	const res = await getJobAdvertisedShareQrcode(query)
-	shareUrl.value = res?.data ? 'data:image/png;base64,' + res.data : ''
-	shareQrCodePopup.value.open()
+const handleEdit = (url) => {
+	// if (!useUserStore.isLogin) {
+	// 	showAuthModal()
+	// 	return
+	// }
+	// uni.navigateTo({
+	// 	url
+	// })
 }
 
 // 登录
@@ -311,7 +195,7 @@ const handleLogoutConfirm = () => {
 		position: absolute;
 		width: 45px;
 		height: 24px;
-		bottom: 34px;
+		top: 60px;
 		left: 50%;
 	}
 }

+ 0 - 1
pagesA/chart/index.vue

@@ -254,7 +254,6 @@ import { preview } from '@/utils/preview'
 import { getPersonResumeCv, saveResume } from '@/api/user'
 import { uploadFile } from '@/api/file'
 import { getInterviewInviteListByInviteUserId, getMessageType } from '@/api/common'
-// import { userInterviewInviteReject } from '@/api/personalCenter'
 import {
   getJobAdvertisedSearch,
   jobCvRelSend,

+ 2 - 1
project.config.json

@@ -13,7 +13,8 @@
       "disablePlugins": [],
       "outputPath": ""
     },
-    "ignoreUploadUnusedFiles": true
+    "ignoreUploadUnusedFiles": false,
+    "ignoreDevUnusedFiles": false
   },
   "condition": {},
   "editorSetting": {

BIN
static/img/company-fill.png


BIN
static/img/company.png


BIN
static/img/contact.png


BIN
static/img/enterprise.png


BIN
static/img/my-fill.png


BIN
static/img/my.png


BIN
static/img/pin-fill.png


BIN
static/img/pin.png


BIN
static/img/resume-fill.png


BIN
static/img/resume.png


+ 16 - 69
store/user.js

@@ -1,11 +1,9 @@
 import { defineStore } from 'pinia';
-import { getBaseInfo, getUserInfo } from '@/api/user';
+import { getBaseInfo, getUserInfo, getUserAccountInfo } from '@/api/user';
 import { smsLogin, passwordLogin, weChatLogin, logout, userRegister, shareUserRegister } from '@/api/common'
 import { closeAuthModal, showAuthModal } from '@/hooks/useModal'
 import { timesTampChange } from '@/utils/date'
 import { getBaseInfoDictOfName } from '@/utils/getText'
-import { updateEventList } from '@/utils/eventList'
-import { checkPersonBaseInfo } from '@/utils/check'
 
 // 默认用户信息
 const defaultBaseInfo = {
@@ -25,11 +23,6 @@ const defaultAccountInfo = {
   userId: ''
 }
 
-const tabUrl = [
-  'pages/index/position',
-  'pages/index/communicate',
-  'pages/index/my'
-]
 export const userStore = defineStore('user', {
   state: () => {
     const userLocal = uni.getStorageSync('user')
@@ -43,6 +36,7 @@ export const userStore = defineStore('user', {
       refreshToken: uni.getStorageSync('refresh-token'), // 用户切换
       lastUpdateTime: 0, // 上次更新时间
       accountInfo: { ...defaultAccountInfo }, // 账号信息
+      userAccountInfo: userInfo.userAccountInfo ?? {}, // 账户信息
     }
   },
 
@@ -53,7 +47,7 @@ export const userStore = defineStore('user', {
     // 登录
     async handleSmsLogin (query, index = 0) {
       this.phone = query.phone
-      const apiList = [weChatLogin, smsLogin, passwordLogin] 
+      const apiList = [smsLogin, passwordLogin] 
       const { data, code } = await apiList[index](query)
       if (code === 0) {
         uni.showToast({
@@ -61,9 +55,9 @@ export const userStore = defineStore('user', {
         })
       }
       this.accountInfo = data
-      const res = await this.getInfo()
-      this.getUserInfo()
-      return Promise.resolve(res);
+      this.getUserInfos()
+      this.getAccountInfo()
+      closeAuthModal()
     },
 
     async handleRegister (query) {
@@ -76,66 +70,25 @@ export const userStore = defineStore('user', {
       }
       this.accountInfo = data
       const res = await this.getInfo()
-      this.getUserInfo()
+      this.getUserInfos()
       return Promise.resolve(res);
     },
-    // 扫码注册登录
-    async handleShareUserRegister (query) {
-      try {
-        this.phone = query.phone
-        const { data, code } = await shareUserRegister(query)
-        if (code === 0) {
-          uni.showToast({
-            title: '登录成功'
-          })
-          this.accountInfo = data
-          await this.getInfo()
-          this.getUserInfo()
-        }
-        return Promise.resolve(data);
-      } catch (err) {
-        uni.showToast({
-          icon: 'none',
-          title: err.msg
-        })
-      }
-    },
-
-    // 校验是否完善人才必填信息
-    checkPersonBaseInfoFun(data) {
-      data = data || {}
-      // 待门墩儿测试后开放
-      // if (!data || !Object.keys(data).length || data.type === undefined || data.type === null) {
-      //   showAuthModal('selectUserType')
-      //   return
-      // }
-      const necessaryInfoReady = checkPersonBaseInfo(data)
-      data.necessaryInfoReady = necessaryInfoReady
-      if (necessaryInfoReady) closeAuthModal()
-      else showAuthModal('necessaryInfo')
-      uni.setStorageSync('necessaryInfoReady', necessaryInfoReady ? 'ready' : 'fddeaddc47868b');
-    },
-
-    // 获取人才信息
-    async getInfo() {
-      const { code, data } = await getBaseInfo({ userId: this.accountInfo.userId });
-      updateEventList() // 更新事件列表
-      await this.checkPersonBaseInfoFun(data) // 校验是否完善人才必填信息
+    // 获取用户信息
+    async getUserInfos() {
+      const { code, data } = await getUserInfo();
       if (code !== 0) {
         return;
       }
-      if (!data) return
-      const _data = await this.getFieldText(data)
-      this.baseInfo = _data
+      this.userInfo = data;
       return Promise.resolve(data);
     },
-    // 获取户信息
-    async getUserInfo() {
-      const { code, data } = await getUserInfo({ id: this.accountInfo.userId });
+    // 获取账户信息
+    async getAccountInfo () {
+      const { code, data } = await getUserAccountInfo();
       if (code !== 0) {
         return;
       }
-      this.userInfo = data;
+      this.userAccountInfo = data;
       return Promise.resolve(data);
     },
     // 设置 token
@@ -189,7 +142,7 @@ export const userStore = defineStore('user', {
 
     // 登出系统
     async handleLogout() {
-      await logout()
+      await logout(uni.getStorageSync('token'))
       this.resetUserData();
       return !this.isLogin;
     },
@@ -228,12 +181,6 @@ export const userStore = defineStore('user', {
     }
   },
   persist: {
-    // enabled: true,
-    // strategies: [
-    //   {
-    //     key: 'user-store'
-    //   }
-    // ]
     storage: {
       setItem(key, value) {
         uni.setStorageSync(key, value)