批量优化
This commit is contained in:
1 parent
e3db229f41
commit
aa92ca40a2
79 files changed
+7495
-1104
No files matched your search
@@ -32,7 +32,7 @@
|
||||
>
|
||||
<view class="menu-left">
|
||||
<view class="menu-icon">
|
||||
<FaIcon :name="item.icon" color="#3c9cff" :size="18" />
|
||||
<FaIcon :name="item.icon" color="#3973ff" :size="18" />
|
||||
</view>
|
||||
<text class="menu-title">{{ item.title }}</text>
|
||||
</view>
|
||||
@@ -56,9 +56,9 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { getUser, setUser, logout, isLoggedIn } from '@/utils/auth.js'
|
||||
import { getCurrentUser, logoutApi } from '@/api/auth.js'
|
||||
import AppTabbar from '@/components/AppTabbar.vue'
|
||||
import { getUser, setUser, logout, isLoggedIn, isSSOEnabled, getToken } from '@/utils/auth.js'
|
||||
import { getCurrentUser, logoutApi, logoutUAC } from '@/api/auth.js'
|
||||
import AppTabbar from '@/components/MainTabbar.vue'
|
||||
|
||||
const user = ref(null)
|
||||
|
||||
@@ -148,10 +148,14 @@ function handleLogout() {
|
||||
cancelText: '取消',
|
||||
success(res) {
|
||||
if (!res.confirm) return
|
||||
// 先清本地并跳转,避免接口超时/失败导致“退出无效”
|
||||
// 统一认证:先吊销服务端会话与令牌(默认 1 号 1 机,不吊销会占着名额)
|
||||
if (isSSOEnabled() && getToken()) {
|
||||
logoutUAC().catch(() => {})
|
||||
} else {
|
||||
logoutApi().catch(() => {})
|
||||
}
|
||||
// 再清本地并跳转,避免接口超时/失败导致“退出无效”
|
||||
logout()
|
||||
// 后端无状态退出,失败可忽略(不阻塞)
|
||||
logoutApi().catch(() => {})
|
||||
uni.reLaunch({ url: '/pages/login/login' })
|
||||
}
|
||||
})
|
||||
@@ -168,7 +172,7 @@ function handleLogout() {
|
||||
.profile-header {
|
||||
flex-shrink: 0;
|
||||
padding: calc(var(--status-bar-height, 44px) + 24rpx) $page-padding-x 40rpx;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
background: $hero-gradient;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -332,7 +336,7 @@ function handleLogout() {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 12rpx;
|
||||
background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
|
||||
background: linear-gradient(135deg, rgba(57, 115, 255, 0.12) 0%, rgba(82, 168, 255, 0.14) 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -356,13 +360,13 @@ function handleLogout() {
|
||||
font-size: 20rpx;
|
||||
font-weight: 600;
|
||||
color: #ffffff;
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
background: linear-gradient(135deg, #3973ff 0%, #52a8ff 100%);
|
||||
padding: 6rpx 14rpx;
|
||||
border-radius: 12rpx;
|
||||
min-width: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 1.4;
|
||||
box-shadow: 0 4rpx 12rpx rgba(79, 172, 254, 0.3);
|
||||
box-shadow: 0 4rpx 12rpx rgba(57, 115, 255, 0.3);
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
|
||||
Reference in new issue
Block a user