Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f8d5fd6e49
@ -14,7 +14,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.27.2",
|
||||
"element-plus": "^2.4.3",
|
||||
"element-plus": "^2.5.3",
|
||||
"install": "^0.13.0",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-it": "^13.0.2",
|
||||
|
||||
@ -211,7 +211,7 @@ const prologueList = computed(() => {
|
||||
const temp = props.data?.prologue
|
||||
let arr: any = []
|
||||
const lines = temp?.split('\n')
|
||||
lines.forEach((str: string, index: number) => {
|
||||
lines?.forEach((str: string, index: number) => {
|
||||
if (isMdArray(str)) {
|
||||
arr[index] = {
|
||||
type: 'question',
|
||||
@ -292,7 +292,8 @@ function getChartOpenId() {
|
||||
chatMessage()
|
||||
})
|
||||
.catch((res) => {
|
||||
if (res.response.status === 401) {
|
||||
console.log(res)
|
||||
if (res.response.status === 403) {
|
||||
application.asyncAppAuthentication(accessToken).then(() => {
|
||||
getChartOpenId()
|
||||
})
|
||||
@ -405,26 +406,33 @@ function chatMessage() {
|
||||
record_id: '',
|
||||
vote_status: '-1'
|
||||
})
|
||||
chatList.value.push(chat)
|
||||
inputValue.value = ''
|
||||
nextTick(() => {
|
||||
// 将滚动条滚动到最下面
|
||||
scrollDiv.value.setScrollTop(Number.MAX_SAFE_INTEGER)
|
||||
})
|
||||
// 对话
|
||||
applicationApi
|
||||
.postChatMessage(chartOpenId.value, problem_text)
|
||||
.then((response) => {
|
||||
ChatManagement.addChatRecord(chat, 50, loading)
|
||||
ChatManagement.write(chat.id)
|
||||
const reader = response.body.getReader()
|
||||
// 处理流数据
|
||||
const write = getWrite(
|
||||
chat,
|
||||
reader,
|
||||
response.headers.get('Content-Type') !== 'application/json'
|
||||
)
|
||||
return reader.read().then(write)
|
||||
console.log(response.status)
|
||||
if (response.status === 401) {
|
||||
application.asyncAppAuthentication(accessToken).then(() => {
|
||||
chatMessage()
|
||||
})
|
||||
} else {
|
||||
chatList.value.push(chat)
|
||||
inputValue.value = ''
|
||||
nextTick(() => {
|
||||
// 将滚动条滚动到最下面
|
||||
scrollDiv.value.setScrollTop(Number.MAX_SAFE_INTEGER)
|
||||
})
|
||||
ChatManagement.addChatRecord(chat, 50, loading)
|
||||
ChatManagement.write(chat.id)
|
||||
const reader = response.body.getReader()
|
||||
// 处理流数据
|
||||
const write = getWrite(
|
||||
chat,
|
||||
reader,
|
||||
response.headers.get('Content-Type') !== 'application/json'
|
||||
)
|
||||
return reader.read().then(write)
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
return !props.appId && getSourceDetail(chat)
|
||||
|
||||
@ -2,15 +2,8 @@
|
||||
<div class="login-warp flex-center">
|
||||
<div class="login-container w-full h-full">
|
||||
<el-row class="container w-full h-full">
|
||||
<el-col
|
||||
:xs="0"
|
||||
:sm="0"
|
||||
:md="10"
|
||||
:lg="10"
|
||||
:xl="10"
|
||||
class="left-container"
|
||||
v-if="screenWidth && screenWidth >= 990"
|
||||
>
|
||||
<!-- v-if="screenWidth && screenWidth >= 990" -->
|
||||
<el-col :xs="0" :sm="0" :md="10" :lg="10" :xl="10" class="left-container">
|
||||
<div class="login-image"></div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="14" class="right-container flex-center">
|
||||
@ -21,18 +14,18 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
// import { ref, onMounted } from 'vue'
|
||||
// import type { Ref } from 'vue'
|
||||
defineOptions({ name: 'LoginLayout' })
|
||||
const screenWidth: Ref<number | null> = ref(null)
|
||||
onMounted(() => {
|
||||
screenWidth.value = document.body.clientWidth
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
screenWidth.value = document.body.clientWidth
|
||||
})()
|
||||
}
|
||||
})
|
||||
// const screenWidth: Ref<number | null> = ref(null)
|
||||
// onMounted(() => {
|
||||
// screenWidth.value = document.body.clientWidth
|
||||
// window.onresize = () => {
|
||||
// return (() => {
|
||||
// screenWidth.value = document.body.clientWidth
|
||||
// })()
|
||||
// }
|
||||
// })
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.login-warp {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user