ant.design pro 登錄模塊分析


這個代表着推送登錄。

dispatch({
        type: 'login/login',
        payload: {
          ...values,
          type,
        },
})

然后發請求,驗證用戶名密碼

request('/api/login/account', {
    method: 'POST',
    body: params,
});

獲得結果

{
    status: 'ok',
    type,
    currentAuthority: 'admin',
}

這是登錄成功,status是代表登錄成功了,邏輯應該是先判斷status

 

type:changeLoginStatus 這個是保存了權限

localStorage 保存獲得的權限
localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority));

 

 

reloadAuthorized 不知道干嘛用的,

const reloadAuthorized = () => {
  Authorized = RenderAuthorized(getAuthority());
};






const params = getPageQuery();這是代表了登陸后跳轉到哪兒


yield put(
    routerRedux.replace(redirect || '/')//下面圖就是這個return出來的結果
);


然后就跳轉過去了

 

 
 

 

 





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM