Skip to content

Commit

Permalink
feat: 添加了上传密钥的自动解密功能
Browse files Browse the repository at this point in the history
  • Loading branch information
Zecyel committed Aug 6, 2024
1 parent 96351ba commit 642cc5b
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 173 deletions.
11 changes: 0 additions & 11 deletions components/Direct.vue

This file was deleted.

175 changes: 88 additions & 87 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,105 +1,106 @@
<template>
<div class="common-layout">
<el-container>
<el-header
style="
/* background-color: aquamarine; */
border-bottom: 1px solid #ddd;
"
>
<el-row
align="middle"
style="height: 100%"
>
<el-col :span="2"></el-col>
<el-col :span="8">🌴管理后台🌴</el-col>
<el-col :span="6"></el-col>
<template v-if="user_store.logined">
<el-col :span="4">
<el-text>{{ user_store.username }}</el-text>
</el-col>
<el-col :span="1"></el-col>
<el-col :span="3">
<el-button type="danger" plain @click="logout">登出</el-button>
</el-col>
</template>
<template v-else>
<el-col :span="8">
<el-button type="primary" plain @click="login">登录</el-button>
</el-col>
</template>
</el-row>
</el-header>
<el-main
style="
display: flex;
justify-content: center;
align-items: center;
"
>
<div
style="
border: 1px solid #ddd;
margin: 20px;
padding: 20px;
min-width: 50%;
"
>
<el-page-header
@back="goBack"
>
<template #breadcrumb>
<el-breadcrumb separator="/">
<template v-for="item in layout_store.path">
<el-breadcrumb-item v-if="'path' in item" :to="{ path: item.path }">
{{ item.name }}
</el-breadcrumb-item>
<el-breadcrumb-item v-else>
{{ item.name }}
</el-breadcrumb-item>
</template>
</el-breadcrumb>
</template>
<template #content>
<div class="flex items-center">
<span class="text-large font-600 mr-3">{{ layout_store.title }}</span>
<span
class="text-sm mr-2"
style="color: var(--el-text-color-regular)"
v-if="'subtitle' in layout_store"
>{{ layout_store.subtitle }}</span>
</div>
</template>
</el-page-header>
<br />
<slot />
</div>
</el-main>
</el-container>
</div>
<div class="common-layout">
<el-container>
<el-header
style="
/* background-color: aquamarine; */
border-bottom: 1px solid #ddd;
"
>
<el-row
align="middle"
style="height: 100%"
>
<el-col :span="2"></el-col>
<el-col :span="8">🌴管理后台🌴</el-col>
<el-col :span="6"></el-col>
<template v-if="user_store.logined">
<el-col :span="4">
<el-text>{{ user_store.username }}</el-text>
</el-col>
<el-col :span="1"></el-col>
<el-col :span="3">
<el-button type="danger" plain @click="logout">登出</el-button>
</el-col>
</template>
<template v-else>
<el-col :span="8">
<el-button type="primary" plain @click="login">登录</el-button>
</el-col>
</template>
</el-row>
</el-header>
<el-main
style="
display: flex;
justify-content: center;
align-items: center;
"
>
<div
style="
border: 1px solid #ddd;
margin: 20px;
padding: 20px;
min-width: 50%;
"
>
<el-page-header
@back="goBack"
>
<template #breadcrumb>
<el-breadcrumb separator="/">

<template v-for="item in layout_store.path">
<el-breadcrumb-item v-if="'path' in item" :to="{ path: item.path }">
{{ item.name }}
</el-breadcrumb-item>

<el-breadcrumb-item v-else>
{{ item.name }}
</el-breadcrumb-item>
</template>

</el-breadcrumb>
</template>

<template #content>
<div class="flex items-center">
<span class="text-large font-600 mr-3">{{ layout_store.title }}</span>
<span
class="text-sm mr-2"
style="color: var(--el-text-color-regular)"
v-if="'subtitle' in layout_store"
>{{ layout_store.subtitle }}</span>
</div>
</template>

</el-page-header>
<br />
<slot />
</div>
</el-main>
</el-container>
</div>
</template>

<script setup>
const layout_store = useLayoutStore()
const user_store = useUserStore()
const router = useRouter()
function goBack() {
useRouter().push('/')
router.push('/')
}
function login() {
useRouter().push('/user/login')
router.push('/user/login')
}
function logout() {
user_store.logout()
useRouter().push('/user/login')
user_store.logout()
router.push('/user/login')
}
</script>
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@pinia/nuxt": "^0.5.1",
"ajv": "^8.12.0",
"n": "^9.2.1",
"openpgp": "^5.11.2",
"pinia": "^2.1.7"
}
}
Loading

0 comments on commit 642cc5b

Please sign in to comment.