mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-13 17:30:27 +08:00
refactor: 重构API接口响应格式,带来简洁高效的接口设计 (#1256)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { getMine } from "@/api/user";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
import { ReText } from "@/components/ReText";
|
||||
import Profile from "./components/Profile.vue";
|
||||
import { ref, onMounted, onBeforeMount } from "vue";
|
||||
import Preferences from "./components/Preferences.vue";
|
||||
import SecurityLog from "./components/SecurityLog.vue";
|
||||
import { useGlobal, deviceDetection } from "@pureadmin/utils";
|
||||
@@ -61,8 +61,11 @@ const panes = [
|
||||
];
|
||||
const witchPane = ref("profile");
|
||||
|
||||
getMine().then(res => {
|
||||
userInfo.value = res.data;
|
||||
onMounted(async () => {
|
||||
const { code, data } = await getMine();
|
||||
if (code === 0) {
|
||||
userInfo.value = data;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user