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 = {
},
},
"
/ws_api/
"
:
{
target
:
"
ws://
114.116.52.53
/
"
,
target
:
"
ws://
yongma16.xyz
/
"
,
ws
:
true
,
//接受websocket请求
changeOrigin
:
true
,
//是否允许跨越
chunkOrigins
:
true
,
...
...
src/App.vue
浏览文件 @
84a34baa
...
...
@@ -24,7 +24,12 @@
</
template
>
<el-menu-item-group>
<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>
<a
@
click=
"jumpToEcharts"
>
<el-menu-item
index=
"1-1-2"
>
echarts
</el-menu-item>
...
...
@@ -129,153 +134,160 @@
</template>
<
script
>
import
store
from
"
@/store
"
;
export
default
{
name
:
'
App
'
,
data
()
{
name
:
"
App
"
,
data
()
{
return
{
authSlogan
:
'
yma16
'
,
authSlogan
:
"
yma16
"
,
chat_flag
:
false
,
msg
:
'
yma16
'
,
msg
:
"
yma16
"
,
navigate_flag
:
true
,
value
:
new
Date
(),
baseUrl
:
'
/api/
'
,
src
:
'
https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg
'
,
url
:
'
/image/logo/logo.jpg
'
,
baseUrl
:
"
/api/
"
,
src
:
"
https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg
"
,
url
:
"
/image/logo/logo.jpg
"
,
srcList
:
[
'
https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg
'
,
'
https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg
'
"
https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg
"
,
"
https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg
"
,
],
headerData
:
[
'
从现在开始,种一棵树
'
,
'
从现在开始,种一棵树
'
],
readCount
:
0
}
headerData
:
[
"
从现在开始,种一棵树
"
,
"
从现在开始,种一棵树
"
],
readCount
:
0
,
currentUserName
:
""
,
};
},
computed
:
{
currentUserName
:
function
()
{
return
store
.
state
.
user
.
userInfo
.
name
;
},
mounted
()
{
this
.
addReadCountFun
()
this
.
readCountFun
()
},
mounted
()
{
this
.
addReadCountFun
();
this
.
readCountFun
();
},
methods
:
{
jumpIpDns
:
function
()
{
try
{
window
.
open
(
'
https://beian.miit.gov.cn
'
)
window
.
open
(
"
https://beian.miit.gov.cn
"
);
}
catch
(
r
)
{
window
.
location
.
href
=
'
https://beian.miit.gov.cn
'
throw
Error
(
r
)
window
.
location
.
href
=
"
https://beian.miit.gov.cn
"
;
throw
Error
(
r
)
;
}
},
addReadCountFun
:
function
()
{
const
that
=
this
let
clientIp
=
'
未知
'
const
that
=
this
;
let
clientIp
=
"
未知
"
;
try
{
console
.
log
(
'
ip待定
'
)
console
.
log
(
"
ip待定
"
);
}
catch
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
;
}
that
.
$axios
.
post
(
this
.
baseUrl
+
'
count/add/
'
,
{
ip
:
clientIp
.
post
(
this
.
baseUrl
+
"
count/add/
"
,
{
ip
:
clientIp
,
})
.
then
((
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
;
})
.
catch
((
e
)
=>
{
throw
Error
(
e
)
})
throw
Error
(
e
)
;
})
;
},
readCountFun
:
function
()
{
let
that
=
this
let
that
=
this
;
that
.
$axios
.
get
(
that
.
baseUrl
+
'
count/get/
'
)
.
get
(
that
.
baseUrl
+
"
count/get/
"
)
.
then
((
res
)
=>
{
this
.
readCount
=
res
.
data
.
num
this
.
readCount
=
res
.
data
.
num
;
})
.
catch
((
error
)
=>
{
console
.
log
(
error
)
})
console
.
log
(
error
)
;
})
;
},
changeNavigate
:
function
()
{
this
.
navigate_flag
=
!
this
.
navigate_flag
// 取反
this
.
navigate_flag
=
!
this
.
navigate_flag
;
// 取反
},
handleOpen
(
key
,
keyPath
)
{
console
.
log
(
key
,
keyPath
)
if
(
key
===
'
3
'
)
{
console
.
log
(
'
打开3号
'
)
this
.
chat_flag
=
true
this
.
onlineWebsocket
()
// 调用跳转
handleOpen
(
key
,
keyPath
)
{
console
.
log
(
key
,
keyPath
)
;
if
(
key
===
"
3
"
)
{
console
.
log
(
"
打开3号
"
);
this
.
chat_flag
=
true
;
this
.
onlineWebsocket
()
;
// 调用跳转
}
if
(
key
===
'
2-1
'
)
{
this
.
chat_flag
=
false
this
.
loginAction
()
// 调用跳转
if
(
key
===
"
2-1
"
)
{
this
.
chat_flag
=
false
;
this
.
loginAction
()
;
// 调用跳转
}
if
(
key
===
'
2-2
'
)
{
this
.
chat_flag
=
false
this
.
registerAction
()
// 调用跳转
if
(
key
===
"
2-2
"
)
{
this
.
chat_flag
=
false
;
this
.
registerAction
()
;
// 调用跳转
}
},
handleClose
(
key
,
keyPath
)
{
console
.
info
(
key
,
keyPath
)
if
(
key
===
'
3
'
)
{
this
.
chat_flag
=
false
handleClose
(
key
,
keyPath
)
{
console
.
info
(
key
,
keyPath
)
;
if
(
key
===
"
3
"
)
{
this
.
chat_flag
=
false
;
}
},
jumpRouter
:
function
(
params
)
{
this
.
$router
.
push
({
name
:
`
${
params
}
`
name
:
`
${
params
}
`
,
})
.
catch
((
error
)
=>
{
console
.
log
(
error
)
})
console
.
log
(
error
)
;
})
;
},
onlineWebsocket
:
function
()
{
// console.log(this.$router);
this
.
$router
.
push
({
path
:
'
/onlinewebsocket
'
path
:
"
/onlinewebsocket
"
,
})
.
catch
((
error
)
=>
{
throw
Error
(
error
)
})
throw
Error
(
error
)
;
})
;
},
jumpToEcharts
:
function
()
{
// console.log(this.$router);
this
.
$router
.
push
({
path
:
'
/bilicom
'
path
:
"
/bilicom
"
,
})
.
catch
((
error
)
=>
{
console
.
log
(
error
)
})
console
.
log
(
error
)
;
})
;
},
jumpToAdmin
:
function
()
{
this
.
$router
.
push
({
path
:
'
/mavoneditor
'
path
:
"
/mavoneditor
"
,
})
.
catch
((
error
)
=>
{
console
.
log
(
error
)
})
console
.
log
(
error
)
;
})
;
},
loginAction
:
function
()
{
this
.
$router
.
push
({
path
:
'
/login
'
path
:
"
/login
"
,
})
.
catch
((
error
)
=>
{
console
.
log
(
error
)
})
console
.
log
(
error
)
;
})
;
},
registerAction
:
function
()
{
this
.
$router
.
push
({
path
:
'
/register
'
path
:
"
/register
"
,
})
.
catch
((
error
)
=>
{
console
.
log
(
error
)
})
}
}
}
console
.
log
(
error
)
;
})
;
}
,
}
,
}
;
</
script
>
<
style
>
...
...
src/components/Login.vue
浏览文件 @
84a34baa
...
...
@@ -127,7 +127,7 @@ export default {
// 添加cookie
}
else
if
(
res
.
data
.
code
==
0
)
{
// alter("失败!" res.data.msg)
that
.
$message
.
error
(
'
用化名或密码错误
'
);
that
.
$message
.
error
(
"
用户名或密码错误
"
);
}
})
.
catch
((
error
)
=>
{
...
...
src/store/modules/user.js
浏览文件 @
84a34baa
import
{
loginUser
}
from
'
@/service/user.service
'
import
{
loginUser
}
from
"
@/service/user.service
"
;
export
default
{
// 自带命名空间
namespaced
:
true
,
state
:
{
// 用户账号密码
userInfo
:
null
userInfo
:
{
name
:
null
,
password
:
null
,
},
},
getters
:
{
userInfo
:
state
=>
{
return
state
.
userInfo
}
userInfo
:
(
state
)
=>
{
return
state
.
userInfo
;
},
},
mutations
:
{
// 配置用户登录信息 userInfo
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
}
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
}
,
},
actions
:
{
// Promise
loginUserInfo
({
commit
},
info
)
{
console
.
log
(
'
登录认证 store里面
'
,
'
info
'
,
info
)
loginUserInfo
({
commit
},
info
)
{
console
.
log
(
"
登录认证 store里面
"
,
"
info
"
,
info
);
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
try
{
let
data
=
await
loginUser
(
info
)
let
data
=
await
loginUser
(
info
)
;
// 等待登录信息
console
.
log
(
'
返回的post
'
,
data
)
console
.
log
(
"
返回的post
"
,
data
);
// 调用 mutation
commit
(
'
setUserInfo
'
,
data
)
resolve
(
data
)
commit
(
"
setUserInfo
"
,
info
);
resolve
(
data
)
;
}
catch
(
error
)
{
reject
(
error
)
reject
(
error
)
;
}
})
}
}
}
})
;
}
,
}
,
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录