Initial commit

This commit is contained in:
jiapengyu
2026-07-27 13:37:48 +08:00
commit ecba71e2a5
39123 changed files with 5989154 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
"use strict";const e=require("../common/vendor.js"),r=require("../api/index.js"),s=e.defineStore("user",()=>{const s=e.ref([]),a=e.ref(!1),t=async()=>{a.value=!0;try{const e=await r.userApi.getUsers();s.value=e}catch(e){console.error("Failed to load users:",e)}a.value=!1};return{users:s,isLoading:a,loadUsers:t,addUser:async e=>{try{await r.userApi.addUser(e),await t()}catch(s){console.error("Failed to add user:",s)}},updateUser:async e=>{try{await r.userApi.updateUser(e),await t()}catch(s){console.error("Failed to update user:",s)}},deleteUser:async e=>{try{await r.userApi.deleteUser(e),await t()}catch(s){console.error("Failed to delete user:",s)}},getUserById:e=>s.value.find(r=>r.id===e)}});exports.useUserStore=s;