index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!--
  2. - Copyright (c) 2024 LangChat. TyCoding All Rights Reserved.
  3. -
  4. - Licensed under the GNU Affero General Public License, Version 3 (the "License");
  5. - you may not use this file except in compliance with the License.
  6. - You may obtain a copy of the License at
  7. -
  8. - https://www.gnu.org/licenses/agpl-3.0.html
  9. -
  10. - Unless required by applicable law or agreed to in writing, software
  11. - distributed under the License is distributed on an "AS IS" BASIS,
  12. - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. - See the License for the specific language governing permissions and
  14. - limitations under the License.
  15. -->
  16. <script lang="ts" setup>
  17. import Account from './components/Account.vue';
  18. import Pass from './components/Pass.vue';
  19. import { SvgIcon } from '@/components/common';
  20. import { onMounted, ref } from 'vue';
  21. import { info } from '@/api/auth';
  22. const form = ref();
  23. const loading = ref(true);
  24. onMounted(() => {
  25. info().then((res: any) => {
  26. form.value = res;
  27. });
  28. loading.value = false;
  29. });
  30. </script>
  31. <template>
  32. <n-spin :show="loading" class="w-full h-full">
  33. <div class="p-4 pl-9">
  34. <div class="pt-3 pb-3 text-lg">个人中心</div>
  35. <n-tabs v-if="form" animated type="line">
  36. <n-tab-pane name="1">
  37. <template #tab> <SvgIcon class="mr-1" icon="solar:user-id-broken" />个人信息 </template>
  38. <Account :form="form" />
  39. </n-tab-pane>
  40. <n-tab-pane name="2">
  41. <template #tab> <SvgIcon class="mr-1" icon="carbon:password" />修改密码 </template>
  42. <Pass />
  43. </n-tab-pane>
  44. </n-tabs>
  45. <div></div>
  46. </div>
  47. </n-spin>
  48. </template>
  49. <style lang="less" scoped></style>