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
83965c05
Commit
83965c05
authored
Dec 04, 2020
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:个人设置及身份相关接口联调
parent
3fe97617
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
135 additions
and
55 deletions
+135
-55
src/common/js/permission.js
+2
-4
src/data-source/base/request-apis.ts
+13
-1
src/domains/basic-domain/baseService.ts
+19
-3
src/modules/personalInfo/ChangePhoneModal.tsx
+21
-8
src/modules/personalInfo/IdentificationModal.tsx
+20
-5
src/modules/personalInfo/index.tsx
+43
-11
src/modules/root/Header.jsx
+2
-2
src/modules/root/Login.jsx
+2
-2
src/modules/store-manege/CourseCatalogPage.tsx
+9
-16
src/modules/store-manege/modal/SecondCatalogAddOrEditModal.tsx
+4
-3
No files found.
src/common/js/permission.js
View file @
83965c05
/*
* @Author: wufan
* @Date: 2020-12-02 10:39:36
* @LastEditors:
wuf
an
* @LastEditTime: 2020-12-0
2 17:46:27
* @LastEditors:
zhangleyu
an
* @LastEditTime: 2020-12-0
4 15:38:04
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -17,6 +17,5 @@ class Permission {
}
}
export
default
Permission
;
\ No newline at end of file
src/data-source/base/request-apis.ts
View file @
83965c05
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-04 1
1:42:5
2
* @LastEditTime: 2020-12-04 1
7:39:1
2
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -19,3 +19,15 @@ export function getUserPermission(params: object) {
export
function
logout
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/logout"
,
params
);
}
export
function
getStoreUser
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/getStoreUser"
,
params
);
}
export
function
sendBizAuthCode
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/sendBizAuthCode"
,
params
);
}
export
function
editUserPhone
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/editUserPhone"
,
params
);
}
export
function
checkBizAuthCode
(
params
:
object
)
{
return
Service
.
Hades
(
"public/store/checkBizAuthCode"
,
params
);
}
src/domains/basic-domain/baseService.ts
View file @
83965c05
...
...
@@ -2,19 +2,18 @@
* @Author: wufan
* @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-04 1
1:44:19
* @LastEditTime: 2020-12-04 1
7:08:24
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
import
{
getUserStore
,
getUserPermission
,
logout
}
from
'@/data-source/base/request-apis'
;
import
{
getUserStore
,
getUserPermission
,
logout
,
getStoreUser
,
sendBizAuthCode
,
editUserPhone
,
checkBizAuthCode
}
from
'@/data-source/base/request-apis'
;
export
default
class
StoreService
{
// 获取员工列表
static
getUserStore
(
params
:
any
)
{
return
getUserStore
(
params
);
}
// 获取员工列表
static
getUserPermission
(
params
:
any
)
{
return
getUserPermission
(
params
);
...
...
@@ -23,4 +22,20 @@ export default class StoreService {
static
logout
(
params
:
any
)
{
return
logout
(
params
);
}
//退出登录
static
getStoreUser
(
params
:
any
)
{
return
getStoreUser
(
params
);
}
//发送业务验证码
static
sendBizAuthCode
(
params
:
any
)
{
return
sendBizAuthCode
(
params
);
}
//编辑手机号
static
editUserPhone
(
params
:
any
)
{
return
editUserPhone
(
params
);
}
static
checkBizAuthCode
(
params
:
any
){
return
checkBizAuthCode
(
params
);
}
}
\ No newline at end of file
src/modules/personalInfo/ChangePhoneModal.tsx
View file @
83965c05
...
...
@@ -3,7 +3,7 @@ import { Modal, Button, Input} from 'antd';
import
_
from
'underscore'
;
import
'./ChangePhoneModal.less'
;
import
Form
from
'antd/lib/form/Form'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
interface
changePhoneModalProps
{
onClose
:()
=>
void
,
...
...
@@ -24,10 +24,6 @@ function ChangePhoneModal(props: changePhoneModalProps) {
useEffect
(()
=>
{
})
// function checkPhone():any{
// }
function
checkPhoneVerify
():
any
{
if
(
!
phoneVerify
){
setErrorMessageText
(
'请输入验证码'
);
...
...
@@ -47,8 +43,14 @@ function ChangePhoneModal(props: changePhoneModalProps) {
setNewPhoneError
(
true
);
return
;
}
let
timer
:
any
;
timeSub
(
60
,
0
);
let
timer
:
any
;
const
param
=
{
phone
:
newPhone
,
bizType
:
'CLOUD_CLASS_MODIFY_PHONE'
}
BaseService
.
sendBizAuthCode
(
param
).
then
((
res
)
=>
{
timeSub
(
60
,
0
);
});
function
timeSub
(
waitTime
:
number
,
unit
:
number
):
any
{
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
...
...
@@ -81,7 +83,18 @@ function ChangePhoneModal(props: changePhoneModalProps) {
setPhoneVerifyError
(
true
);
return
;
}
onClose
();
const
param
=
{
authCode
:
phoneVerify
,
phone
:
"string"
,
storeUserId
:
0
}
BaseService
.
editUserPhone
(
param
).
then
((
res
)
=>
{
if
(
res
.
success
){
onClose
();
}
else
{
setErrorMessageText
(
res
.
message
);
}
});
}
return
(
<
Modal
...
...
src/modules/personalInfo/IdentificationModal.tsx
View file @
83965c05
...
...
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import
{
Modal
,
Form
,
Button
,
Input
,
Radio
,
Row
,
Col
,
InputNumber
}
from
'antd'
;
import
_
from
'underscore'
;
import
'./IdentificationModal.less'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
interface
IdentificationModalProps
{
onClose
:()
=>
void
,
phone
:
String
,
...
...
@@ -27,14 +27,29 @@ function IdentificationModal(props: IdentificationModalProps) {
setErrorMessageText
(
'请输入验证码'
);
return
;
}
// 请求身份确定的接口
onConfirm
();
const
param
=
{
code
:
phoneVerify
,
phone
,
serverType
:
'CLOUD_CLASS_MODIFY_PHONE'
}
BaseService
.
checkBizAuthCode
(
param
).
then
((
res
)
=>
{
if
(
res
.
success
){
onConfirm
();
}
else
{
setErrorMessageText
(
res
.
message
);
}
});
}
function
handleSendCode
():
any
{
if
(
waitStatus
)
return
;
let
timer
:
any
;
timeSub
(
60
,
0
);
const
param
=
{
phone
,
serverType
:
'CLOUD_CLASS_MODIFY_PHONE'
}
BaseService
.
sendBizAuthCode
(
param
).
then
((
res
)
=>
{
timeSub
(
60
,
0
);
});
function
timeSub
(
waitTime
:
number
,
unit
:
number
):
any
{
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
...
...
src/modules/personalInfo/index.tsx
View file @
83965c05
...
...
@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Date: 2020-11-27 15:06:31
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-04 1
4:57:59
* @LastEditTime: 2020-12-04 1
8:00:20
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -10,7 +10,7 @@
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
{
Form
,
Button
,
Input
}
from
"antd"
;
import
{
Form
,
Button
,
Input
,
message
}
from
"antd"
;
import
Breadcrumbs
from
"@/components/Breadcrumbs"
;
import
UpLoad
from
"../common/UpLoad"
;
import
_
from
'underscore'
;
...
...
@@ -19,17 +19,35 @@ import baseImg from '@/common/images/xiaomai-IMG.png';
import
{
CropperModal
}
from
'@/components/'
;
import
IdentificationModal
from
'./IdentificationModal'
;
import
ChangePhoneModal
from
'./ChangePhoneModal'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
StoreService
from
"@/domains/store-domain/storeService"
;
import
User
from
'@/common/js/user'
;
import
'./index.less'
;
const
FormItem
=
Form
.
Item
;
function
PersonalInfoPage
()
{
const
[
avatar
,
setAvatar
]
=
useState
(
baseImg
);
const
[
imgUrl
,
setImgUrl
]
=
useState
(
avatar
);
const
[
nickName
,
setNickName
]
=
useState
(
''
);
const
[
cropperModalVisible
,
setCropperModalVisible
]
=
useState
(
false
);
const
[
IdentificationModalVisible
,
setIdentificationModalVisible
]
=
useState
(
false
);
const
[
changePhoneModalVisible
,
setChangePhoneModalVisible
]
=
useState
(
false
);
const
[
roleCodes
,
setRoleCodes
]
=
useState
([])
const
[
phone
,
setPhone
]
=
useState
(
""
);
const
storeUserId
=
User
.
getStoreUserId
()
useEffect
(()
=>
{
getUserInfo
();
},[
storeUserId
])
function
getUserInfo
(){
const
param
=
{
storeUserId
:
User
.
getStoreUserId
()
}
BaseService
.
getStoreUser
(
param
).
then
((
res
)
=>
{
const
{
nickName
,
phone
,
roleCodes
}
=
res
.
result
;
setNickName
(
nickName
);
setPhone
(
phone
);
setRoleCodes
(
roleCodes
)
});
}
function
_handleUpdateAvatar
(
e
:
any
):
any
{
const
avatar
=
e
.
target
.
files
[
0
];
const
newUrl
=
URL
.
createObjectURL
(
avatar
);
...
...
@@ -47,17 +65,25 @@ function PersonalInfoPage() {
setImgUrl
(
img
);
}
function
closeCropperModal
():
any
{
function
closeCropperModal
():
any
{
setCropperModalVisible
(
false
);
}
function
identificationConfirm
():
any
{
function
identificationConfirm
():
any
{
setIdentificationModalVisible
(
false
);
setChangePhoneModalVisible
(
true
);
}
function
changePhoneModalConfirm
():
any
{
function
saveUserInfo
(){
const
params
=
{
nickName
,
phone
:
String
(
phone
),
roleCodes
:
roleCodes
,
// avatar,
storeUserId
:
User
.
getStoreUserId
()
};
StoreService
.
editEmployee
(
params
).
then
((
res
)
=>
{
message
.
success
(
"编辑成功"
);
});
}
return
(
<
div
className=
"page personal-info-page"
>
<
div
className=
"page-content"
>
...
...
@@ -86,7 +112,13 @@ function PersonalInfoPage() {
</
div
>
<
div
className=
"name-item"
>
<
span
className=
"label"
>
姓名:
</
span
>
<
Input
placeholder=
"请输入姓名"
style=
{
{
width
:
300
,
height
:
32
}
}
/>
<
Input
placeholder=
"请输入姓名"
style=
{
{
width
:
300
,
height
:
32
}
}
value=
{
nickName
}
onChange=
{
(
e
)
=>
{
setNickName
(
e
.
target
.
value
);
}
}
/>
</
div
>
<
div
className=
"phone-item"
>
<
span
className=
"label"
>
手机号:
</
span
>
...
...
@@ -94,7 +126,7 @@ function PersonalInfoPage() {
<
Button
className=
"changePhoneBtn"
onClick=
{
()
=>
{
setIdentificationModalVisible
(
true
)}
}
>
更换手机号
</
Button
>
</
div
>
<
div
>
<
Button
type=
"primary"
>
保存
</
Button
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
saveUserInfo
()}
}
>
保存
</
Button
>
</
div
>
</
Form
>
</
div
>
...
...
src/modules/root/Header.jsx
View file @
83965c05
...
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2019-09-10 18:26:03
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-04 15:
09:25
* @LastEditTime: 2020-12-04 15:
30:49
* @Description:
*/
import
React
from
'react'
;
...
...
@@ -36,7 +36,7 @@ class Header extends React.Component {
};
}
componentDidMount
()
{
console
.
log
(
"ctx"
,
window
.
ctx
);
}
userMenu
()
{
const
style
=
{
...
...
src/modules/root/Login.jsx
View file @
83965c05
...
...
@@ -48,9 +48,9 @@ function Login(props) {
sessionId
:
checkData
.
csessionid
,
token
:
checkData
.
token
,
scene
:
'nc_login'
,
serverType
:
"CLOUD_CLASS_LOGIN"
,
}
axios
.
post
(
'https://dev-heimdall.xiaomai5.com/hades/anon/store/sendLoginAuthCode'
,
params
).
then
((
res
)
=>
{
console
.
log
(
'111'
,
res
.
data
.
success
);
if
(
!
res
.
data
.
success
)
{
setErrorMessage
(
res
.
data
.
message
);
}
else
{
...
...
@@ -83,7 +83,7 @@ function Login(props) {
}
const
params
=
{
phone
,
authCode
:
phoneverify
authCode
:
phoneverify
,
}
axios
.
post
(
'https://dev-heimdall.xiaomai5.com/hades/anon/store/login'
,
params
).
then
((
res
)
=>
{
const
data
=
res
.
data
;
...
...
src/modules/store-manege/CourseCatalogPage.tsx
View file @
83965c05
...
...
@@ -119,11 +119,13 @@ function CourseCatalogPage() {
]
}
function
getCourseCatalogList
():
any
{
console
.
log
(
'getCourseCatalogList'
)
let
_query
=
_
.
clone
(
query
);
_query
.
current
=
query
.
current
+
1
;
StoreService
.
getCourseCatalogList
(
_query
).
then
((
res
:
any
)
=>
{
let
resultData
=
handleCatalogListData
(
res
.
result
.
records
)
setCourseCatalogList
(
resultData
);
console
.
log
(
"res"
,
resultData
);
setTotal
(
res
.
result
.
total
);
});
}
...
...
@@ -155,23 +157,12 @@ function CourseCatalogPage() {
parentId
,
}
StoreService
.
getAllSonCategory
(
param
).
then
((
res
:
any
)
=>
{
handleSecondCatalogData
(
parentId
,
res
.
result
);
console
.
log
(
courseCatalogList
);
record
.
children
=
res
.
result
||
[];
const
_courseCatalogList
=
[...
courseCatalogList
]
setCourseCatalogList
(
_courseCatalogList
)
});
}
function
handleSecondCatalogData
(
parentId
:
any
,
listdata
:
any
){
listdata
.
map
((
item
:
any
,
index
:
any
)
=>
{
item
.
key
=
item
.
id
return
item
})
courseCatalogList
.
map
((
item
:
any
,
index
:
any
)
=>
{
if
(
item
.
id
===
parentId
){
item
.
children
=
listdata
;
}
return
item
})
setCourseCatalogList
(
courseCatalogList
)
}
return
(
<
div
className=
" page employee-manage-page"
>
...
...
@@ -192,13 +183,15 @@ function CourseCatalogPage() {
columns=
{
parseColumn
()
}
pagination=
{
false
}
expandedRowRender=
{
(
record
:
RecordTypes
)
=>
{
if
(
!
record
.
children
){
return
}
if
(
record
.
children
.
length
!==
0
){
return
<
div
>
{
record
.
children
[
0
].
categoryName
}
</
div
>;
}
else
{
return
<
div
>
还未添加任何子分类
</
div
>;
}
}
}
dataSource=
{
courseCatalogList
}
onExpand=
{
(
expanded
,
record
)
=>
expandSecondCatalog
(
expanded
,
record
)
}
/>
...
...
src/modules/store-manege/modal/SecondCatalogAddOrEditModal.tsx
View file @
83965c05
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-27 16:21:49
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-04 1
0:40:57
* @LastEditTime: 2020-12-04 1
5:28:43
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -17,8 +17,9 @@ import StoreService from "@/domains/store-domain/storeService";
const
{
Option
}
=
Select
;
interface
SecondCatalogAddOrEditModalProps
{
onClose
:
(
e
:
any
)
=>
void
;
modalType
:
string
parentId
:
string
modalType
:
string
;
parentId
:
string
;
}
function
SecondCatalogAddOrEditModal
(
props
:
SecondCatalogAddOrEditModalProps
)
{
...
...
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