Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
8f84ec1f
Commit
8f84ec1f
authored
Dec 11, 2020
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改登录和登录获取验证码的接口
parent
eeef05cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
20 deletions
+28
-20
src/data-source/base/request-apis.ts
+10
-6
src/domains/basic-domain/baseService.ts
+9
-2
src/modules/root/Login.jsx
+9
-12
No files found.
src/data-source/base/request-apis.ts
View file @
8f84ec1f
...
@@ -2,18 +2,17 @@
...
@@ -2,18 +2,17 @@
* @Author: wufan
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-
08 10:38:04
* @LastEditTime: 2020-12-
11 11:53:13
* @Description: Description
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
Service
from
"@/common/js/service"
;
import
Service
from
"@/common/js/service"
;
export
function
getUserStore
(
params
:
object
)
{
export
function
getUserStore
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/getUserStore"
,
params
);
return
Service
.
Hades
(
"public/hades/getUserStore"
,
params
);
}
}
export
function
getUserPermission
(
params
:
object
)
{
export
function
getUserPermission
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/getPermission"
,
params
);
return
Service
.
Hades
(
"public/hades/getPermission"
,
params
);
}
}
export
function
logout
(
params
:
object
)
{
export
function
logout
(
params
:
object
)
{
...
@@ -34,4 +33,9 @@ export function sendNewPhoneAuthCode(params: object) {
...
@@ -34,4 +33,9 @@ export function sendNewPhoneAuthCode(params: object) {
export
function
editUserPhone
(
params
:
object
)
{
export
function
editUserPhone
(
params
:
object
)
{
return
Service
.
Hades
(
"public/hades/editUserPhone"
,
params
);
return
Service
.
Hades
(
"public/hades/editUserPhone"
,
params
);
}
}
export
function
sendLoginAuthCode
(
params
:
object
)
{
return
Service
.
Hades
(
"anon/hades/sendLoginAuthCode"
,
params
);
}
export
function
login
(
params
:
object
)
{
return
Service
.
Hades
(
"anon/hades/login"
,
params
);
}
src/domains/basic-domain/baseService.ts
View file @
8f84ec1f
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
* @Author: wufan
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-
07 11:08:23
* @LastEditTime: 2020-12-
11 11:50:17
* @Description: Description
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
}
from
'@/data-source/base/request-apis'
;
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
,
sendNewPhoneAuthCode
,
sendLoginAuthCode
,
login
}
from
'@/data-source/base/request-apis'
;
export
default
class
StoreService
{
export
default
class
StoreService
{
// 获取员工列表
// 获取员工列表
...
@@ -40,4 +40,10 @@ export default class StoreService {
...
@@ -40,4 +40,10 @@ export default class StoreService {
static
sendNewPhoneAuthCode
(
params
:
any
){
static
sendNewPhoneAuthCode
(
params
:
any
){
return
sendNewPhoneAuthCode
(
params
);
return
sendNewPhoneAuthCode
(
params
);
}
}
static
sendLoginAuthCode
(
params
:
any
){
return
sendLoginAuthCode
(
params
);
}
static
login
(
params
:
any
){
return
login
(
params
);
}
}
}
\ No newline at end of file
src/modules/root/Login.jsx
View file @
8f84ec1f
...
@@ -6,6 +6,7 @@ import './Login.less';
...
@@ -6,6 +6,7 @@ import './Login.less';
import
{
Input
,
Popover
,
message
}
from
'antd'
;
import
{
Input
,
Popover
,
message
}
from
'antd'
;
import
CheckBeforeSendCode
from
'../../components/CheckBeforeSendCode'
;
import
CheckBeforeSendCode
from
'../../components/CheckBeforeSendCode'
;
import
User
from
'@/common/js/user'
;
import
User
from
'@/common/js/user'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
_
from
'underscore'
;
import
_
from
'underscore'
;
...
@@ -19,9 +20,6 @@ function Login(props) {
...
@@ -19,9 +20,6 @@ function Login(props) {
const
[
errorMessage
,
setErrorMessage
]
=
useState
(
''
);
const
[
errorMessage
,
setErrorMessage
]
=
useState
(
''
);
const
[
phoneError
,
setPhoneError
]
=
useState
(
false
);
const
[
phoneError
,
setPhoneError
]
=
useState
(
false
);
const
[
checkObject1
,
setCheckObject1
]
=
useState
({});
const
[
checkObject1
,
setCheckObject1
]
=
useState
({});
useEffect
(()
=>
{
},
[])
async
function
checkAccount
(
code
,
callback
=
()
=>
{
})
{
async
function
checkAccount
(
code
,
callback
=
()
=>
{
})
{
callback
();
callback
();
...
@@ -52,9 +50,9 @@ function Login(props) {
...
@@ -52,9 +50,9 @@ function Login(props) {
serverType
:
"CLOUD_CLASS_LOGIN"
,
serverType
:
"CLOUD_CLASS_LOGIN"
,
appTermEnum
:
'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN'
appTermEnum
:
'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN'
}
}
axios
.
post
(
'https://dev-heimdall.xiaomai5.com/hades/anon/hades/sendLoginAuthCode'
,
params
).
then
((
res
)
=>
{
BaseService
.
sendLoginAuthCode
(
params
).
then
((
res
)
=>
{
if
(
!
res
.
data
.
success
)
{
if
(
!
res
.
success
)
{
setErrorMessage
(
res
.
data
.
message
);
setErrorMessage
(
res
.
message
);
}
else
{
}
else
{
timeSub
(
60
);
timeSub
(
60
);
setChecking1
(
true
)
setChecking1
(
true
)
...
@@ -87,13 +85,12 @@ function Login(props) {
...
@@ -87,13 +85,12 @@ function Login(props) {
authCode
:
phoneverify
,
authCode
:
phoneverify
,
appTermEnum
:
"XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN"
appTermEnum
:
"XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN"
}
}
axios
.
post
(
'https://dev-heimdall.xiaomai5.com/hades/anon/hades/login'
,
params
).
then
((
res
)
=>
{
BaseService
.
login
(
params
).
then
((
res
)
=>
{
const
data
=
res
.
data
;
if
(
!
res
.
success
)
{
if
(
!
data
.
success
)
{
setErrorMessage
(
res
.
message
);
setErrorMessage
(
data
.
message
);
}
else
{
}
else
{
User
.
setUserId
(
data
.
result
.
userId
);
User
.
setUserId
(
res
.
result
.
userId
);
User
.
setToken
(
data
.
result
.
xmToken
);
User
.
setToken
(
res
.
result
.
xmToken
);
window
.
RCHistory
.
push
({
window
.
RCHistory
.
push
({
pathname
:
`/personal-info`
,
pathname
:
`/personal-info`
,
})
})
...
...
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