Fix auth and experience issue (#87)
Co-authored-by: Germey <germey@acedata.cloud>
This commit is contained in:
1 parent
c7c755fcd6
commit
558eadb63c
24 files changed
+235
-427
No files matched your search
@@ -15,6 +15,8 @@ export default defineComponent({
|
||||
async mounted() {
|
||||
if (this.redirect) {
|
||||
await this.$router.push(this.redirect);
|
||||
} else {
|
||||
await this.$router.push('/');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ export default defineComponent({
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
login(this.redirect);
|
||||
login({ redirect: this.redirect });
|
||||
},
|
||||
methods: {}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<layout>
|
||||
<template #chat>
|
||||
<model-selector2 class="selector" />
|
||||
<model-selector class="selector" />
|
||||
<application-status
|
||||
:initializing="initializing"
|
||||
:application="application"
|
||||
@@ -43,7 +43,7 @@ import Message from '@/components/chat/Message.vue';
|
||||
import { ROLE_ASSISTANT, ROLE_USER } from '@/constants';
|
||||
import { IChatModel, IChatMessageState, IChatConversationResponse, IChatConversation, IChatMessage } from '@/models';
|
||||
import InputBox from '@/components/chat/InputBox.vue';
|
||||
import ModelSelector2 from '@/components/chat/ModelSelector2.vue';
|
||||
import ModelSelector from '@/components/chat/ModelSelector.vue';
|
||||
import { ERROR_CODE_CANCELED, ERROR_CODE_NOT_APPLIED, ERROR_CODE_UNKNOWN } from '@/constants/errorCode';
|
||||
import { ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW } from '@/router';
|
||||
import { Status } from '@/models';
|
||||
@@ -65,7 +65,7 @@ export default defineComponent({
|
||||
components: {
|
||||
InputBox,
|
||||
Introduction,
|
||||
ModelSelector2,
|
||||
ModelSelector,
|
||||
Message,
|
||||
ApplicationStatus,
|
||||
Layout
|
||||
@@ -177,6 +177,7 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
this.messages.push({
|
||||
// @ts-ignore
|
||||
content: content,
|
||||
role: ROLE_USER
|
||||
});
|
||||
@@ -284,6 +285,7 @@ export default defineComponent({
|
||||
if (isJSONString(data)) {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
console.debug('error', data);
|
||||
if (this.messages && this.messages.length > 0) {
|
||||
this.messages[this.messages.length - 1].error = data.error;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ import {
|
||||
ROLE_ASSISTANT,
|
||||
ROLE_USER
|
||||
} from '@/constants';
|
||||
import { log } from '@/utils';
|
||||
import { ROUTE_CHATDOC_CONVERSATION } from '@/router';
|
||||
import axios from 'axios';
|
||||
import { isJSONString } from '@/utils/is';
|
||||
@@ -142,7 +141,7 @@ export default defineComponent({
|
||||
async onFetchAnswer() {
|
||||
const token = this.credential?.token;
|
||||
const question = this.question;
|
||||
log(this.onFetchAnswer, 'validated', question);
|
||||
console.debug(this.onFetchAnswer, 'validated', question);
|
||||
// reset question and references
|
||||
this.question = '';
|
||||
if (!token || !question) {
|
||||
@@ -162,7 +161,7 @@ export default defineComponent({
|
||||
role: ROLE_ASSISTANT,
|
||||
state: IChatdocMessageState.PENDING
|
||||
});
|
||||
log(this.onFetchAnswer, 'start to get answer', this.messages);
|
||||
console.debug('start to get answer', this.messages);
|
||||
this.onScrollDown();
|
||||
// request server to get answer
|
||||
this.answering = true;
|
||||
@@ -187,7 +186,7 @@ export default defineComponent({
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
log(this.onFetchAnswer, 'finished fetch answer');
|
||||
console.debug('finished fetch answer');
|
||||
this.messages[this.messages.length - 1].state = IChatdocMessageState.FINISHED;
|
||||
await this.$store.dispatch('chatdoc/setConversation', {
|
||||
id: conversationId,
|
||||
|
||||
@@ -224,6 +224,7 @@ export default defineComponent({
|
||||
console.debug('start onGetApplication');
|
||||
await this.$store.dispatch('midjourney/getApplication');
|
||||
console.debug('end onGetApplication');
|
||||
await this.onGetTasks();
|
||||
},
|
||||
onApply() {
|
||||
applicationOperator
|
||||
|
||||
@@ -100,6 +100,7 @@ export default defineComponent({
|
||||
console.debug('start onGetApplication');
|
||||
await this.$store.dispatch('qrart/getApplication');
|
||||
console.debug('end onGetApplication');
|
||||
await this.onGetTasks();
|
||||
},
|
||||
onApply() {
|
||||
applicationOperator
|
||||
|
||||
@@ -121,6 +121,7 @@ export default defineComponent({
|
||||
console.debug('start onGetApplication');
|
||||
await this.$store.dispatch('suno/getApplication');
|
||||
console.debug('end onGetApplication');
|
||||
await this.onGetTasks();
|
||||
},
|
||||
onApply() {
|
||||
applicationOperator
|
||||
|
||||
Reference in new issue
Block a user