update hub
This commit is contained in:
1 parent
731a219527
commit
2e7d636f0f
9 files changed
+162
-432
No files matched your search
@@ -64,12 +64,21 @@ import { defineComponent } from 'vue';
|
||||
import { ElSkeleton, ElInput } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import { ROUTE_CHAT_CONVERSATION } from '@/router/constants';
|
||||
import { apiUsageOperator, IApplication, chatOperator } from '@/operators';
|
||||
import { apiUsageOperator, IApplication, chatOperator, applicationOperator } from '@/operators';
|
||||
import { IChatConversation } from '@/operators/chat/models';
|
||||
import {
|
||||
CHAT_MODEL_CHATGPT,
|
||||
CHAT_MODEL_CHATGPT4,
|
||||
CHAT_MODEL_CHATGPT4_BROWSING,
|
||||
CHAT_MODEL_CHATGPT_16K,
|
||||
CHAT_MODEL_CHATGPT_BROWSING
|
||||
} from '@/operators';
|
||||
|
||||
interface IData {
|
||||
initializing: boolean;
|
||||
loading: boolean;
|
||||
conversations: IChatConversation[] | undefined;
|
||||
applications: IApplication[] | undefined;
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
@@ -79,45 +88,61 @@ export default defineComponent({
|
||||
FontAwesomeIcon,
|
||||
ElSkeleton
|
||||
},
|
||||
props: {
|
||||
applications: {
|
||||
type: Object as () => IApplication[],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
props: {},
|
||||
emits: ['click'],
|
||||
data(): IData {
|
||||
return {
|
||||
initializing: false,
|
||||
loading: false,
|
||||
conversations: undefined
|
||||
conversations: undefined,
|
||||
applications: undefined
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
applications(val) {
|
||||
if (val) {
|
||||
this.onFetchAllConversations();
|
||||
this.onFetchConversations();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
async mounted() {
|
||||
await this.onFetchApplications();
|
||||
await this.onFetchConversations();
|
||||
},
|
||||
methods: {
|
||||
async onFetchApplications() {
|
||||
this.initializing = true;
|
||||
const { data: applications } = await applicationOperator.getAll({
|
||||
user_id: this.$store.state.user.id,
|
||||
api_id: [
|
||||
CHAT_MODEL_CHATGPT.apiId,
|
||||
CHAT_MODEL_CHATGPT_16K.apiId,
|
||||
CHAT_MODEL_CHATGPT_BROWSING.apiId,
|
||||
CHAT_MODEL_CHATGPT4.apiId,
|
||||
CHAT_MODEL_CHATGPT4_BROWSING.apiId
|
||||
]
|
||||
});
|
||||
this.initializing = false;
|
||||
this.applications = applications?.items;
|
||||
},
|
||||
async onConfirm(conversation: IChatConversation) {
|
||||
if (conversation?.deleting) {
|
||||
await chatOperator.deleteConversation(conversation.id);
|
||||
await this.onFetchAllConversations();
|
||||
await this.onFetchConversations();
|
||||
} else if (conversation?.editing) {
|
||||
await chatOperator.updateConversation(conversation);
|
||||
this.onFetchAllConversations();
|
||||
this.onFetchConversations();
|
||||
} else {
|
||||
conversation.editing = true;
|
||||
}
|
||||
},
|
||||
async onFetchAllConversations() {
|
||||
async onFetchConversations() {
|
||||
this.loading = true;
|
||||
const {
|
||||
data: { items: apiUsages }
|
||||
} = await apiUsageOperator.getAll({
|
||||
user_id: this.$store.state.user.id,
|
||||
// @ts-ignore
|
||||
application_id: this.applications?.map((application) => application.id),
|
||||
offset: 0,
|
||||
limit: 30,
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
<template>
|
||||
<div class="navigator">
|
||||
<div class="conversations">
|
||||
<navigator-item icon="fa-solid fa-plus" :title="$t('common.nav.newChat')" @click="onNewConversation" />
|
||||
<conversation-navigator-item
|
||||
v-for="(conversation, conversationIndex) in conversations"
|
||||
:key="conversationIndex"
|
||||
:title="conversation.title"
|
||||
icon="fa-regular fa-comment"
|
||||
@update:title="onUpdateTitle(conversation, $event)"
|
||||
@delete="onDeleteConversation(conversation.id)"
|
||||
@click="onSelectConversation(conversation.id)"
|
||||
/>
|
||||
</div>
|
||||
<div class="operators">
|
||||
<navigator-item icon="fa-solid fa-gear" :title="$t('common.nav.setting')" @click="setting = true" />
|
||||
<setting-panel :visible="setting" @close="setting = false" />
|
||||
<navigator-item
|
||||
v-show="!confirming"
|
||||
icon="fa-solid fa-trash"
|
||||
:title="$t('common.nav.clearConversations')"
|
||||
@click="confirming = true"
|
||||
/>
|
||||
<navigator-item
|
||||
v-show="confirming"
|
||||
icon="fa-solid fa-check"
|
||||
:title="$t('common.nav.confirmClearConversations')"
|
||||
@click="onClearConversations"
|
||||
/>
|
||||
<navigator-item icon="fa-solid fa-arrow-right-from-bracket" :title="$t('common.nav.logOut')" @click="onLogout" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ROUTE_CONVERSATION_DETAIL, ROUTE_CONVERSATION_NEW } from '@/router';
|
||||
import { defineComponent } from 'vue';
|
||||
import NavigatorItem from './NavigatorItem.vue';
|
||||
import ConversationNavigatorItem from '../conversation/ConversationNavigatorItem.vue';
|
||||
import { IConversation } from '@/operators/conversation/models';
|
||||
import SettingPanel from './SettingPanel.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'LeftNavigator',
|
||||
components: {
|
||||
NavigatorItem,
|
||||
ConversationNavigatorItem,
|
||||
SettingPanel
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
confirming: false,
|
||||
setting: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
conversations() {
|
||||
return this.$store.getters.conversations;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onNewConversation() {
|
||||
this.$router.push({
|
||||
name: ROUTE_CONVERSATION_NEW
|
||||
});
|
||||
},
|
||||
onClearConversations() {
|
||||
this.$store.dispatch('setConversations', []);
|
||||
this.confirming = false;
|
||||
this.onNewConversation();
|
||||
},
|
||||
onSelectConversation(id: string) {
|
||||
this.$router.push({
|
||||
name: ROUTE_CONVERSATION_DETAIL,
|
||||
params: {
|
||||
id
|
||||
}
|
||||
});
|
||||
},
|
||||
onLogout() {
|
||||
this.$store.dispatch('resetAuth');
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
},
|
||||
onUpdateTitle(conversation: IConversation, val: string) {
|
||||
conversation.title = val;
|
||||
this.$store.dispatch('setConversations', this.conversations);
|
||||
},
|
||||
onDeleteConversation(id: string) {
|
||||
const newConversations = this.conversations.filter((i: IConversation) => i.id !== id);
|
||||
this.$store.dispatch('setConversations', newConversations);
|
||||
this.onNewConversation();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navigator {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #202123;
|
||||
color: white;
|
||||
height: 100%;
|
||||
padding: 15px 5px;
|
||||
font-size: 14px;
|
||||
.conversations {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.operators {
|
||||
height: fit-content;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,59 +0,0 @@
|
||||
<template>
|
||||
<div class="navigation-item">
|
||||
<div class="icon">
|
||||
<font-awesome-icon :icon="icon" class="icon-rotate" />
|
||||
</div>
|
||||
<div class="title">
|
||||
{{ title }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'NavigatorItem',
|
||||
components: {
|
||||
FontAwesomeIcon
|
||||
},
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.navigation-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
cursor: pointer;
|
||||
height: 44px;
|
||||
margin-top: 5px;
|
||||
padding: 0 15px;
|
||||
line-height: 44px;
|
||||
border-radius: 3px;
|
||||
&:hover {
|
||||
background-color: hsla(240, 9%, 59%, 0.1);
|
||||
}
|
||||
.icon {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
min-width: 30px;
|
||||
}
|
||||
.title {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<div class="left">
|
||||
<navigator />
|
||||
</div>
|
||||
<div class="main">
|
||||
<sidebar class="sidebar" />
|
||||
<router-view />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import Navigator from '@/components/common/Navigator.vue';
|
||||
import Sidebar from '@/components/chat/Sidebar.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'LayoutChat',
|
||||
components: {
|
||||
Sidebar,
|
||||
Navigator
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.left {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
border-right: 1px solid var(--el-border-color);
|
||||
}
|
||||
.main {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.sidebar {
|
||||
display: block;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,111 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<el-aside class="aside">
|
||||
<left-navigator />
|
||||
</el-aside>
|
||||
<el-main class="main"> <router-view /> </el-main>
|
||||
<el-button round class="menu" @click="drawer = true">
|
||||
<font-awesome-icon icon="fa-solid fa-bars" class="icon-menu" />
|
||||
</el-button>
|
||||
<el-drawer v-model="drawer" :with-header="false" size="50%" class="drawer">
|
||||
<left-navigator />
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMain, ElAside, ElButton, ElDrawer } from 'element-plus';
|
||||
import LeftNavigator from '@/components/common/LeftNavigator.vue';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'LayoutConversation',
|
||||
components: {
|
||||
ElMain,
|
||||
ElAside,
|
||||
ElDrawer,
|
||||
ElButton,
|
||||
LeftNavigator,
|
||||
FontAwesomeIcon
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
drawer: false
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.drawer {
|
||||
.el-drawer__body {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
max-width: initial;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
$width: 300px;
|
||||
.aside {
|
||||
width: $width;
|
||||
height: 100%;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.main {
|
||||
width: calc(100% - $width);
|
||||
background-color: #f3f5f6;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.container {
|
||||
display: block;
|
||||
}
|
||||
.aside {
|
||||
display: none;
|
||||
}
|
||||
.header {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 15px;
|
||||
padding-top: 50px;
|
||||
height: fit-content;
|
||||
overflow: hidden;
|
||||
.logo {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.main {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: block;
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
top: 10px;
|
||||
z-index: 2000;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,24 +1,21 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<sidebar class="left" :applications="applications" @click="onFetchHistory" />
|
||||
<div class="main">
|
||||
<model-selector v-model="model" class="model-selector" @select="onSelectModel" />
|
||||
<api-status
|
||||
:initializing="initializing"
|
||||
:application="application"
|
||||
:api-id="model.apiId"
|
||||
@refresh="onFetchApplications"
|
||||
/>
|
||||
<div class="dialogue">
|
||||
<introduction v-if="messages && messages.length === 0" />
|
||||
<div v-else class="messages">
|
||||
<message v-for="(message, messageIndex) in messages" :key="messageIndex" :message="message" class="message" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<input-box v-model="question" @submit="onSubmitQuestion" />
|
||||
<model-selector v-model="model" class="model-selector" @select="onSelectModel" />
|
||||
<api-status
|
||||
:initializing="initializing"
|
||||
:application="application"
|
||||
:api-id="model.apiId"
|
||||
@refresh="onFetchApplications"
|
||||
/>
|
||||
<div class="dialogue">
|
||||
<introduction v-if="messages && messages.length === 0" />
|
||||
<div v-else class="messages">
|
||||
<message v-for="(message, messageIndex) in messages" :key="messageIndex" :message="message" class="message" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<input-box v-model="question" @submit="onSubmitQuestion" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -47,12 +44,11 @@ import ModelSelector from '@/components/chat/ModelSelector.vue';
|
||||
import { ERROR_CODE_CANCELED, ERROR_CODE_UNKNOWN } from '@/constants/errorCode';
|
||||
import ApiStatus from '@/components/common/ApiStatus.vue';
|
||||
import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from '@/router';
|
||||
import Sidebar from '@/components/chat/Sidebar.vue';
|
||||
|
||||
export interface IData {
|
||||
messages: IChatMessage[];
|
||||
model: IChatModel;
|
||||
applications: IApplication[];
|
||||
applications: IApplication[] | undefined;
|
||||
question: '';
|
||||
initializing: boolean;
|
||||
applied: boolean | undefined;
|
||||
@@ -64,8 +60,7 @@ export default defineComponent({
|
||||
InputBox,
|
||||
ModelSelector,
|
||||
Message,
|
||||
ApiStatus,
|
||||
Sidebar
|
||||
ApiStatus
|
||||
},
|
||||
data(): IData {
|
||||
return {
|
||||
@@ -73,7 +68,7 @@ export default defineComponent({
|
||||
question: '',
|
||||
initializing: false,
|
||||
applied: undefined,
|
||||
applications: [],
|
||||
applications: undefined,
|
||||
messages: []
|
||||
};
|
||||
},
|
||||
@@ -82,11 +77,17 @@ export default defineComponent({
|
||||
return this.$route.params.id?.toString();
|
||||
},
|
||||
application() {
|
||||
return this.applications.find((application) => application.api?.id === this.model.apiId);
|
||||
return this.applications?.find((application) => application.api?.id === this.model.apiId);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
conversationId(val) {
|
||||
if (val) {
|
||||
this.onFetchHistory(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
console.log('mounted');
|
||||
await this.onFetchApplications();
|
||||
await this.onFetchHistory();
|
||||
},
|
||||
@@ -203,44 +204,28 @@ export default defineComponent({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow-y: scroll;
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
|
||||
.left {
|
||||
display: block;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
border-right: 1px solid #eee;
|
||||
overflow-y: scroll;
|
||||
.model-selector {
|
||||
width: max-content;
|
||||
margin: auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.main {
|
||||
.dialogue {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow-y: scroll;
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
|
||||
.model-selector {
|
||||
width: max-content;
|
||||
margin: auto;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.dialogue {
|
||||
flex: 1;
|
||||
overflow-y: scroll;
|
||||
margin: 20px 0;
|
||||
.messages {
|
||||
padding-top: 30px;
|
||||
.message {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
margin: 20px 0;
|
||||
.messages {
|
||||
padding-top: 30px;
|
||||
.message {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+25
-75
@@ -1,12 +1,9 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<sidebar class="left" :applications="applications" />
|
||||
<div class="main">
|
||||
<div class="card">
|
||||
<h2 class="title">{{ $t('chat.title.chat') }}</h2>
|
||||
<p class="description">{{ $t('chat.message.startNewChat') }}</p>
|
||||
<el-button type="primary" @click="onStart">{{ $t('common.button.new') }}</el-button>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2 class="title">{{ $t('chat.title.chat') }}</h2>
|
||||
<p class="description">{{ $t('chat.message.startNewChat') }}</p>
|
||||
<el-button type="primary" @click="onStart">{{ $t('common.button.new') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -14,60 +11,25 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElButton } from 'element-plus';
|
||||
import Sidebar from '@/components/chat/Sidebar.vue';
|
||||
import { ROUTE_CHAT_CONVERSATION_NEW } from '@/router/constants';
|
||||
import { IApplication } from '@/operators/application/models';
|
||||
import { applicationOperator } from '@/operators/application/operator';
|
||||
import {
|
||||
CHAT_MODEL_CHATGPT,
|
||||
CHAT_MODEL_CHATGPT4,
|
||||
CHAT_MODEL_CHATGPT4_BROWSING,
|
||||
CHAT_MODEL_CHATGPT_16K,
|
||||
CHAT_MODEL_CHATGPT_BROWSING
|
||||
} from '@/operators/chat/constants';
|
||||
|
||||
interface IData {
|
||||
model: string;
|
||||
drawer: boolean;
|
||||
question: string;
|
||||
initializing: boolean;
|
||||
applications: IApplication[];
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ChatIndex',
|
||||
components: {
|
||||
Sidebar,
|
||||
ElButton
|
||||
},
|
||||
data(): IData {
|
||||
return {
|
||||
model: 'chatgpt',
|
||||
initializing: false,
|
||||
drawer: false,
|
||||
question: '',
|
||||
applications: []
|
||||
question: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.onFetchApplications();
|
||||
},
|
||||
methods: {
|
||||
async onFetchApplications() {
|
||||
this.initializing = true;
|
||||
const { data: applications } = await applicationOperator.getAll({
|
||||
user_id: this.$store.state.user.id,
|
||||
api_id: [
|
||||
CHAT_MODEL_CHATGPT.apiId,
|
||||
CHAT_MODEL_CHATGPT_16K.apiId,
|
||||
CHAT_MODEL_CHATGPT_BROWSING.apiId,
|
||||
CHAT_MODEL_CHATGPT4.apiId,
|
||||
CHAT_MODEL_CHATGPT4_BROWSING.apiId
|
||||
]
|
||||
});
|
||||
this.initializing = false;
|
||||
this.applications = applications?.items;
|
||||
},
|
||||
onStart() {
|
||||
this.$router.push({
|
||||
name: ROUTE_CHAT_CONVERSATION_NEW
|
||||
@@ -79,42 +41,30 @@ export default defineComponent({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.left {
|
||||
display: block;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
.main {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
justify-content: center;
|
||||
|
||||
.card {
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
.card {
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.description {
|
||||
font-size: 14px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.description {
|
||||
font-size: 14px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
border-radius: 20px;
|
||||
}
|
||||
.el-button {
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW, ROUTE_CHAT_INDEX
|
||||
|
||||
export default {
|
||||
path: '/chat',
|
||||
component: () => import('@/layouts/Main.vue'),
|
||||
component: () => import('@/layouts/Chat.vue'),
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
|
||||
+4
-2
@@ -37,6 +37,9 @@ const store = createStore({
|
||||
...payload
|
||||
};
|
||||
},
|
||||
resetToken(state: IState): void {
|
||||
state.token = {};
|
||||
},
|
||||
setSetting(state: IState, payload: ISetting): void {
|
||||
state.setting = {
|
||||
...state.setting,
|
||||
@@ -61,8 +64,7 @@ const store = createStore({
|
||||
},
|
||||
actions: {
|
||||
resetToken({ commit }) {
|
||||
commit('setToken', {});
|
||||
removeCookies();
|
||||
commit('resetToken');
|
||||
},
|
||||
setUser({ commit }: ActionContext<IState, IState>, payload: IUser) {
|
||||
commit('setUser', payload);
|
||||
|
||||
Reference in new issue
Block a user