Commit 7dfb2fb2 by zhujian

fix:rtyuiopk

parent bc1e34d2
...@@ -32,13 +32,14 @@ const App: React.FC = (props: any) => { ...@@ -32,13 +32,14 @@ const App: React.FC = (props: any) => {
const [versionInfo, setVersionInfo] = useState<VersionInfo | null>(null) const [versionInfo, setVersionInfo] = useState<VersionInfo | null>(null)
const userId = User.getUserId(); const userId = User.getUserId();
const [menuType, setMenuType] = useState(true); const [menuType, setMenuType] = useState(true);
const [initWechat, setInitWechat] = useState(false);
const enterpriseId = User.getEnterpriseId(); const enterpriseId = User.getEnterpriseId();
window.ctx = ctx; window.ctx = ctx;
useEffect(() => { useEffect(() => {
initWechatConfig(); initWechatConfig();
getStoreAndUserInfo();
getVersion(); getVersion();
if (window.location.hash === "#/") { if (window.location.hash === "#/") {
window.RCHistory.replace({ window.RCHistory.replace({
...@@ -48,8 +49,20 @@ const App: React.FC = (props: any) => { ...@@ -48,8 +49,20 @@ 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(() => {
console.log('注册完成') if (!initWechat) {
getStoreAndUserInfo();
setInitWechat(true)
}
}) })
setTimeout(() => {
if (!initWechat) {
getStoreAndUserInfo();
setInitWechat(true)
}
}, 1000)
} }
useEffect(() => { useEffect(() => {
getStorePermission(); getStorePermission();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment