Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
myblogVue_django
提交
84a34baa
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看板
提交
84a34baa
编写于
5月 03, 2022
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:用化名提示文案错误修复
上级
7ac4108d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
107 addition
and
90 deletion
+107
-90
config/index.js
config/index.js
+1
-1
src/App.vue
src/App.vue
+83
-71
src/components/Login.vue
src/components/Login.vue
+1
-1
src/store/modules/user.js
src/store/modules/user.js
+22
-17
未找到文件。
config/index.js
浏览文件 @
84a34baa
...
@@ -20,7 +20,7 @@ module.exports = {
...
@@ -20,7 +20,7 @@ module.exports = {
},
},
},
},
"
/ws_api/
"
:
{
"
/ws_api/
"
:
{
target
:
"
ws://
114.116.52.53
/
"
,
target
:
"
ws://
yongma16.xyz
/
"
,
ws
:
true
,
//接受websocket请求
ws
:
true
,
//接受websocket请求
changeOrigin
:
true
,
//是否允许跨越
changeOrigin
:
true
,
//是否允许跨越
chunkOrigins
:
true
,
chunkOrigins
:
true
,
...
...
src/App.vue
浏览文件 @
84a34baa
...
@@ -24,7 +24,12 @@
...
@@ -24,7 +24,12 @@
</
template
>
</
template
>
<el-menu-item-group>
<el-menu-item-group>
<el-submenu
index=
"1-1"
>
<el-submenu
index=
"1-1"
>
<
template
slot=
"title"
>
yma16
</
template
>
<
template
slot=
"title"
>
yma16
<span
v-if=
"currentUserName"
>
{{
currentUserName
}}
</span></
template
>
<el-menu-item
index=
"1-1-1"
>
stay hungry
</el-menu-item>
<el-menu-item
index=
"1-1-1"
>
stay hungry
</el-menu-item>
<a
@
click=
"jumpToEcharts"
>
<a
@
click=
"jumpToEcharts"
>
<el-menu-item
index=
"1-1-2"
>
echarts
</el-menu-item>
<el-menu-item
index=
"1-1-2"
>
echarts
</el-menu-item>
...
@@ -129,153 +134,160 @@
...
@@ -129,153 +134,160 @@
</template>
</template>
<
script
>
<
script
>
import
store
from
"
@/store
"
;
export
default
{
export
default
{
name
:
'
App
'
,
name
:
"
App
"
,
data
()
{
data
()
{
return
{
return
{
authSlogan
:
'
yma16
'
,
authSlogan
:
"
yma16
"
,
chat_flag
:
false
,
chat_flag
:
false
,
msg
:
'
yma16
'
,
msg
:
"
yma16
"
,
navigate_flag
:
true
,
navigate_flag
:
true
,
value
:
new
Date
(),
value
:
new
Date
(),
baseUrl
:
'
/api/
'
,
baseUrl
:
"
/api/
"
,
src
:
'
https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg
'
,
src
:
"
https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg
"
,
url
:
'
/image/logo/logo.jpg
'
,
url
:
"
/image/logo/logo.jpg
"
,
srcList
:
[
srcList
:
[
'
https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg
'
,
"
https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg
"
,
'
https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg
'
"
https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg
"
,
],
],
headerData
:
[
'
从现在开始,种一棵树
'
,
'
从现在开始,种一棵树
'
],
headerData
:
[
"
从现在开始,种一棵树
"
,
"
从现在开始,种一棵树
"
],
readCount
:
0
readCount
:
0
,
}
currentUserName
:
""
,
};
},
computed
:
{
currentUserName
:
function
()
{
return
store
.
state
.
user
.
userInfo
.
name
;
},
},
},
mounted
()
{
mounted
()
{
this
.
addReadCountFun
()
this
.
addReadCountFun
()
;
this
.
readCountFun
()
this
.
readCountFun
()
;
},
},
methods
:
{
methods
:
{
jumpIpDns
:
function
()
{
jumpIpDns
:
function
()
{
try
{
try
{
window
.
open
(
'
https://beian.miit.gov.cn
'
)
window
.
open
(
"
https://beian.miit.gov.cn
"
);
}
catch
(
r
)
{
}
catch
(
r
)
{
window
.
location
.
href
=
'
https://beian.miit.gov.cn
'
window
.
location
.
href
=
"
https://beian.miit.gov.cn
"
;
throw
Error
(
r
)
throw
Error
(
r
)
;
}
}
},
},
addReadCountFun
:
function
()
{
addReadCountFun
:
function
()
{
const
that
=
this
const
that
=
this
;
let
clientIp
=
'
未知
'
let
clientIp
=
"
未知
"
;
try
{
try
{
console
.
log
(
'
ip待定
'
)
console
.
log
(
"
ip待定
"
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
;
}
}
that
.
$axios
that
.
$axios
.
post
(
this
.
baseUrl
+
'
count/add/
'
,
{
.
post
(
this
.
baseUrl
+
"
count/add/
"
,
{
ip
:
clientIp
ip
:
clientIp
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
;
})
})
.
catch
((
e
)
=>
{
.
catch
((
e
)
=>
{
throw
Error
(
e
)
throw
Error
(
e
)
;
})
})
;
},
},
readCountFun
:
function
()
{
readCountFun
:
function
()
{
let
that
=
this
let
that
=
this
;
that
.
$axios
that
.
$axios
.
get
(
that
.
baseUrl
+
'
count/get/
'
)
.
get
(
that
.
baseUrl
+
"
count/get/
"
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
this
.
readCount
=
res
.
data
.
num
this
.
readCount
=
res
.
data
.
num
;
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
error
)
console
.
log
(
error
)
;
})
})
;
},
},
changeNavigate
:
function
()
{
changeNavigate
:
function
()
{
this
.
navigate_flag
=
!
this
.
navigate_flag
// 取反
this
.
navigate_flag
=
!
this
.
navigate_flag
;
// 取反
},
},
handleOpen
(
key
,
keyPath
)
{
handleOpen
(
key
,
keyPath
)
{
console
.
log
(
key
,
keyPath
)
console
.
log
(
key
,
keyPath
)
;
if
(
key
===
'
3
'
)
{
if
(
key
===
"
3
"
)
{
console
.
log
(
'
打开3号
'
)
console
.
log
(
"
打开3号
"
);
this
.
chat_flag
=
true
this
.
chat_flag
=
true
;
this
.
onlineWebsocket
()
// 调用跳转
this
.
onlineWebsocket
()
;
// 调用跳转
}
}
if
(
key
===
'
2-1
'
)
{
if
(
key
===
"
2-1
"
)
{
this
.
chat_flag
=
false
this
.
chat_flag
=
false
;
this
.
loginAction
()
// 调用跳转
this
.
loginAction
()
;
// 调用跳转
}
}
if
(
key
===
'
2-2
'
)
{
if
(
key
===
"
2-2
"
)
{
this
.
chat_flag
=
false
this
.
chat_flag
=
false
;
this
.
registerAction
()
// 调用跳转
this
.
registerAction
()
;
// 调用跳转
}
}
},
},
handleClose
(
key
,
keyPath
)
{
handleClose
(
key
,
keyPath
)
{
console
.
info
(
key
,
keyPath
)
console
.
info
(
key
,
keyPath
)
;
if
(
key
===
'
3
'
)
{
if
(
key
===
"
3
"
)
{
this
.
chat_flag
=
false
this
.
chat_flag
=
false
;
}
}
},
},
jumpRouter
:
function
(
params
)
{
jumpRouter
:
function
(
params
)
{
this
.
$router
this
.
$router
.
push
({
.
push
({
name
:
`
${
params
}
`
name
:
`
${
params
}
`
,
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
error
)
console
.
log
(
error
)
;
})
})
;
},
},
onlineWebsocket
:
function
()
{
onlineWebsocket
:
function
()
{
// console.log(this.$router);
// console.log(this.$router);
this
.
$router
this
.
$router
.
push
({
.
push
({
path
:
'
/onlinewebsocket
'
path
:
"
/onlinewebsocket
"
,
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
throw
Error
(
error
)
throw
Error
(
error
)
;
})
})
;
},
},
jumpToEcharts
:
function
()
{
jumpToEcharts
:
function
()
{
// console.log(this.$router);
// console.log(this.$router);
this
.
$router
this
.
$router
.
push
({
.
push
({
path
:
'
/bilicom
'
path
:
"
/bilicom
"
,
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
error
)
console
.
log
(
error
)
;
})
})
;
},
},
jumpToAdmin
:
function
()
{
jumpToAdmin
:
function
()
{
this
.
$router
this
.
$router
.
push
({
.
push
({
path
:
'
/mavoneditor
'
path
:
"
/mavoneditor
"
,
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
error
)
console
.
log
(
error
)
;
})
})
;
},
},
loginAction
:
function
()
{
loginAction
:
function
()
{
this
.
$router
this
.
$router
.
push
({
.
push
({
path
:
'
/login
'
path
:
"
/login
"
,
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
error
)
console
.
log
(
error
)
;
})
})
;
},
},
registerAction
:
function
()
{
registerAction
:
function
()
{
this
.
$router
this
.
$router
.
push
({
.
push
({
path
:
'
/register
'
path
:
"
/register
"
,
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
console
.
log
(
error
)
console
.
log
(
error
)
;
})
})
;
}
}
,
}
}
,
}
}
;
</
script
>
</
script
>
<
style
>
<
style
>
...
...
src/components/Login.vue
浏览文件 @
84a34baa
...
@@ -127,7 +127,7 @@ export default {
...
@@ -127,7 +127,7 @@ export default {
// 添加cookie
// 添加cookie
}
else
if
(
res
.
data
.
code
==
0
)
{
}
else
if
(
res
.
data
.
code
==
0
)
{
// alter("失败!" res.data.msg)
// alter("失败!" res.data.msg)
that
.
$message
.
error
(
'
用化名或密码错误
'
);
that
.
$message
.
error
(
"
用户名或密码错误
"
);
}
}
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
...
...
src/store/modules/user.js
浏览文件 @
84a34baa
import
{
loginUser
}
from
'
@/service/user.service
'
import
{
loginUser
}
from
"
@/service/user.service
"
;
export
default
{
export
default
{
// 自带命名空间
// 自带命名空间
namespaced
:
true
,
namespaced
:
true
,
state
:
{
state
:
{
// 用户账号密码
// 用户账号密码
userInfo
:
null
userInfo
:
{
name
:
null
,
password
:
null
,
},
},
},
getters
:
{
getters
:
{
userInfo
:
state
=>
{
return
state
.
userInfo
}
userInfo
:
(
state
)
=>
{
return
state
.
userInfo
;
},
},
},
mutations
:
{
mutations
:
{
// 配置用户登录信息 userInfo
// 配置用户登录信息 userInfo
setUserInfo
(
state
,
userInfo
)
{
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
state
.
userInfo
=
userInfo
;
}
}
,
},
},
actions
:
{
actions
:
{
// Promise
// Promise
loginUserInfo
({
commit
},
info
)
{
loginUserInfo
({
commit
},
info
)
{
console
.
log
(
'
登录认证 store里面
'
,
'
info
'
,
info
)
console
.
log
(
"
登录认证 store里面
"
,
"
info
"
,
info
);
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
try
{
try
{
let
data
=
await
loginUser
(
info
)
let
data
=
await
loginUser
(
info
)
;
// 等待登录信息
// 等待登录信息
console
.
log
(
'
返回的post
'
,
data
)
console
.
log
(
"
返回的post
"
,
data
);
// 调用 mutation
// 调用 mutation
commit
(
'
setUserInfo
'
,
data
)
commit
(
"
setUserInfo
"
,
info
);
resolve
(
data
)
resolve
(
data
)
;
}
catch
(
error
)
{
}
catch
(
error
)
{
reject
(
error
)
reject
(
error
)
;
}
}
})
})
;
}
}
,
}
}
,
}
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录