Refine and clean files and variables (#10)

This commit is contained in:
AceDataCloud committed 2024-01-02 01:27:14 +08:00
1 parent 0e6018e9b2
commit 6e980c7c34
45 files changed
+98 -522

No files matched your search

+2 -2
View File
@@ -38,10 +38,10 @@ export default defineComponent({
const user = await this.$store.dispatch('getUser');
this.user = user;
if (this.redirect) {
this.$router.push(this.redirect);
await this.$router.push(this.redirect);
}
} else {
this.$router.push({ name: ROUTE_AUTH_LOGIN });
await this.$router.push({ name: ROUTE_AUTH_LOGIN });
}
}
});
+3 -3
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { getAuthBaseUrl, getHubBaseUrl } from '@/utils';
import { getBaseUrlAuth, getBaseUrlHub } from '@/utils';
import { defineComponent } from 'vue';
interface IData {
@@ -14,8 +14,8 @@ export default defineComponent({
};
},
async mounted() {
const hubBaseUrl = getHubBaseUrl();
const authBaseUrl = getAuthBaseUrl();
const hubBaseUrl = getBaseUrlHub();
const authBaseUrl = getBaseUrlAuth();
// callback url used to init access token and then redirect back of `redirect`
const callbackUrl = `${hubBaseUrl}/auth/callback?redirect=${this.redirect}`;
// redirect to auth service to get access token then redirect back
-71
View File
@@ -1,71 +0,0 @@
<template>
<div class="page">
<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>
<script lang="ts">
import { defineComponent } from 'vue';
import { ElButton } from 'element-plus';
import { ROUTE_CHAT_CONVERSATION_NEW } from '@/router/constants';
interface IData {
model: string;
question: string;
}
export default defineComponent({
name: 'ChatIndex',
components: {
ElButton
},
data(): IData {
return {
model: 'chatgpt',
question: ''
};
},
methods: {
onStart() {
this.$router.push({
name: ROUTE_CHAT_CONVERSATION_NEW
});
}
}
});
</script>
<style lang="scss" scoped>
.page {
flex: 1;
overflow: hidden;
position: relative;
align-items: center;
display: flex;
justify-content: 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;
}
.el-button {
border-radius: 20px;
}
}
}
</style>
+1 -1
View File
@@ -70,7 +70,7 @@
import { defineComponent } from 'vue';
import Pagination from '@/components/common/Pagination.vue';
import CopyToClipboard from '@/components/common/CopyToClipboard.vue';
import { ElRow, ElCol, ElTable, ElTableColumn, ElButton, ElTag, ElCard } from 'element-plus';
import { ElRow, ElCol, ElTable, ElTableColumn, ElCard } from 'element-plus';
import { distributionHistoryOperator, IDistributionHistory, IDistributionStatus } from '@/operators/distribution';
interface IData {
+1 -2
View File
@@ -184,7 +184,6 @@ import {
ElButton,
ElCard,
ElDivider,
ElInput,
ElTooltip,
ElSkeleton
} from 'element-plus';
@@ -193,7 +192,7 @@ import {
distributionStatusOperator,
IDistributionLevel,
IDistributionStatus
} from '@/operators/distribution';
} from '@/operators';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { ROUTE_CONSOLE_DISTRIBUTION_HISTORY, ROUTE_CONSOLE_DISTRIBUTION_INVITEES } from '@/router';
import { IUser, userOperator } from '@/operators';