|
@@ -2,16 +2,20 @@
|
|
|
* @Author: wjc
|
|
|
* @Date: 2024-06-17 16:02:59
|
|
|
* @LastEditors: wjc
|
|
|
- * @LastEditTime: 2024-07-08 16:56:12
|
|
|
+ * @LastEditTime: 2024-07-09 17:36:34
|
|
|
* @Description:
|
|
|
-->
|
|
|
<template>
|
|
|
<MCard>
|
|
|
<view>{{ userStore.userInfo.name }}</view>
|
|
|
</MCard>
|
|
|
+ <MCard :space="true" direction="horizontal" justify="between">
|
|
|
+ <view>深色模式</view>
|
|
|
+ <up-switch v-model="appStore.isDark"></up-switch>
|
|
|
+ </MCard>
|
|
|
<up-button type="primary" class="btn-primary" @click="handleConfirmLogout">退出登录</up-button>
|
|
|
<up-modal :show="logoutShow">
|
|
|
- <view class="text-18px py-24px">确认退出登录?</view>
|
|
|
+ <view class="text-18px py-24px color-text-1">确认退出登录?</view>
|
|
|
<template #confirmButton>
|
|
|
<view class="flex justify-between text-center gap-20px">
|
|
|
<view class="btn-default flex-1" @click="handleCancel">取消</view>
|
|
@@ -24,11 +28,14 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { useUserStore } from '@/stores/modules/userStore'
|
|
|
+ import { useAppStore } from '@/stores/modules/appStore'
|
|
|
|
|
|
defineOptions({ name: 'Mine' })
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
+ const appStore = useAppStore()
|
|
|
const logoutShow = ref(false)
|
|
|
+ const darkValue = ref(false)
|
|
|
|
|
|
const handleCancel = () => {
|
|
|
logoutShow.value = false
|
|
@@ -41,6 +48,10 @@
|
|
|
onLogout()
|
|
|
}
|
|
|
|
|
|
+ // const changeDark = (value: boolean) => {
|
|
|
+ // appStore.isDark = value
|
|
|
+ // }
|
|
|
+
|
|
|
const onLogout = () => {
|
|
|
userStore.logoutAction().then((res) => {
|
|
|
if (res) {
|