perf: 同步完整版代码

This commit is contained in:
xiaoxian521
2022-03-14 14:49:02 +08:00
parent 79ebfb9284
commit f5b387231a
49 changed files with 1611 additions and 1008 deletions

View File

@@ -6,9 +6,57 @@ import noAccess from "/@/assets/status/403.svg?component";
<div class="flex justify-center items-center h-screen-sm">
<noAccess />
<div class="ml-12">
<p class="font-medium text-4xl mb-4">403</p>
<p class="mb-4 text-gray-500">抱歉你无权访问该页面</p>
<el-button type="primary" @click="$router.push('/')">返回首页</el-button>
<p
class="font-medium text-4xl mb-4"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 100
}
}"
>
403
</p>
<p
class="mb-4 text-gray-500"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 300
}
}"
>
抱歉你无权访问该页面
</p>
<el-button
type="primary"
@click="$router.push('/')"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 500
}
}"
>返回首页</el-button
>
</div>
</div>
</template>

View File

@@ -6,9 +6,57 @@ import noExist from "/@/assets/status/404.svg?component";
<div class="flex justify-center items-center h-screen-sm">
<noExist />
<div class="ml-12">
<p class="font-medium text-4xl mb-4">404</p>
<p class="mb-4 text-gray-500">抱歉你访问的页面不存在</p>
<el-button type="primary" @click="$router.push('/')">返回首页</el-button>
<p
class="font-medium text-4xl mb-4"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 100
}
}"
>
404
</p>
<p
class="mb-4 text-gray-500"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 300
}
}"
>
抱歉你访问的页面不存在
</p>
<el-button
type="primary"
@click="$router.push('/')"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 500
}
}"
>返回首页</el-button
>
</div>
</div>
</template>

View File

@@ -6,9 +6,57 @@ import noServer from "/@/assets/status/500.svg?component";
<div class="flex justify-center items-center h-screen-sm">
<noServer />
<div class="ml-12">
<p class="font-medium text-4xl mb-4">403</p>
<p class="mb-4 text-gray-500">抱歉服务器出错了</p>
<el-button type="primary" @click="$router.push('/')">返回首页</el-button>
<p
class="font-medium text-4xl mb-4"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 100
}
}"
>
403
</p>
<p
class="mb-4 text-gray-500"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 300
}
}"
>
抱歉服务器出错了
</p>
<el-button
type="primary"
@click="$router.push('/')"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 500
}
}"
>返回首页</el-button
>
</div>
</div>
</template>

View File

@@ -20,12 +20,16 @@ function changRole(value) {
</script>
<template>
<div>
<el-radio-group v-model="auth" @change="changRole">
<el-radio-button label="admin"></el-radio-button>
<el-radio-button label="test"></el-radio-button>
</el-radio-group>
<el-card>
<template #header>
<div class="card-header">
<el-radio-group v-model="auth" @change="changRole">
<el-radio-button label="admin"></el-radio-button>
<el-radio-button label="test"></el-radio-button>
</el-radio-group>
</div>
</template>
<p v-auth="'v-admin'">只有admin可看</p>
<p v-auth="'v-test'">只有test可看</p>
</div>
</el-card>
</template>

View File

@@ -29,19 +29,23 @@ function changRole() {
</script>
<template>
<div>
<h4>
当前角色
<span style="font-size: 26px">{{ purview }}</span>
<p style="color: #ffa500">
查看左侧菜单变化(系统管理)模拟后台根据不同角色返回对应路由
</p>
</h4>
<el-card>
<template #header>
<div class="card-header">
<span>
当前角色
<span style="font-size: 26px">{{ purview }}</span>
<p style="color: #ffa500">
查看左侧菜单变化(系统管理)模拟后台根据不同角色返回对应路由
</p></span
>
</div>
</template>
<el-button
type="primary"
@click="changRole"
:icon="useRenderIcon('user', { color: '#fff' })"
>切换角色</el-button
>
</div>
</el-card>
</template>

View File

@@ -1,20 +0,0 @@
<script setup lang="ts">
import { unref } from "vue";
import { useRouter } from "vue-router";
const { currentRoute, replace } = useRouter();
const { params, query } = unref(currentRoute);
const { path } = params;
const _path = Array.isArray(path) ? path.join("/") : path;
replace({
path: "/" + _path,
query
});
</script>
<template>
<div></div>
</template>

View File

@@ -1,6 +0,0 @@
export type infoType = {
svg?: string;
code?: number;
info?: string;
accessToken?: string;
};