<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Redux 常見問題:其它 ## 目錄 - [有 “真實存在” 且很龐大的 Redux 項目嗎?](#miscellaneous-real-projects) - [如何在 Redux 中實現鑒權?](#miscellaneous-authentication) ## 其他 <a id="miscellaneous-real-projects"></a> ### 有 “真實存在” 且很龐大的 Redux 項目嗎? 存在,并且有很多,比如: - [Twitter's mobile site](https://twitter.com/necolas/status/727538799966715904) - [Wordpress's new admin page](https://github.com/Automattic/wp-calypso) - [Firefox's new debugger](https://github.com/jlongster/debugger.html) - [Mozilla's experimental browser testbed](https://github.com/mozilla/tofino) - [The HyperTerm terminal application](https://github.com/zeit/hyperterm) 很多,真的有很多! #### 補充資料 **文檔** - [Introduction: Examples](introduction/Examples.md) **討論** - [Reddit: Large open source react/redux projects?](https://www.reddit.com/r/reactjs/comments/496db2/large_open_source_reactredux_projects/) - [HN: Is there any huge web application built using Redux?](https://news.ycombinator.com/item?id=10710240) <a id="miscellaneous-authentication"></a> ### 如何在 Redux 中實現鑒權? 在任何真正的應用中,鑒權都必不可少。當考慮鑒權時須謹記:不管你怎樣組織應用,都并不會改變什么,你應當像實現其它功能一樣實現鑒權。這實際上很簡單: 1. 為 `LOGIN_SUCCESS`、`LOGIN_FAILURE` 等定義 action 常量。 2. 創建接受憑證的 action 創建函數,憑證是指示身份驗證成功與否的標志、一個令牌、或者作為負載的錯誤信息。 3. 使用 Redux Thunk middleware 或者其它適合于觸發網絡請求(請求 API,如果是合法鑒權則返回令牌)的 middleware 創建一個異步的 action 創建函數。之后在本地存儲中保存令牌或者給用戶一個非法提示。可以通過執行上一步的 action 創建函數達到此效果。 4. 為每個可能出現的鑒權場景(`LOGIN_SUCCESS`、`LOGIN_FAILURE`等)編寫獨立的 reducer。 #### 補充資料 **文章** - [Authentication with JWT by Auth0](https://auth0.com/blog/2016/01/04/secure-your-react-and-redux-app-with-jwt-authentication/) - [Tips to Handle Authentication in Redux](https://medium.com/@MattiaManzati/tips-to-handle-authentication-in-redux-2-introducing-redux-saga-130d6872fbe7) **例子** - [react-redux-jwt-auth-example](https://github.com/joshgeller/react-redux-jwt-auth-example) **討論** - [redux-auth](https://github.com/lynndylanhurley/redux-auth)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看