添加顶部编辑按钮

This commit is contained in:
柏码の讲师 2023-09-04 17:40:04 +08:00
parent 91b931f306
commit 9f15a84f78
2 changed files with 21 additions and 4 deletions

View File

@ -23,7 +23,7 @@ function takeAccessToken() {
const str = localStorage.getItem(authItemName) || sessionStorage.getItem(authItemName); const str = localStorage.getItem(authItemName) || sessionStorage.getItem(authItemName);
if(!str) return null if(!str) return null
const authObj = JSON.parse(str) const authObj = JSON.parse(str)
if(authObj.expire <= new Date()) { if(new Date(authObj.expire) <= new Date()) {
deleteAccessToken() deleteAccessToken()
ElMessage.warning("登录状态已过期,请重新登录!") ElMessage.warning("登录状态已过期,请重新登录!")
return null return null

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import LightCard from "@/components/LightCard.vue"; import LightCard from "@/components/LightCard.vue";
import {Calendar, CollectionTag, Link} from "@element-plus/icons-vue"; import {Calendar, CollectionTag, EditPen, Link} from "@element-plus/icons-vue";
import {computed} from "vue" import {computed} from "vue"
import Weather from "@/components/Weather.vue"; import Weather from "@/components/Weather.vue";
@ -14,7 +14,9 @@ const today = computed(() => {
<div style="display: flex;margin: 20px auto;gap: 20px;max-width: 900px"> <div style="display: flex;margin: 20px auto;gap: 20px;max-width: 900px">
<div style="flex: 1"> <div style="flex: 1">
<light-card> <light-card>
<div class="edit-topic">
<div><el-icon><EditPen/></el-icon> 点击发表主题...</div>
</div>
</light-card> </light-card>
</div> </div>
<div style="width: 280px"> <div style="width: 280px">
@ -69,9 +71,24 @@ const today = computed(() => {
</div> </div>
</template> </template>
<style scoped> <style lang="less" scoped>
.friend-link { .friend-link {
border-radius: 5px; border-radius: 5px;
overflow: hidden; overflow: hidden;
} }
.edit-topic {
background-color: #ececec;
border-radius: 5px;
height: 40px;
color: grey;
font-size: 14px;
line-height: 40px;
padding: 0 10px;
margin: 10px;
:hover {
cursor: pointer;
}
}
</style> </style>