有一個認(rèn)證過程auth(username,password,cb)包括以下步驟,請用js語言實現(xiàn)此方法:先判斷是否本系統(tǒng)用戶authLocal(username, cb)如果是本系統(tǒng)用戶, 接著判斷密碼authPassword(password, cb)如果不是本地用戶, 分別去驗證是否是 QQ 用戶或 Weibo 用戶; authQQ(username, cb); authWeibo(username, cb);如果是QQ或Weibo用戶, 則判斷是否有權(quán)限登陸本系統(tǒng),authPriviage(username,cb);以上全部為異步操作, cb 統(tǒng)一為 function(err, result) 形式。這個 代碼 具體怎么實現(xiàn)呢?
一道 關(guān)于異步回調(diào)的面試題,求解
一只斗牛犬
2019-02-25 21:23:43