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
f1f3bede
Commit
f1f3bede
authored
Aug 04, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5c312a53
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
21 deletions
+24
-21
src/components/WWOpenData.jsx
+11
-0
src/components/WWOpenDataCom.jsx
+10
-8
src/modules/root/App.tsx
+3
-13
src/modules/root/CollegeManagePage.jsx
+0
-0
No files found.
src/components/WWOpenData.jsx
0 → 100644
View file @
f1f3bede
import
React
,
{
useRef
,
useLayoutEffect
}
from
'react'
export
default
function
WWOpenDataCom
({
type
,
openid
})
{
const
ref
=
useRef
(
null
)
useLayoutEffect
(()
=>
{
console
.
log
(
'1111'
);
console
.
log
(
WWOpenData
);
WWOpenData
&&
WWOpenData
.
bind
(
ref
.
current
)
})
return
<
ww
-
open
-
data
ref=
{
ref
}
type=
{
type
}
openid=
{
openid
}
/>
}
\ No newline at end of file
src/components/WWOpenDataCom.jsx
View file @
f1f3bede
import
React
,
{
useRef
,
useLayoutEffect
}
from
'react'
import
React
,
{
useContext
,
useRef
,
useLayoutEffect
}
from
'react'
export
default
function
WWOpenDataCom
({
type
,
openid
})
{
import
{
XMContext
}
from
'@/store/context'
;
import
WWOpenData
from
'./WWOpenData'
export
default
function
WWOpenDataCom
(
props
)
{
const
ctx
=
useContext
(
XMContext
);
const
ref
=
useRef
(
null
)
const
ref
=
useRef
(
null
)
useLayoutEffect
(()
=>
{
console
.
log
(
'1111'
);
return
ctx
.
xmState
.
wechatLogin
?
<
WWOpenData
{
...
props
}
/>
:
<
div
></
div
>
console
.
log
(
WWOpenData
);
WWOpenData
&&
WWOpenData
.
bind
(
ref
.
current
)
})
return
<
ww
-
open
-
data
ref=
{
ref
}
type=
{
type
}
openid=
{
openid
}
/>
}
}
\ No newline at end of file
src/modules/root/App.tsx
View file @
f1f3bede
...
@@ -16,7 +16,7 @@ import User from '@/common/js/user';
...
@@ -16,7 +16,7 @@ import User from '@/common/js/user';
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
VersionContext
,
VersionInfo
,
XMContext
}
from
'@/store/context'
;
import
{
VersionContext
,
VersionInfo
,
XMContext
}
from
'@/store/context'
;
import
{
setStoreGroupPermission
,
setStorePermission
,
setStoreGroupList
,
setStoreList
}
from
'@/store/actions/index'
;
import
{
setStoreGroupPermission
,
setStorePermission
,
setStoreGroupList
,
setStoreList
,
setWechatLogin
}
from
'@/store/actions/index'
;
import
Service
from
"@/common/js/service"
;
import
Service
from
"@/common/js/service"
;
import
Bus
from
'@/core/tbus'
;
import
Bus
from
'@/core/tbus'
;
import
WechatApi
from
'@/common/js/wechatApi'
;
import
WechatApi
from
'@/common/js/wechatApi'
;
...
@@ -39,7 +39,7 @@ const App: React.FC = (props: any) => {
...
@@ -39,7 +39,7 @@ const App: React.FC = (props: any) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
initWechatConfig
();
initWechatConfig
();
getStoreAndUserInfo
();
getVersion
();
getVersion
();
if
(
window
.
location
.
hash
===
"#/"
)
{
if
(
window
.
location
.
hash
===
"#/"
)
{
window
.
RCHistory
.
replace
({
window
.
RCHistory
.
replace
({
...
@@ -49,20 +49,10 @@ const App: React.FC = (props: any) => {
...
@@ -49,20 +49,10 @@ const App: React.FC = (props: any) => {
},
[])
},
[])
async
function
initWechatConfig
()
{
async
function
initWechatConfig
()
{
WechatApi
.
initConfig
({
isAgentConfig
:
true
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
}).
then
(()
=>
{
WechatApi
.
initConfig
({
isAgentConfig
:
true
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
}).
then
(()
=>
{
if
(
!
initWechat
)
{
ctx
.
dispatch
(
setWechatLogin
(
true
))
getStoreAndUserInfo
();
setInitWechat
(
true
)
}
})
})
setTimeout
(()
=>
{
if
(
!
initWechat
)
{
getStoreAndUserInfo
();
setInitWechat
(
true
)
}
},
1000
)
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
getStorePermission
();
getStorePermission
();
...
...
src/modules/root/CollegeManagePage.jsx
View file @
f1f3bede
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