fix: 功能优化完善。
This commit is contained in:
@@ -259,6 +259,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 悬停按钮返回工作台-->
|
||||||
|
<refresh></refresh>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
<template>
|
<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和标题区域 -->
|
<!-- Logo和标题区域 -->
|
||||||
<view class="header-section">
|
<view class="header-section">
|
||||||
<view class="logo-box">
|
<view class="logo-box">
|
||||||
@@ -9,8 +16,8 @@
|
|||||||
<text class="app-subtitle">专业的健康管理工具</text>
|
<text class="app-subtitle">专业的健康管理工具</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 登录表单卡片:token 静默校验期间不展示任何提示 -->
|
<!-- 登录表单卡片 -->
|
||||||
<view v-if="!checkingToken" class="form-card">
|
<view class="form-card">
|
||||||
<!-- 账号输入 -->
|
<!-- 账号输入 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<uni-icons type="person" size="20" color="#E8841A"></uni-icons>
|
<uni-icons type="person" size="20" color="#E8841A"></uni-icons>
|
||||||
@@ -69,7 +76,7 @@
|
|||||||
|
|
||||||
<!-- 版权信息 -->
|
<!-- 版权信息 -->
|
||||||
<view class="copyright">
|
<view class="copyright">
|
||||||
<text>Copyright © 2026 qdintc All Rights Reserved.</text>
|
<text>Copyright © {{ currentYear }} qdintc All Rights Reserved.</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -85,6 +92,9 @@ import { wxLogin } from '@/api/oauth';
|
|||||||
import { getToken, setToken } from '@/utils/auth';
|
import { getToken, setToken } from '@/utils/auth';
|
||||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||||
|
|
||||||
|
// 动态显示当前年份
|
||||||
|
const currentYear = new Date().getFullYear()
|
||||||
|
|
||||||
// ========== 平台判断(条件编译)==========
|
// ========== 平台判断(条件编译)==========
|
||||||
// H5 端为 true,其他端为 false。条件编译保证仅 H5 打包对应逻辑
|
// H5 端为 true,其他端为 false。条件编译保证仅 H5 打包对应逻辑
|
||||||
let isH5 = false
|
let isH5 = false
|
||||||
@@ -129,15 +139,20 @@ async function initLoginPage() {
|
|||||||
const token = getToken()
|
const token = getToken()
|
||||||
if (token) {
|
if (token) {
|
||||||
checkingToken.value = true
|
checkingToken.value = true
|
||||||
|
let tokenValid = false
|
||||||
try {
|
try {
|
||||||
await userStore.getInfo(true)
|
await userStore.getInfo(true)
|
||||||
goHome()
|
tokenValid = true
|
||||||
return
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error && error.code === 401) {
|
if (error && error.code === 401) {
|
||||||
userStore.resetToken()
|
userStore.resetToken()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tokenValid) {
|
||||||
|
goHome()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkingToken.value = false
|
checkingToken.value = false
|
||||||
@@ -286,6 +301,55 @@ page {
|
|||||||
padding: 0 48rpx;
|
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 {
|
.header-section {
|
||||||
padding-top: 120rpx;
|
padding-top: 120rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="footer-section">
|
<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>
|
</view>
|
||||||
|
|
||||||
<u-toast ref="uToast"></u-toast>
|
<u-toast ref="uToast"></u-toast>
|
||||||
@@ -72,6 +72,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// 动态显示当前年份
|
||||||
|
currentYear: new Date().getFullYear(),
|
||||||
user: {
|
user: {
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="about-container">
|
<view class="about-container">
|
||||||
<view class="header-section">
|
<view class="header-section">
|
||||||
<view class="logo-wrapper">
|
<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 class="logo-shine"></view>
|
||||||
</view>
|
</view>
|
||||||
<text class="app-name">智聪网络科技</text>
|
<text class="app-name">智聪网络科技</text>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="copyright">
|
<view class="copyright">
|
||||||
<text class="copyright-text">Copyright © 2026 qdintc</text>
|
<text class="copyright-text">Copyright © {{ currentYear }} qdintc</text>
|
||||||
<text class="copyright-text">All Rights Reserved.</text>
|
<text class="copyright-text">All Rights Reserved.</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -37,6 +37,8 @@ import config from '@/config.js'
|
|||||||
|
|
||||||
const url = config.appInfo.site_url
|
const url = config.appInfo.site_url
|
||||||
const version = config.appInfo.version
|
const version = config.appInfo.version
|
||||||
|
// 动态显示当前年份
|
||||||
|
const currentYear = new Date().getFullYear()
|
||||||
|
|
||||||
const infoList = computed(() => [
|
const infoList = computed(() => [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user