浏览代码

fix: 修改密码登录状态下无需提示登录文案

liangan 2 周之前
父节点
当前提交
ae2b97789d
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/pages/forgotPassword/forgotPassword.vue

+ 7 - 2
src/pages/forgotPassword/forgotPassword.vue

@@ -10,12 +10,17 @@
 <script lang="ts" setup>
 import { getCode, updateUserPassword } from '@/api/login'
 import { t } from '@/locale'
+import { useUserStore } from '@/store'
 import { goBack as goBackUtil, toPage } from '@/utils/page'
 import { toast } from '@/utils/toast'
 
 defineOptions({
   name: 'ForgotPassword', // 忘记密码
 })
+const isLogined = computed(() => {
+  const userStore = useUserStore()
+  return !!userStore.token
+})
 
 // 获取屏幕边界到安全区域距离
 const systemInfo = uni.getSystemInfoSync()
@@ -202,7 +207,7 @@ onUnmounted(() => {
 </script>
 
 <template>
-  <view class="forgot-password-page min-h-screen bg-white">
+  <view class="forgot-password-page relative min-h-screen bg-white">
     <!-- 背景图片区域 -->
     <view class="auth-bg-section relative">
       <!-- 自定义导航栏 -->
@@ -324,7 +329,7 @@ onUnmounted(() => {
       </view>
 
       <!-- 登录提示 -->
-      <view class="fixed bottom-20rpx left-0 w-full text-center" :style="{ paddingBottom: `${safeAreaInsets?.bottom + 40}px` }">
+      <view v-if="!isLogined" class="absolute bottom-20rpx left-0 w-full text-center" :style="{ bottom: `${safeAreaInsets?.bottom + 20}px` }">
         <text class="text-28rpx text-#5C5C5C">
           {{ $t('auth.forgotPassword.hasAccount') }}
         </text>