Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HireTest
VueElementTemplate
Commits
b8ecda19
Commit
b8ecda19
authored
Aug 22, 2017
by
Pan
Committed by
花裤衩
Aug 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refine code
parent
62d2f62b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
17 deletions
+11
-17
login.js
src/api/login.js
+5
-5
login.js
src/mock/login.js
+1
-1
permission.js
src/permission.js
+1
-1
user.js
src/store/modules/user.js
+0
-6
selectExcel.vue
src/views/excel/selectExcel.vue
+2
-2
index.vue
src/views/login/index.vue
+2
-2
No files found.
src/api/login.js
View file @
b8ecda19
import
fetch
from
'utils/fetch'
;
import
fetch
from
'utils/fetch'
export
function
loginByUsername
(
username
,
password
)
{
export
function
loginByUsername
(
username
,
password
)
{
const
data
=
{
const
data
=
{
username
,
username
,
password
password
}
;
}
return
fetch
({
return
fetch
({
url
:
'/login/login'
,
url
:
'/login/login'
,
method
:
'post'
,
method
:
'post'
,
data
data
})
;
})
}
}
export
function
logout
()
{
export
function
logout
()
{
return
fetch
({
return
fetch
({
url
:
'/login/logout'
,
url
:
'/login/logout'
,
method
:
'post'
method
:
'post'
})
;
})
}
}
export
function
getInfo
(
token
)
{
export
function
getInfo
(
token
)
{
...
@@ -24,6 +24,6 @@ export function getInfo(token) {
...
@@ -24,6 +24,6 @@ export function getInfo(token) {
url
:
'/user/info'
,
url
:
'/user/info'
,
method
:
'get'
,
method
:
'get'
,
params
:
{
token
}
params
:
{
token
}
})
;
})
}
}
src/mock/login.js
View file @
b8ecda19
...
@@ -34,7 +34,7 @@ export default {
...
@@ -34,7 +34,7 @@ export default {
if
(
userMap
[
token
])
{
if
(
userMap
[
token
])
{
return
userMap
[
token
];
return
userMap
[
token
];
}
else
{
}
else
{
return
Promise
.
reject
(
'
a
'
);
return
Promise
.
reject
(
'
error
'
);
}
}
},
},
logout
:
()
=>
'success'
logout
:
()
=>
'success'
...
...
src/permission.js
View file @
b8ecda19
...
@@ -12,7 +12,7 @@ function hasPermission(roles, permissionRoles) {
...
@@ -12,7 +12,7 @@ function hasPermission(roles, permissionRoles) {
}
}
// register global progress.
// register global progress.
const
whiteList
=
[
'/login'
,
'/authredirect'
,
'/reset'
,
'/sendpwd'
]
// 不重定向白名单
const
whiteList
=
[
'/login'
,
'/authredirect'
]
// 不重定向白名单
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
// 开启Progress
NProgress
.
start
()
// 开启Progress
if
(
getToken
())
{
// 判断是否有token
if
(
getToken
())
{
// 判断是否有token
...
...
src/store/modules/user.js
View file @
b8ecda19
...
@@ -40,12 +40,6 @@ const user = {
...
@@ -40,12 +40,6 @@ const user = {
},
},
SET_ROLES
:
(
state
,
roles
)
=>
{
SET_ROLES
:
(
state
,
roles
)
=>
{
state
.
roles
=
roles
;
state
.
roles
=
roles
;
},
LOGIN_SUCCESS
:
()
=>
{
console
.
log
(
'login success'
)
},
LOGOUT_USER
:
state
=>
{
state
.
user
=
''
;
}
}
},
},
...
...
src/views/excel/selectExcel.vue
View file @
b8ecda19
...
@@ -78,8 +78,8 @@
...
@@ -78,8 +78,8 @@
})
})
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
message
:
'请选择一条或多条记录导出'
,
message
:
'请选择一条或多条记录导出'
,
type
:
'warning'
type
:
'warning'
});
});
}
}
},
},
...
...
src/views/login/index.vue
View file @
b8ecda19
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<div
class=
'tips'
>
账号:admin 密码随便填
</div>
<div
class=
'tips'
>
账号:admin 密码随便填
</div>
<div
class=
'tips'
>
账号:editor 密码随便填
</div>
<div
class=
'tips'
>
账号:editor 密码随便填
</div>
<el-button
class=
'third
Part
-button'
type=
"primary"
@
click=
'showDialog=true'
>
打开第三方登录
</el-button>
<el-button
class=
'third
party
-button'
type=
"primary"
@
click=
'showDialog=true'
>
打开第三方登录
</el-button>
</el-form>
</el-form>
<el-dialog
title=
"第三方验证"
:visible
.
sync=
"showDialog"
>
<el-dialog
title=
"第三方验证"
:visible
.
sync=
"showDialog"
>
...
@@ -198,7 +198,7 @@
...
@@ -198,7 +198,7 @@
color
:
$dark_gray
;
color
:
$dark_gray
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.third
Part
-button
{
.third
party
-button
{
position
:
absolute
;
position
:
absolute
;
right
:
35px
;
right
:
35px
;
bottom
:
28px
;
bottom
:
28px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment