伙计们,我有一个小项目,我需要从会话中提取用户的 ID。
我不能把它放在 Text/Int 中,因为它说 Session 带有一个 Key(我认为是 Sql Key)我如何将它转换为 Int 以便在我的项目中的其他方法中使用
我试图这样做以从会话中恢复 ID
getInicioR :: Handler Html
getInicioR = do
uid <- lookupSession "_ID"
user <- runDB $ get404 uid
显示以下错误消息:
Couldn't match expected type ‘Key t0’ with actual type ‘Maybe Text’
In the first argument of ‘get404’, namely ‘uid’
In the second argument of ‘($)’, namely ‘get404 uid’