提交 | 用户 | age
|
36e1de
|
1 |
<!--index.vue--> |
L |
2 |
<template> |
|
3 |
<div> |
|
4 |
<div class="chat-wrap"> |
|
5 |
<!-- 聊天人名称 --> |
|
6 |
<!-- <div class="chat-title">chatGPT</div> --> |
|
7 |
|
|
8 |
<!-- 聊天内容 --> |
|
9 |
<chatList |
|
10 |
ref="refChatList" |
|
11 |
:userid="id" |
|
12 |
/> |
|
13 |
|
|
14 |
</div> |
|
15 |
</div> |
|
16 |
</template> |
|
17 |
|
|
18 |
<script> |
|
19 |
import Login from '../utils/jun_login.js' |
|
20 |
import chatList from '@/components/ChatList/chat_list' |
|
21 |
export default { |
|
22 |
name: 'Index', |
|
23 |
components: { chatList }, |
|
24 |
inject: ['noop'], |
|
25 |
data() { |
|
26 |
return { |
|
27 |
id: '', |
|
28 |
|
|
29 |
chatInfo: '' |
|
30 |
} |
|
31 |
}, |
|
32 |
computed: {}, |
|
33 |
mounted() { |
|
34 |
console.log('index mounted') |
|
35 |
this.init() |
|
36 |
}, |
|
37 |
destroyed() {}, |
|
38 |
methods: { |
|
39 |
init() { |
|
40 |
}, |
|
41 |
|
|
42 |
login() { |
|
43 |
const code = this.getQueryString('code') |
|
44 |
Login.loginReq({ |
|
45 |
data: { |
|
46 |
code |
|
47 |
} |
|
48 |
}).then((res) => { |
|
49 |
this.setLocalStorage('code', code || '') |
|
50 |
}).catch((res) => { |
|
51 |
if (res.data.msg.indexOf('用户') > -1) { |
|
52 |
Login.toLongUrl() |
|
53 |
} else { |
|
54 |
window.appToast(res.data.msg) |
|
55 |
} |
|
56 |
}) |
|
57 |
} |
|
58 |
} |
|
59 |
} |
|
60 |
</script> |
|
61 |
|
|
62 |
<style scoped> |
|
63 |
.chat-wrap{ |
|
64 |
background-color: #fff; |
|
65 |
width: 100%; |
|
66 |
box-sizing: border-box; |
|
67 |
margin: 0 auto; |
|
68 |
} |
|
69 |
.chat-title{ |
|
70 |
height: 60PX; |
|
71 |
line-height: 60PX; |
|
72 |
font-size: 28px; |
|
73 |
border-bottom: 1px solid #dcdfe6; |
|
74 |
margin-left: 20px; |
|
75 |
} |
|
76 |
</style> |