提交 b3300459 authored 作者: matian's avatar matian

bug fixes

上级 9abe451f
......@@ -2,140 +2,33 @@
export default { name: 'AppHeader' }
</script>
<script setup lang="ts">
import { useUserStore } from '@/stores/user'
withDefaults(defineProps<{ hasTitle?: boolean }>(), {
hasTitle: true
})
const userStore = useUserStore()
const userInfo = userStore.user
const logout = () => {
userStore.logout()
}
</script>
<script setup lang="ts"></script>
<template>
<header class="app-header">
<div class="app-header-left">
<div class="logo">
<router-link to="/"
><img src="https://webapp-pub.ezijing.com/project_online/fdc/fdc_header_logo.png"
/></router-link>
</div>
</div>
<div class="app-header-right">
<el-dropdown v-if="userInfo">
<div class="avatar">
<img :src="userInfo.avatar || 'https://webapp-pub.ezijing.com/website/base/images/avatar.svg'" />
</div>
<template #dropdown>
<el-dropdown-menu>
<div class="app-header-user">
<div class="app-header-user-avatar">
<img :src="userInfo.avatar || 'https://webapp-pub.ezijing.com/website/base/images/avatar.svg'" />
</div>
<div class="app-header-user-main">
<h3>{{ userStore.userName }}</h3>
<p>{{ userInfo.email || userInfo.mobile }}</p>
</div>
<div class="app-header-user-buttons">
<el-button round @click="logout">退出登录</el-button>
</div>
</div>
</el-dropdown-menu>
</template>
</el-dropdown>
<div class="logo">
<router-link to="/"
><img src="https://webapp-pub.ezijing.com/project_online/fdc/fdc_header_logo.png"
/></router-link>
</div>
</header>
</template>
<style lang="scss">
.app-header {
height: 64px;
position: absolute;
top: 44px;
top: 23px;
left: 72px;
z-index: 1000;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
background-color: #fff;
color: #fff;
.logo {
width: 120px;
}
}
.app-header-left {
display: flex;
align-items: center;
.app-name {
margin-left: 20px;
padding: 0 15px;
line-height: 1;
border-left: 2px solid #fff;
}
}
.app-header-right {
display: flex;
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
overflow: hidden;
}
&:hover {
background-color: rgba(60, 64, 67, 0.08);
}
}
}
.app-header-user {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 16px;
}
.app-header-user-avatar {
margin-bottom: 6px;
width: 80px;
height: 80px;
border-radius: 50%;
overflow: hidden;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.app-header-user-main {
h3 {
color: #202124;
font: 500 16px/22px Helvetica, Arial, sans-serif;
letter-spacing: 0.29px;
margin: 0;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
}
p {
color: #5f6368;
font: 400 14px/19px Helvetica, Arial, sans-serif;
letter-spacing: normal;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
}
}
.app-header-user-buttons {
padding-top: 16px;
}
</style>
......@@ -15,10 +15,7 @@ withDefaults(defineProps<{ sidebar?: boolean; hasTitle?: boolean }>(), {
<template>
<div class="app-layout">
<app-header :hasTitle="hasTitle"></app-header>
<div class="app-layout-container">
<!-- <app-aside v-if="sidebar"></app-aside> -->
<app-main></app-main>
</div>
<app-main></app-main>
</div>
</template>
......@@ -27,11 +24,11 @@ withDefaults(defineProps<{ sidebar?: boolean; hasTitle?: boolean }>(), {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
background: #fff;
}
.app-layout-container {
flex: 1;
display: flex;
height: calc(100vh - 166px);
}
</style>
......@@ -12,7 +12,7 @@
.app-main {
position: relative;
flex: 1;
top: 166px;
top: 110px;
}
.app-main-inner {
margin: 0 auto;
......
......@@ -11,14 +11,14 @@ import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 公共css
import './assets/css/base.css'
// 公共组件
import AppCard from '@/components/base/AppCard.vue'
import AppContainer from '@/components/base/AppContainer.vue'
// import AppCard from '@/components/base/AppCard.vue'
// import AppContainer from '@/components/base/AppContainer.vue'
import modules from './modules'
const app = createApp(App)
// 注册公共组件
app.component('AppCard', AppCard).component('AppContainer', AppContainer)
// app.component('AppCard', AppCard).component('AppContainer', AppContainer)
// 注册模块
modules({ router })
......
......@@ -10,7 +10,6 @@ const form = reactive({
idNumber: '', // 身份证号
cardNumber: '' // 证书编号
})
const queryResultList = reactive({ list: [] as any[] })
const handleSubmit = () => {
......@@ -23,7 +22,8 @@ const handleSubmit = () => {
if (res.code === 0) {
queryResultList.list = res.data
window.localStorage.setItem('list', JSON.stringify(queryResultList.list))
console.log(res, 'pppp')
// const localTime = new Date().getTime()
// window.localStorage.setItem('localTime', JSON.stringify(localTime))
$router.push({
path: 'detail',
query: {
......@@ -35,8 +35,7 @@ const handleSubmit = () => {
$router.push({
path: 'detail',
query: {
code: res.code,
code: res.code
}
})
}
......
......@@ -10,11 +10,10 @@ const isShowGetCode = ref(false)
const isDisposed = ref(false)
const time = ref(60)
const loginType = ref('')
const isCode = ref(false)
// 登录
const handleLogin = () => {
if (isCode.value === true) {
if (isShowGetCode.value === true) {
loginType.value = '2'
} else {
loginType.value = '1'
......@@ -29,7 +28,7 @@ const handleLogin = () => {
api.login(params).then((res: any) => {
console.log(res, '0000')
if (res.code === 0) {
window.location.href = 'https://fdc-admin.ezijing.com/bfi/cert'
window.location.href = 'https://fdc-admin.ezijing.com'
} else {
ElMessage.warning(res.msg)
}
......@@ -52,7 +51,6 @@ function getCode() {
api.sendCode(params).then(res => {
console.log('获取验证码结果', res)
isDisposed.value = true
isCode.value = true
handleTimeChange()
})
}
......
......@@ -9,7 +9,7 @@ const tabList: Array<{ tabName: string }> = [
tabName: '证书查询'
},
{
tabName: '学登录'
tabName: '学登录'
},
{
tabName: '管理员登录'
......@@ -44,7 +44,7 @@ function handleTabChange(index: number) {
<style lang="scss">
.home {
height: calc(100vh - 166px);
height: calc(100vh - 110px);
width: 100%;
background: url(https://webapp-pub.oss-cn-beijing.aliyuncs.com/project_online/fdc/%20fdc_bg.png) no-repeat;
background-size: 100% 100%;
......@@ -58,7 +58,7 @@ function handleTabChange(index: number) {
align-items: center;
flex-direction: column;
width: 472px;
// min-height: 496px;
height: 496px;
background: #ffffff;
opacity: 1;
border-radius: 20px;
......
/* eslint-disable no-constant-condition */
<script setup lang="ts">
import { reactive, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { reactive, ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const queryResultList = reactive({ list: [] as any[] })
const route = useRoute()
const $router = useRouter()
const time = ref(1800)
let timer: any = null
const getTime = () => {
// 避免重复执行 setTimeout
timer && clearTimeout(timer)
timer = setTimeout(() => {
if (time.value > 0) {
time.value--
getTime() // 递归调用
} else {
$router.push('/home/index')
}
}, 1000)
}
onMounted(() => {
// const new_date = new Date().getTime() //新建一个日期对象,默认现在的时间
// const old_date = window.localStorage.getItem('localTime') //设置过去的一个时间点,"yyyy-MM-dd HH:mm:ss"格式化日期
// console.log((Number(new_date) - Number(old_date)) / 86400 / 3600 / 60, '000000000')
// if ((Number(new_date) - Number(old_date)) / 86400 / 3600 / 60 >= 30) {
// $router.push('/home/index')
// }
console.log(time.value)
if (route.query.code === '1') {
queryResultList.list = []
getTime()
} else {
queryResultList.list = JSON.parse(window.localStorage.getItem('list') || '0')
getTime()
}
})
</script>
<template>
<div class="main_content">
{{ time }}
<div class="home-box" v-if="queryResultList.list.length > 0">
<div v-for="(item, index) in queryResultList.list" :key="index" class="home-box-content">
<div class="home-box-content-btn">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论