From e4729cb089c823b79aedf21060133a81489abe8f Mon Sep 17 00:00:00 2001
From: yma16 <17685043634@163.com>
Date: Mon, 14 Aug 2023 00:59:16 +0800
Subject: [PATCH] =?UTF-8?q?perf:=E8=81=8A=E5=A4=A9=E5=AE=A4=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/index.js | 1 -
src/App.vue | 15 ++++++++++-----
src/components/comment/ArticleComment.vue | 4 ++--
src/components/user/Login.vue | 16 ++++++++++++++++
src/components/websocket/Onlinewebsocket.vue | 14 +++++++++++++-
src/importElement.js | 1 +
6 files changed, 42 insertions(+), 9 deletions(-)
diff --git a/config/index.js b/config/index.js
index 2b30a2d..4319040 100644
--- a/config/index.js
+++ b/config/index.js
@@ -32,7 +32,6 @@ module.exports = {
"/third-login/": {
target: "https://yongma16.xyz/third-login/", //后端接口地址
- ws: true, //接受websocket请求
changeOrigin: true, //是否允许跨越
chunkOrigins: true,
pathRewrite: {
diff --git a/src/App.vue b/src/App.vue
index c389d57..40ea18e 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -80,18 +80,23 @@
-
+
+
注销
+
+
+
{{currentUserName}}
{{currentUserName}}
-
+
diff --git a/src/components/comment/ArticleComment.vue b/src/components/comment/ArticleComment.vue
index 5b4f48d..39932be 100644
--- a/src/components/comment/ArticleComment.vue
+++ b/src/components/comment/ArticleComment.vue
@@ -193,14 +193,14 @@ export default {
position: relative;
width: 100%;
height: auto;
+ box-sizing: border-box;
background: rgba(187, 168, 164, 0.8);
}
.contentClass {
position: relative;
width: 100%;
- margin: 10px;
- padding: 5px;
+ overflow: auto;
}
.postComment {
diff --git a/src/components/user/Login.vue b/src/components/user/Login.vue
index b62e84b..b7d4185 100644
--- a/src/components/user/Login.vue
+++ b/src/components/user/Login.vue
@@ -293,6 +293,7 @@ export default {
}
},
submitForm (formName) {
+ localStorage.removeItem('thirdUserInfo')
const that = this // this指向
this.$refs[formName].validate((valid) => {
if (valid) {
@@ -337,6 +338,12 @@ export default {
async registerThirdLogin () {
const that = this
return new Promise(async (resolve, reject) => {
+ const loading = that.$loading({
+ lock: true,
+ text: '登录中...',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
try {
const res = await that.$axios
.post(that.baseUrl + 'user/register/', {
@@ -357,10 +364,19 @@ export default {
'yma16siteUserInfo',
JSON.stringify(userInfo)
)
+ localStorage.setItem(
+ 'thirdUserInfo',
+ JSON.stringify({
+ qOpenid: that.thirdLoginConfig.qOpenid,
+ nickName: that.thirdLoginConfig.nickName
+ })
+ )
that.$router.push({ path: '/' })
+ loading.close()
resolve(userInfo)
} catch (e) {
console.log('注册三方账号失败')
+ loading.close()
reject(e)
}
})
diff --git a/src/components/websocket/Onlinewebsocket.vue b/src/components/websocket/Onlinewebsocket.vue
index 67d3c45..d32c069 100644
--- a/src/components/websocket/Onlinewebsocket.vue
+++ b/src/components/websocket/Onlinewebsocket.vue
@@ -125,7 +125,7 @@