Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
b90c8a4f
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
12 个月 前同步成功
通知
329
Star
18154
Fork
5505
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b90c8a4f
编写于
10月 10, 2019
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
登录界面 css 优化
上级
56846d4d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
62 addition
and
46 deletion
+62
-46
QMPlusVuePage/src/store/module/user.js
QMPlusVuePage/src/store/module/user.js
+10
-20
QMPlusVuePage/src/style/base.scss
QMPlusVuePage/src/style/base.scss
+14
-0
QMPlusVuePage/src/view/login/login.vue
QMPlusVuePage/src/view/login/login.vue
+19
-13
QMPlusVuePage/src/view/login/regist.vue
QMPlusVuePage/src/view/login/regist.vue
+19
-13
未找到文件。
QMPlusVuePage/src/store/module/user.js
浏览文件 @
b90c8a4f
import
{
login
}
from
'
@/api/user
'
import
{
login
}
from
'
@/api/user
'
import
router
from
'
@/router/index
'
import
router
from
'
@/router/index
'
import
{
Message
}
from
'
element-ui
'
export
const
user
=
{
export
const
user
=
{
namespaced
:
true
,
namespaced
:
true
,
state
:
{
state
:
{
...
@@ -36,7 +35,6 @@ export const user = {
...
@@ -36,7 +35,6 @@ export const user = {
},
},
actions
:
{
actions
:
{
async
LoginIn
({
commit
},
loginInfo
)
{
async
LoginIn
({
commit
},
loginInfo
)
{
try
{
const
res
=
await
login
(
loginInfo
)
const
res
=
await
login
(
loginInfo
)
commit
(
'
setUserInfo
'
,
res
.
data
.
user
)
commit
(
'
setUserInfo
'
,
res
.
data
.
user
)
commit
(
'
setToken
'
,
res
.
data
.
token
)
commit
(
'
setToken
'
,
res
.
data
.
token
)
...
@@ -49,14 +47,6 @@ export const user = {
...
@@ -49,14 +47,6 @@ export const user = {
router
.
push
({
path
:
'
/layout/dashbord
'
,
replace
:
true
})
router
.
push
({
path
:
'
/layout/dashbord
'
,
replace
:
true
})
}
}
}
}
}
catch
(
err
)
{
Message
({
type
:
'
error
'
,
message
:
err
,
showClose
:
true
})
return
Promise
.
reject
(
err
)
}
}
}
},
},
getters
:
{
getters
:
{
...
...
QMPlusVuePage/src/style/base.scss
浏览文件 @
b90c8a4f
...
@@ -30,6 +30,20 @@
...
@@ -30,6 +30,20 @@
margin-left
:
14px
;
margin-left
:
14px
;
}
}
.bottom-mg-lg
{
margin-bottom
:
20px
;
}
.left-mg-lg
{
.left-mg-lg
{
margin-left
:
18px
;
margin-left
:
18px
;
}
}
.title-1
{
text-align
:
center
;
font-size
:
32px
;
margin-bottom
:
32px
;
}
.title-3
{
text-align
:
center
;
}
\ No newline at end of file
QMPlusVuePage/src/view/login/login.vue
浏览文件 @
b90c8a4f
<
template
>
<
template
>
<el-container
class=
"login-regist-box"
>
<el-container
class=
"login-regist-box"
>
<vue-particle-line>
<vue-particle-line></vue-particle-line>
</vue-particle-line>
<el-main
class=
"login-box"
>
<el-main
class=
"login-box"
>
<el-form
:model=
"loginForm"
:rules=
"rules"
label-width=
"100px"
ref=
"loginForm"
status-icon
>
<h1
class=
"title-1"
>
GIN-VUE-ADMIN
</h1>
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-form
:model=
"loginForm"
:rules=
"rules"
ref=
"loginForm"
status-icon
>
<el-input
v-model=
"loginForm.username"
></el-input>
<el-form-item
prop=
"username"
>
<el-input
placeholder=
"请输入用户名"
v-model=
"loginForm.username"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-form-item
prop=
"password"
>
<el-input
:type=
"lock==='lock'?'password':'text'"
v-model=
"loginForm.password"
>
<el-input
:type=
"lock==='lock'?'password':'text'"
placeholder=
"请输入密码"
v-model=
"loginForm.password"
>
<i
:class=
"'el-input__icon el-icon-' + lock"
@
click=
"changeLock"
slot=
"suffix"
></i>
<i
:class=
"'el-input__icon el-icon-' + lock"
@
click=
"changeLock"
slot=
"suffix"
></i>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-button
@
click=
"submitForm"
style=
"width:100%"
>
登 录
</el-button>
</el-form-item>
</el-form>
</el-form>
<
el-button
@
click=
"submitForm"
style=
"float:right;width:calc(100% - 100px)"
>
登 录
</el-button
>
<
h3
class=
"title-3 fl-right"
>
测试用户:admin 密码:123456
</h3
>
</el-main>
</el-main>
</el-container>
</el-container>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -25,7 +31,7 @@ export default {
...
@@ -25,7 +31,7 @@ export default {
name
:
'
Login
'
,
name
:
'
Login
'
,
data
()
{
data
()
{
const
checkUsername
=
(
rule
,
value
,
callback
)
=>
{
const
checkUsername
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
length
<
6
||
value
.
length
>
12
)
{
if
(
value
.
length
<
5
||
value
.
length
>
12
)
{
return
callback
(
new
Error
(
'
请输入正确的用户名
'
))
return
callback
(
new
Error
(
'
请输入正确的用户名
'
))
}
else
{
}
else
{
callback
()
callback
()
...
@@ -79,14 +85,14 @@ export default {
...
@@ -79,14 +85,14 @@ export default {
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.login-regist-box
{
.login-regist-box
{
background
:
#
409e
ff
;
background
:
#
f
ff
;
height
:
100vh
;
height
:
100vh
;
.login-box
{
.login-box
{
width
:
40vw
;
width
:
40vw
;
position
:
absolute
;
position
:
absolute
;
left
:
50%
;
left
:
50%
;
margin-left
:
-22vw
;
margin-left
:
-22vw
;
top
:
25vh
;
top
:
25vh
;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
QMPlusVuePage/src/view/login/regist.vue
浏览文件 @
b90c8a4f
<
template
>
<
template
>
<el-container
class=
"login-regist-box"
>
<el-container
class=
"login-regist-box"
>
<vue-particle-line>
<vue-particle-line></vue-particle-line>
</vue-particle-line>
<el-main
class=
"login-box"
>
<el-main
class=
"login-box"
>
<el-form
:model=
"registForm"
:rules=
"rules"
label-width=
"100px"
ref=
"registForm"
status-icon
>
<h1
class=
"title-1"
>
GIN-VUE-ADMIN
</h1>
by 奇淼
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-form
:model=
"registForm"
:rules=
"rules"
ref=
"registForm"
status-icon
>
<el-input
v-model=
"registForm.username"
></el-input>
<el-form-item
prop=
"username"
>
<el-input
placeholder=
"请输入用户名"
v-model=
"registForm.username"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-form-item
prop=
"password"
>
<el-input
:type=
"lock==='lock'?'password':'text'"
v-model=
"registForm.password"
>
<el-input
:type=
"lock==='lock'?'password':'text'"
placeholder=
"请输入密码"
v-model=
"registForm.password"
>
<i
:class=
"'el-input__icon el-icon-' + lock"
@
click=
"changeLock"
slot=
"suffix"
></i>
<i
:class=
"'el-input__icon el-icon-' + lock"
@
click=
"changeLock"
slot=
"suffix"
></i>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
...
@@ -17,8 +21,10 @@
...
@@ -17,8 +21,10 @@
<i
:class=
"'el-input__icon el-icon-' + lock"
@
click=
"changeLock"
slot=
"suffix"
></i>
<i
:class=
"'el-input__icon el-icon-' + lock"
@
click=
"changeLock"
slot=
"suffix"
></i>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-button
@
click=
"submitForm"
style=
"width:100%"
>
注 册
</el-button>
</el-form-item>
</el-form>
</el-form>
<el-button
style=
"float:right;width:calc(100% - 100px)"
@
click=
"submitForm"
>
注 册
</el-button>
</el-main>
</el-main>
</el-container>
</el-container>
</
template
>
</
template
>
...
@@ -37,7 +43,7 @@ export default {
...
@@ -37,7 +43,7 @@ export default {
}
}
}
}
const
checkUsername
=
(
rule
,
value
,
callback
)
=>
{
const
checkUsername
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
length
<
6
||
value
.
length
>
12
)
{
if
(
value
.
length
<
5
||
value
.
length
>
12
)
{
return
callback
(
new
Error
(
'
请输入正确的用户名
'
))
return
callback
(
new
Error
(
'
请输入正确的用户名
'
))
}
else
{
}
else
{
callback
()
callback
()
...
@@ -98,14 +104,14 @@ export default {
...
@@ -98,14 +104,14 @@ export default {
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.login-regist-box
{
.login-regist-box
{
background
:
#
409e
ff
;
background
:
#
f
ff
;
height
:
100vh
;
height
:
100vh
;
.login-box
{
.login-box
{
width
:
40vw
;
width
:
40vw
;
position
:
absolute
;
position
:
absolute
;
left
:
50%
;
left
:
50%
;
margin-left
:
-22vw
;
margin-left
:
-22vw
;
top
:
25vh
;
top
:
25vh
;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录