Commit affc1e0a by maolipeng

fix:左侧菜单顶部logo同步更新

parent 6ea21d40
...@@ -175,6 +175,7 @@ class CollegeInfoPage extends React.Component { ...@@ -175,6 +175,7 @@ class CollegeInfoPage extends React.Component {
User.setStoreName(storeName); User.setStoreName(storeName);
Bus.trigger('storeNameChange',storeName); Bus.trigger('storeNameChange',storeName);
message.success('保存成功'); message.success('保存成功');
Bus.trigger("updateCollegeInfo")
}); });
} }
render() { render() {
......
...@@ -10,6 +10,7 @@ import StoreService from "@/domains/store-domain/storeService"; ...@@ -10,6 +10,7 @@ import StoreService from "@/domains/store-domain/storeService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import _ from 'underscore'; import _ from 'underscore';
import "./Menu.less"; import "./Menu.less";
import Bus from '@/core/tbus';
const { SubMenu } = Menu; const { SubMenu } = Menu;
function Aside(props: any) { function Aside(props: any) {
...@@ -36,9 +37,19 @@ function Aside(props: any) { ...@@ -36,9 +37,19 @@ function Aside(props: any) {
return item; return item;
}) })
}, [props.location.pathname]) }, [props.location.pathname])
useEffect(()=> { useEffect(()=> {
getTopLeftLogo() getTopLeftLogo()
Bus.bind("updateCollegeInfo",updateCollegeInfo)
return ()=> {
Bus.unbind("updateCollegeInfo")
}
},[]) },[])
function updateCollegeInfo() {
getTopLeftLogo()
}
function getTopLeftLogo() { function getTopLeftLogo() {
if (User.getToken()) { if (User.getToken()) {
StoreService.getStoreDetail({storeId:User.getStoreId()}) StoreService.getStoreDetail({storeId:User.getStoreId()})
......
...@@ -6352,7 +6352,7 @@ hmac-drbg@^1.0.0: ...@@ -6352,7 +6352,7 @@ hmac-drbg@^1.0.0:
minimalistic-assert "^1.0.0" minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1" minimalistic-crypto-utils "^1.0.1"
hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.2: hoist-non-react-statics@^3.1.0:
version "3.3.2" version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
...@@ -8406,14 +8406,6 @@ mini-css-extract-plugin@0.9.0: ...@@ -8406,14 +8406,6 @@ mini-css-extract-plugin@0.9.0:
schema-utils "^1.0.0" schema-utils "^1.0.0"
webpack-sources "^1.1.0" webpack-sources "^1.1.0"
mini-store@^3.0.1:
version "3.0.6"
resolved "https://registry.yarnpkg.com/mini-store/-/mini-store-3.0.6.tgz#44b86be5b2877271224ce0689b3a35a2dffb1ca9"
integrity sha512-YzffKHbYsMQGUWQRKdsearR79QsMzzJcDDmZKlJBqt5JNkqpyJHYlK6gP61O36X+sLf76sO9G6mhKBe83gIZIQ==
dependencies:
hoist-non-react-statics "^3.3.2"
shallowequal "^1.0.2"
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
...@@ -10708,7 +10700,7 @@ rc-table@~7.13.0: ...@@ -10708,7 +10700,7 @@ rc-table@~7.13.0:
"@babel/runtime" "^7.10.1" "@babel/runtime" "^7.10.1"
classnames "^2.2.5" classnames "^2.2.5"
rc-resize-observer "^1.0.0" rc-resize-observer "^1.0.0"
rc-util "^5.4.0" rc-util "^5.13.0"
shallowequal "^1.1.0" shallowequal "^1.1.0"
rc-tabs@~11.7.0: rc-tabs@~11.7.0:
......
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