Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
tianzhuanghu
ant-design-pro-vue
Commits
97b55a4b
Unverified
Commit
97b55a4b
authored
Jan 16, 2019
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: login
parent
65da5511
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
58 deletions
+73
-58
index.js
src/api/index.js
+12
-10
login.js
src/api/login.js
+61
-48
Login.vue
src/views/user/Login.vue
+0
-0
No files found.
src/api/index.js
View file @
97b55a4b
const
api
=
{
const
api
=
{
Login
:
'/auth/login'
,
Login
:
'/auth/login'
,
Logout
:
'/auth/logout'
,
Logout
:
'/auth/logout'
,
ForgePassword
:
'/auth/forge-password'
,
ForgePassword
:
'/auth/forge-password'
,
Register
:
'/auth/register'
,
Register
:
'/auth/register'
,
SendSms
:
'/account/sms'
,
twoStepCode
:
'/auth/2step-code'
,
SendSmsErr
:
'/account/sms_err'
,
SendSms
:
'/account/sms'
,
// get my info
SendSmsErr
:
'/account/sms_err'
,
UserInfo
:
'/user/info'
// get my info
}
UserInfo
:
'/user/info'
}
export
default
api
export
default
api
\ No newline at end of file
src/api/login.js
View file @
97b55a4b
import
api
from
'./index'
import
api
from
'./index'
import
{
axios
}
from
'@/utils/request'
import
{
axios
}
from
'@/utils/request'
/**
/**
* login func
* login func
* parameter: {
* parameter: {
* username: '',
* username: '',
* password: '',
* password: '',
* remember_me: true,
* remember_me: true,
* captcha: '12345'
* captcha: '12345'
* }
* }
* @param parameter
* @param parameter
* @returns {*}
* @returns {*}
*/
*/
export
function
login
(
parameter
)
{
export
function
login
(
parameter
)
{
return
axios
({
return
axios
({
url
:
'/auth/login'
,
url
:
'/auth/login'
,
method
:
'post'
,
method
:
'post'
,
data
:
parameter
data
:
parameter
})
})
}
}
export
function
getSmsCaptcha
(
parameter
)
{
export
function
getSmsCaptcha
(
parameter
)
{
return
axios
({
return
axios
({
url
:
api
.
SendSms
,
url
:
api
.
SendSms
,
method
:
'post'
,
method
:
'post'
,
data
:
parameter
data
:
parameter
})
})
}
}
export
function
getInfo
()
{
export
function
getInfo
()
{
return
axios
({
return
axios
({
url
:
'/user/info'
,
url
:
'/user/info'
,
method
:
'get'
,
method
:
'get'
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
'Content-Type'
:
'application/json;charset=UTF-8'
}
}
})
})
}
}
export
function
logout
()
{
export
function
logout
()
{
return
axios
({
return
axios
({
url
:
'/auth/logout'
,
url
:
'/auth/logout'
,
method
:
'post'
,
method
:
'post'
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
'Content-Type'
:
'application/json;charset=UTF-8'
}
}
})
})
}
/**
* get user 2step code open?
* @param parameter {*}
*/
export
function
get2step
(
parameter
)
{
return
axios
({
url
:
api
.
twoStepCode
,
method
:
'post'
,
data
:
parameter
})
}
}
\ No newline at end of file
src/views/user/Login.vue
View file @
97b55a4b
This diff is collapsed.
Click to expand it.
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