fix: 功能优化完善。

This commit is contained in:
tianyongbao
2026-07-12 14:23:18 +08:00
parent cc1ccad308
commit 88cf663855
4 changed files with 79 additions and 9 deletions

View File

@@ -259,6 +259,8 @@
</div>
</div>
</view>
<!-- 悬停按钮返回工作台-->
<refresh></refresh>
</template>
<script setup>
import { ref, onMounted } from 'vue';

View File

@@ -1,5 +1,12 @@
<template>
<view class="login-container">
<view v-if="checkingToken" class="token-transition-screen">
<view class="token-loading-card">
<view class="token-loading-spinner"></view>
<text class="token-loading-text">正在加载中...</text>
</view>
</view>
<view v-else class="login-container">
<!-- Logo和标题区域 -->
<view class="header-section">
<view class="logo-box">
@@ -9,8 +16,8 @@
<text class="app-subtitle">专业的健康管理工具</text>
</view>
<!-- 登录表单卡片token 静默校验期间不展示任何提示 -->
<view v-if="!checkingToken" class="form-card">
<!-- 登录表单卡片 -->
<view class="form-card">
<!-- 账号输入 -->
<view class="input-item">
<uni-icons type="person" size="20" color="#E8841A"></uni-icons>
@@ -69,7 +76,7 @@
<!-- 版权信息 -->
<view class="copyright">
<text>Copyright © 2026 qdintc All Rights Reserved.</text>
<text>Copyright © {{ currentYear }} qdintc All Rights Reserved.</text>
</view>
</view>
</template>
@@ -85,6 +92,9 @@ import { wxLogin } from '@/api/oauth';
import { getToken, setToken } from '@/utils/auth';
import { encrypt, decrypt } from '@/utils/jsencrypt'
// 动态显示当前年份
const currentYear = new Date().getFullYear()
// ========== 平台判断(条件编译)==========
// H5 端为 true其他端为 false。条件编译保证仅 H5 打包对应逻辑
let isH5 = false
@@ -129,15 +139,20 @@ async function initLoginPage() {
const token = getToken()
if (token) {
checkingToken.value = true
let tokenValid = false
try {
await userStore.getInfo(true)
goHome()
return
tokenValid = true
} catch (error) {
if (error && error.code === 401) {
userStore.resetToken()
}
}
if (tokenValid) {
goHome()
return
}
}
checkingToken.value = false
@@ -286,6 +301,55 @@ page {
padding: 0 48rpx;
}
.token-transition-screen {
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(160deg, #FFF3D6 0%, #FFE0A0 60%, #FFCC6E 100%);
}
.token-loading-card {
min-width: 220rpx;
min-height: 180rpx;
padding: 40rpx 48rpx;
border-radius: 32rpx;
background: rgba(255, 255, 255, 0.72);
border: 1rpx solid rgba(255, 255, 255, 0.7);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-shadow: 0 16rpx 48rpx rgba(139, 69, 0, 0.14);
}
.token-loading-spinner {
width: 58rpx;
height: 58rpx;
border-radius: 50%;
border: 6rpx solid rgba(232, 132, 26, 0.2);
border-top-color: #E8841A;
animation: token-loading-spin 0.8s linear infinite;
margin-bottom: 24rpx;
}
.token-loading-text {
font-size: 28rpx;
color: #8B4500;
font-weight: 500;
}
@keyframes token-loading-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.header-section {
padding-top: 120rpx;
display: flex;

View File

@@ -59,7 +59,7 @@
</view>
<view class="footer-section">
<text class="copyright-text">Copyright © 2026 qdintc All Rights Reserved.</text>
<text class="copyright-text">Copyright © {{ currentYear }} qdintc All Rights Reserved.</text>
</view>
<u-toast ref="uToast"></u-toast>
@@ -72,6 +72,8 @@
export default {
data() {
return {
// 动态显示当前年份
currentYear: new Date().getFullYear(),
user: {
username: '',
password: '',

View File

@@ -2,7 +2,7 @@
<view class="about-container">
<view class="header-section">
<view class="logo-wrapper">
<image class="logo-image" src="/static/logo.png" mode="aspectFit"></image>
<image class="logo-image" src="/static/logo1.png" mode="aspectFit"></image>
<view class="logo-shine"></view>
</view>
<text class="app-name">智聪网络科技</text>
@@ -25,7 +25,7 @@
</view>
<view class="copyright">
<text class="copyright-text">Copyright &copy; 2026 qdintc</text>
<text class="copyright-text">Copyright &copy; {{ currentYear }} qdintc</text>
<text class="copyright-text">All Rights Reserved.</text>
</view>
</view>
@@ -37,6 +37,8 @@ import config from '@/config.js'
const url = config.appInfo.site_url
const version = config.appInfo.version
// 动态显示当前年份
const currentYear = new Date().getFullYear()
const infoList = computed(() => [
{