refine imports and styles
This commit is contained in:
1 parent
f538780b91
commit
c9010effbb
47 files changed
+303
-337
No files matched your search
@@ -18,6 +18,7 @@ export default defineComponent({
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
emits: ['update:show'],
|
||||
watch: {
|
||||
show(val, oldVal) {
|
||||
if (val) {
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
$t('common.button.login')
|
||||
}}</el-button>
|
||||
</div>
|
||||
<div v-else class="mt-3 pr-10 float-right">
|
||||
<div v-else class="float-right">
|
||||
<div class="console" @click="onConsole">
|
||||
{{ $t('common.button.console') }}
|
||||
</div>
|
||||
<el-dropdown trigger="click">
|
||||
<img :src="user?.avatar || defaultAvatar" class="avatar" />
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="onConsole">{{ $t('common.button.console') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click="onProfile">{{ $t('common.button.profile') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click="onVerify">{{ $t('common.button.verify') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click="onLogout">{{ $t('common.button.logout') }}</el-dropdown-item>
|
||||
@@ -39,6 +41,9 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import defaultAvatar from '@/assets/images/avatar.png';
|
||||
import { getAuthBaseUrl } from '@/utils';
|
||||
import { ROUTE_AUTH_LOGIN, ROUTE_CONSOLE_ROOT, ROUTE_INDEX } from '@/router';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TopHeader',
|
||||
data() {
|
||||
@@ -61,28 +66,32 @@ export default defineComponent({
|
||||
},
|
||||
onHome() {
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
name: ROUTE_INDEX
|
||||
});
|
||||
},
|
||||
onLogin() {
|
||||
this.$router.push({
|
||||
name: 'login'
|
||||
name: ROUTE_AUTH_LOGIN
|
||||
});
|
||||
},
|
||||
onProfile() {
|
||||
window.location.href = 'https://auth.test.zhishuyun.com/user/profile';
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
window.open(`${authBaseUrl}/user/profile`, '_blank');
|
||||
},
|
||||
onVerify() {
|
||||
window.location.href = 'https://auth.test.zhishuyun.com/user/verify';
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
window.open(`${authBaseUrl}/user/verify`, '_blank');
|
||||
},
|
||||
onConsole() {
|
||||
this.$router.push({
|
||||
name: 'console-application-list'
|
||||
name: ROUTE_CONSOLE_ROOT
|
||||
});
|
||||
},
|
||||
onLogout() {
|
||||
this.$store.dispatch('resetAuth');
|
||||
this.$router.push('/');
|
||||
this.$router.push({
|
||||
name: ROUTE_INDEX
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -123,6 +132,18 @@ $height: 60px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
margin-top: 10px;
|
||||
margin-right: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.console {
|
||||
color: white;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
margin: 0 10px;
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -6,6 +6,7 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { authOperator, ITokenResponse } from '@/operators';
|
||||
import { getAuthBaseUrl } from '@/utils';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'VerificationAlert',
|
||||
@@ -53,7 +54,8 @@ export default defineComponent({
|
||||
closeOnHashChange: false
|
||||
})
|
||||
.then(() => {
|
||||
window.open('https://auth.test.zhishuyun.com/user/verify?redirect=' + window.location.href + '?refresh=1');
|
||||
const authBaseUrl = getAuthBaseUrl();
|
||||
window.open(`${authBaseUrl}/user/verify?redirect=` + window.location.href + '?refresh=1');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { PropType } from 'vue';
|
||||
import { defineComponent, computed, h } from 'vue';
|
||||
|
||||
import MarkdownIt, { Options as MarkdownItOptions } from 'markdown-it';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -19,7 +18,6 @@ export default defineComponent({
|
||||
},
|
||||
setup(props, { attrs }) {
|
||||
const md = new MarkdownIt(props.options);
|
||||
|
||||
const content = computed(() => {
|
||||
const src = props.source;
|
||||
return md?.render(src);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import TopHeader from './TopHeader.vue';
|
||||
import Breadcrumb from './Breadcrumb.vue';
|
||||
import SuccessInfo from './SuccessInfo.vue';
|
||||
import Pagination from './Pagination.vue';
|
||||
export { TopHeader, Breadcrumb, SuccessInfo, Pagination };
|
||||
Reference in new issue
Block a user