Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
myblogVue_django
提交
e4729cb0
M
myblogVue_django
项目概览
yma16
/
myblogVue_django
通知
5
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
myblogVue_django
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e4729cb0
编写于
8月 14, 2023
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf:聊天室获取名称
上级
4bdf506b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
42 addition
and
9 deletion
+42
-9
config/index.js
config/index.js
+0
-1
src/App.vue
src/App.vue
+10
-5
src/components/comment/ArticleComment.vue
src/components/comment/ArticleComment.vue
+2
-2
src/components/user/Login.vue
src/components/user/Login.vue
+16
-0
src/components/websocket/Onlinewebsocket.vue
src/components/websocket/Onlinewebsocket.vue
+13
-1
src/importElement.js
src/importElement.js
+1
-0
未找到文件。
config/index.js
浏览文件 @
e4729cb0
...
...
@@ -32,7 +32,6 @@ module.exports = {
"
/third-login/
"
:
{
target
:
"
https://yongma16.xyz/third-login/
"
,
//后端接口地址
ws
:
true
,
//接受websocket请求
changeOrigin
:
true
,
//是否允许跨越
chunkOrigins
:
true
,
pathRewrite
:
{
...
...
src/App.vue
浏览文件 @
e4729cb0
...
...
@@ -80,18 +80,23 @@
<!-- > 在线聊天室</i-->
<!-- >-->
<div
style=
"float: right; overflow: hidden;display: flex;justify-items: center;align-items:center;word-spacing: 16px;"
>
<el-avatar
v-if=
"currentUserImg"
:src=
"currentUserImg"
></el-avatar>
<span
style=
"cursor: pointer;padding-right: 50px"
v-if=
"currentUserName"
>
<el-popover
trigger=
"click"
>
<div
style=
"display: flex;align-items: center;justify-items: center;justify-content: space-between;font-family: Arial"
>
<span
@
click=
"loginOut"
style=
"cursor: pointer; height: 16px"
>
注销
</span>
</div>
<
template
slot=
"reference"
>
<div
style=
"display: flex;align-items: center;justify-items: center;justify-content: space-between;font-family: Arial"
>
<el-avatar
v-if=
"currentUserImg"
@
click=
"loginOut"
:src=
"currentUserImg"
></el-avatar>
<i
style=
"font-weight: 300"
v-if=
"currentUserImg"
>
{{
currentUserName
}}
</i>
<i
class=
"el-icon-user"
style=
"font-weight: 300"
v-else
>
{{
currentUserName
}}
</i>
</div>
</
template
>
</el-popover>
...
...
src/components/comment/ArticleComment.vue
浏览文件 @
e4729cb0
...
...
@@ -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
{
...
...
src/components/user/Login.vue
浏览文件 @
e4729cb0
...
...
@@ -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
)
}
})
...
...
src/components/websocket/Onlinewebsocket.vue
浏览文件 @
e4729cb0
...
...
@@ -125,7 +125,7 @@
</template>
<
script
>
import
store
from
'
@/store
'
export
default
{
name
:
'
Onlinewebsocket
'
,
data
()
{
...
...
@@ -158,8 +158,19 @@ export default {
mounted
()
{
// 判断是否登录
this
.
judeIsLogin
()
this
.
initUserName
()
},
methods
:
{
initUserName
()
{
const
thirdUserInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'
thirdUserInfo
'
))
const
currentUsername
=
store
.
state
.
user
.
userInfo
&&
store
.
state
.
user
.
userInfo
.
thirdUserInfo
?
store
.
state
.
user
.
userInfo
.
thirdUserInfo
.
nickname
:
store
.
state
.
user
.
userInfo
.
name
?
store
.
state
.
user
.
userInfo
.
name
:
''
this
.
user
=
currentUsername
if
(
thirdUserInfo
&&
thirdUserInfo
.
nickName
)
{
this
.
user
=
thirdUserInfo
.
nickName
}
this
.
registerUsername
()
},
judeIsLogin
()
{
try
{
console
.
log
(
...
...
@@ -407,6 +418,7 @@ export default {
let
selectNameDom
=
document
.
getElementById
(
'
selectNameId
'
)
console
.
log
(
selectNameDom
)
selectNameDom
.
style
.
display
=
'
block
'
this
.
initRoom
()
// 触发减一
}
},
...
...
src/importElement.js
浏览文件 @
e4729cb0
...
...
@@ -60,6 +60,7 @@ const importElementComponents = (Vue) => {
Vue
.
use
(
Popover
)
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$notify
=
Notification
Vue
.
prototype
.
$loading
=
Loading
.
service
}
export
default
importElementComponents
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录