diff --git a/src/components/sp-login/index.weapp.js b/src/components/sp-login/index.weapp.js index eb491814b..1f087ed51 100644 --- a/src/components/sp-login/index.weapp.js +++ b/src/components/sp-login/index.weapp.js @@ -28,9 +28,10 @@ const initialState = { } const SpLogin = forwardRef((props, ref) => { - const { children, className, newUser = false, visible, onPolicyClose, onChange, onClose } = props + const { children, className, visible, onPolicyClose, onChange, onClose } = props const { updateAddress } = useLocation() const { shopInfo } = useSelector((state) => state.shop) + const { isNewUser } = useSelector((state) => state.user) const { isLogin, login, setToken, checkPolicyChange } = useLogin({ policyUpdateHook: (isUpdate) => { @@ -41,7 +42,6 @@ const SpLogin = forwardRef((props, ref) => { !visible && updateAddress && updateAddress() } }) - const [isNewUser, setIsNewUser] = useState(false) const [policyModal, setPolicyModal] = useState(false) const [loginModal, setLoginModal] = useState(false) const [state, setState] = useImmer(initialState) @@ -54,12 +54,7 @@ const SpLogin = forwardRef((props, ref) => { } }, [visible]) - useEffect(() => { - if (newUser) { - setIsNewUser(true) - } - }, [newUser]) - + useEffect(() => { if (loginModal) { fetchPrivacyData() diff --git a/src/subpages/member/index.js b/src/subpages/member/index.js index 3f8f254e3..c325f1ae3 100644 --- a/src/subpages/member/index.js +++ b/src/subpages/member/index.js @@ -112,7 +112,7 @@ function MemberIndex(props) { // console.log('===>getCurrentPages==>', getCurrentPages(), getCurrentInstance()) const $instance = getCurrentInstance() const { updateAddress } = useLocation() - const { isLogin, isNewUser, getUserInfo } = useLogin({ + const { isLogin, getUserInfo } = useLogin({ autoLogin: false, // policyUpdateHook: (isUpdate) => { // // isUpdate && setPolicyModal(true) @@ -541,7 +541,7 @@ function MemberIndex(props) { ) : ( - + 点击登录 )}