mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 08:46:38 +08:00
fix: unbind event for login page when the component is unmount
This commit is contained in:
parent
998cbace92
commit
64d6bff6d9
@ -42,7 +42,7 @@ ChatGLM,讯飞星火,文心一言等多个平台的大语言模型。集成了
|
||||
|
||||
### 会员充值
|
||||
|
||||

|
||||

|
||||
|
||||
### 自动调用函数插件
|
||||
|
||||
@ -437,8 +437,7 @@ make clean linux
|
||||
|
||||
如果你觉得这个项目对你有帮助,并且情况允许的话,可以请作者喝杯咖啡,非常感谢你的支持~
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
version: '3'
|
||||
services:
|
||||
# 后端 API 程序
|
||||
mysql:
|
||||
image: mysql:8.0.33
|
||||
container_name: chatgpt-plus-mysql
|
||||
|
BIN
docs/imgs/donate.png
Normal file
BIN
docs/imgs/donate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Binary file not shown.
Before Width: | Height: | Size: 88 KiB |
@ -48,7 +48,7 @@
|
||||
|
||||
<script setup>
|
||||
|
||||
import {onMounted, ref} from "vue";
|
||||
import {onMounted, onUnmounted, ref} from "vue";
|
||||
import {Lock, UserFilled} from "@element-plus/icons-vue";
|
||||
import {httpPost} from "@/utils/http";
|
||||
import {ElMessage} from "element-plus";
|
||||
@ -74,12 +74,17 @@ checkSession().then(() => {
|
||||
}).catch(() => {
|
||||
})
|
||||
|
||||
const handleKeyup = (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
login();
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('keyup', (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
login();
|
||||
}
|
||||
});
|
||||
document.addEventListener('keyup', handleKeyup)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('keyup', handleKeyup)
|
||||
})
|
||||
|
||||
const login = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user