Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
老丢丢
SpringBoot2Demo
提交
86c78781
S
SpringBoot2Demo
项目概览
老丢丢
/
SpringBoot2Demo
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SpringBoot2Demo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
86c78781
编写于
11月 05, 2020
作者:
Q
qinxiaodong@pannk.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
20b07f14
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
7 addition
and
42 deletion
+7
-42
mms-font/.env.development
mms-font/.env.development
+1
-1
mms-font/src/store/modules/user.js
mms-font/src/store/modules/user.js
+2
-2
mms-font/src/utils/request.js
mms-font/src/utils/request.js
+0
-1
mms-font/src/utils/validate.js
mms-font/src/utils/validate.js
+0
-9
mms-font/src/views/dashboard/index.vue
mms-font/src/views/dashboard/index.vue
+2
-15
mms-font/src/views/login/index.vue
mms-font/src/views/login/index.vue
+1
-13
mms/src/main/java/com/pannk/mms/modules/sys/service/impl/SysUserServiceImpl.java
...annk/mms/modules/sys/service/impl/SysUserServiceImpl.java
+1
-1
未找到文件。
mms-font/.env.development
浏览文件 @
86c78781
...
...
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
VUE_APP_BASE_API = 'http://
localhost
:8080'
VUE_APP_BASE_API = 'http://
127.0.0.1
:8080'
mms-font/src/store/modules/user.js
浏览文件 @
86c78781
...
...
@@ -31,9 +31,9 @@ const mutations = {
const
actions
=
{
// user login
login
({
commit
},
userInfo
)
{
const
{
user
n
ame
,
password
}
=
userInfo
const
{
user
N
ame
,
password
}
=
userInfo
return
new
Promise
((
resolve
,
reject
)
=>
{
login
({
user
name
:
usern
ame
.
trim
(),
password
:
password
}).
then
(
response
=>
{
login
({
user
Name
:
userN
ame
.
trim
(),
password
:
password
}).
then
(
response
=>
{
const
{
data
}
=
response
commit
(
'
SET_TOKEN
'
,
data
.
token
)
setToken
(
data
.
token
)
...
...
mms-font/src/utils/request.js
浏览文件 @
86c78781
...
...
@@ -44,7 +44,6 @@ service.interceptors.response.use(
*/
response
=>
{
const
res
=
response
.
data
// if the custom code is not 20000, it is judged as an error.
if
(
res
.
code
!==
0
)
{
Message
({
...
...
mms-font/src/utils/validate.js
浏览文件 @
86c78781
...
...
@@ -10,15 +10,6 @@ export function isExternal(path) {
return
/^
(
https
?
:|mailto:|tel:
)
/
.
test
(
path
)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export
function
validUsername
(
str
)
{
const
valid_map
=
[
'
admin
'
,
'
editor
'
]
return
valid_map
.
indexOf
(
str
.
trim
())
>=
0
}
/**
* @param {string} url
* @returns {Boolean}
...
...
mms-font/src/views/dashboard/index.vue
浏览文件 @
86c78781
<
template
>
<div
class=
"dashboard-container"
>
<component
:is=
"currentRole"
/>
</div>
<div
class=
"dashboard-container"
/>
</
template
>
<
script
>
import
{
mapGetters
}
from
'
vuex
'
import
adminDashboard
from
'
./admin
'
import
editorDashboard
from
'
./editor
'
export
default
{
name
:
'
Dashboard
'
,
components
:
{
adminDashboard
,
editorDashboard
},
components
:
{
},
data
()
{
return
{
currentRole
:
'
adminDashboard
'
}
},
computed
:
{
...
mapGetters
([
'
roles
'
])
},
created
()
{
if
(
!
this
.
roles
.
includes
(
'
admin
'
))
{
this
.
currentRole
=
'
editorDashboard
'
}
}
}
</
script
>
mms-font/src/views/login/index.vue
浏览文件 @
86c78781
...
...
@@ -73,20 +73,12 @@
</
template
>
<
script
>
import
{
validUsername
}
from
'
@/utils/validate
'
import
LangSelect
from
'
@/components/LangSelect
'
export
default
{
name
:
'
Login
'
,
components
:
{
LangSelect
},
data
()
{
const
validateUsername
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
validUsername
(
value
))
{
callback
(
new
Error
(
'
Please enter the correct user name
'
))
}
else
{
callback
()
}
}
const
validatePassword
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
length
<
6
)
{
callback
(
new
Error
(
'
The password can not be less than 6 digits
'
))
...
...
@@ -100,9 +92,6 @@ export default {
password
:
'
111111
'
},
loginRules
:
{
userName
:
[
{
required
:
true
,
trigger
:
'
blur
'
,
validator
:
validateUsername
}
],
password
:
[
{
required
:
true
,
trigger
:
'
blur
'
,
validator
:
validatePassword
}
]
...
...
@@ -159,8 +148,7 @@ export default {
this
.
$refs
.
loginForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
loading
=
true
this
.
$store
.
dispatch
(
'
user/login
'
,
this
.
loginForm
)
this
.
$store
.
dispatch
(
'
user/login
'
,
this
.
loginForm
)
.
then
(()
=>
{
this
.
$router
.
push
({
path
:
this
.
redirect
||
'
/
'
,
...
...
mms/src/main/java/com/pannk/mms/modules/sys/service/impl/SysUserServiceImpl.java
浏览文件 @
86c78781
...
...
@@ -31,7 +31,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUserEntity
@Override
public
Result
login
(
LoginForm
loginForm
)
{
SysUserEntity
sysUserEntity
=
queryByUserName
(
loginForm
.
getUserName
());
if
(
sysUserEntity
==
null
||
sysUserEntity
.
getPassword
().
equals
(
loginForm
.
getPassword
())){
if
(
sysUserEntity
==
null
||
!
sysUserEntity
.
getPassword
().
equals
(
loginForm
.
getPassword
())){
return
Result
.
error
(
"账号或密码不正确"
);
}
if
(
sysUserEntity
.
getStatus
()==
1
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录