使用Pinia代替Vuex进行数据存储

This commit is contained in:
RuoYi
2025-04-23 20:53:28 +08:00
parent fd97380edb
commit 3eca7b1219
15 changed files with 169 additions and 155 deletions

View File

@@ -31,7 +31,7 @@
</template>
<script setup>
import store from '@/store'
import { useUserStore } from '@/store'
import { ref, computed , getCurrentInstance } from "vue"
const { proxy } = getCurrentInstance()
@@ -51,7 +51,7 @@
function handleLogout() {
proxy.$modal.confirm('确定注销并退出系统吗?').then(() => {
store.dispatch('LogOut').then(() => {}).finally(()=>{
useUserStore().logOut().then(() => {}).finally(()=>{
proxy.$tab.reLaunch('/pages/index')
})
})