refactor: adjust all sample pages and use page components (#4118)

This commit is contained in:
Vben
2024-08-11 20:05:52 +08:00
committed by GitHub
parent 3015912f1a
commit 517acada1a
75 changed files with 282 additions and 383 deletions

View File

@@ -1,9 +1,10 @@
<script lang="ts" setup>
import type { LoginExpiredModeType } from '@vben/types';
import { Page } from '@vben/common-ui';
import { preferences, updatePreferences } from '@vben/preferences';
import { Button } from 'ant-design-vue';
import { Button, Card } from 'ant-design-vue';
import { getMockStatusApi } from '#/api';
@@ -17,26 +18,22 @@ async function handleClick(type: LoginExpiredModeType) {
</script>
<template>
<div class="p-5">
<div class="card-box p-5">
<h1 class="text-xl font-semibold">登录过期演示</h1>
<Page title="登录过期演示">
<template #description>
<div class="text-foreground/80 mt-2">
接口请求遇到401状态码时需要重新登录有两种方式
<div>1.转到登录页登录成功后跳转回原页面</div>
<div>
<p>1.转到登录页登录成功后跳转回原页面</p>
<p>
2.弹出重新登录弹窗登录后关闭弹窗不进行任何页面跳转刷新后调整登录页面
</div>
</p>
</div>
</div>
</template>
<div class="card-box mt-5 p-5">
<div class="mb-3 text-lg font-semibold">跳转登录页面方式</div>
<Card class="mb-5" title="跳转登录页面方式">
<Button type="primary" @click="handleClick('page')"> 点击触发 </Button>
</div>
<div class="card-box mt-5 p-5">
<div class="mb-3 text-lg font-semibold">登录弹窗方式</div>
</Card>
<Card class="mb-5" title="登录弹窗方式">
<Button type="primary" @click="handleClick('modal')"> 点击触发 </Button>
</div>
</div>
</Card>
</Page>
</template>