Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
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
frontend
GeekLearnMathWeapp
Commits
ef1c7b37
Commit
ef1c7b37
authored
Apr 11, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
247e14c0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
auth.ts
src/api/auth.ts
+10
-3
scene-6.tsx
src/pages/main/guide/scene-6.tsx
+8
-1
No files found.
src/api/auth.ts
View file @
ef1c7b37
...
@@ -59,11 +59,18 @@ export function getSetting () {
...
@@ -59,11 +59,18 @@ export function getSetting () {
}
}
export
function
updateUserPhone
(
code
:
string
)
{
export
function
updateUserPhone
(
code
:
string
)
{
return
requestAfterSilentLogin
<
void
,
{
code
:
string
;
userId
?:
number
}
>
((
userInfo
)
=>
({
return
requestAfterSilentLogin
<
void
,
{
code
:
string
;
userId
?:
number
}
>
((
userInfo
)
=>
{
const
shareId
=
getCurrentShareId
()
return
{
url
:
'/service-idea/stage/user/getUserPhone'
,
url
:
'/service-idea/stage/user/getUserPhone'
,
method
:
'GET'
,
method
:
'GET'
,
data
:
{
code
,
userId
:
userInfo
?.
userId
,
shareId
:
getCurrentShareId
()
}
data
:
shareId
}))
?
{
code
,
userId
:
userInfo
?.
userId
,
shareId
}
:
({
code
,
userId
:
userInfo
?.
userId
})
}
})
}
}
export
type
NickNameWord
=
{
export
type
NickNameWord
=
{
...
...
src/pages/main/guide/scene-6.tsx
View file @
ef1c7b37
...
@@ -24,6 +24,7 @@ const Scene6 = (props: Scene6Props) => {
...
@@ -24,6 +24,7 @@ const Scene6 = (props: Scene6Props) => {
const
[
name
,
setName
]
=
useState
(
''
)
const
[
name
,
setName
]
=
useState
(
''
)
const
dataRef
=
useRef
<
NickNameWord
>
({
noun
:
[],
adj
:
[]
})
const
dataRef
=
useRef
<
NickNameWord
>
({
noun
:
[],
adj
:
[]
})
const
timerRef
=
useRef
<
NodeJS
.
Timer
|
null
>
(
null
)
const
timerRef
=
useRef
<
NodeJS
.
Timer
|
null
>
(
null
)
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
[
isGenerating
,
genActions
]
=
useBoolean
(
false
)
const
[
isGenerating
,
genActions
]
=
useBoolean
(
false
)
const
genName
=
useCallback
(()
=>
{
const
genName
=
useCallback
(()
=>
{
...
@@ -39,9 +40,14 @@ const Scene6 = (props: Scene6Props) => {
...
@@ -39,9 +40,14 @@ const Scene6 = (props: Scene6Props) => {
console
.
log
(
e
.
detail
.
errMsg
)
console
.
log
(
e
.
detail
.
errMsg
)
return
return
}
}
setLoading
(
true
)
updateNickNameAndPhone
({
code
:
e
.
detail
.
code
!
,
name
})
updateNickNameAndPhone
({
code
:
e
.
detail
.
code
!
,
name
})
.
then
(()
=>
onNext
())
.
then
(()
=>
{
setLoading
(
false
)
onNext
()
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setLoading
(
false
)
console
.
log
(
err
)
console
.
log
(
err
)
})
})
},
[
updateNickNameAndPhone
,
onNext
,
name
])
},
[
updateNickNameAndPhone
,
onNext
,
name
])
...
@@ -107,6 +113,7 @@ const Scene6 = (props: Scene6Props) => {
...
@@ -107,6 +113,7 @@ const Scene6 = (props: Scene6Props) => {
openType=
"getPhoneNumber"
openType=
"getPhoneNumber"
onGetPhoneNumber=
{
handleGetPhone
}
onGetPhoneNumber=
{
handleGetPhone
}
className=
{
cs
.
btn
}
className=
{
cs
.
btn
}
loading=
{
loading
}
hoverClass=
{
cs
.
is_hover
}
hoverClass=
{
cs
.
is_hover
}
>
确定
</
Button
>
>
确定
</
Button
>
)
}
)
}
...
...
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