shiro配置詳情

2021-10-09 08:56:02 字數 1096 閱讀 7934

//處理層面 shiro分成兩個類 進行處理

(1)獲取層

@configuration

public

class

shiroconfig

//第二步 設定 defaultwebsercuritymanager

@bean

public defaultwebsecuritymanager defaultwebercuitymmanager

(@qualifier

("userconfig"

) userconfig userconfig)

//第一步 設定 realm 許可權

@bean

public userconfig userconfig()

//配置shiro 與 thymeleaf整和類

}

(第二類 做授權 和認證事件)

@override

//授權

//關於授權現在不知道字段沒法做

protected authorizationinfo dogetauthorizationinfo

(principalcollection principalcollection)

catch (exception e)

return null;

}@override

//認證

protected authenticationinfo dogetauthenticationinfo

(authenticationtoken authenticationtoken)

throws authenticationexception

else

catch

(exception e)

}}

使用shiro 放使用者資訊  提取值為 (使用者實體類)

user user=

(user)securiptutils.

.getsubject()

.getprincipal()

;//user 是當前使用者資訊儲存的實體類

nginx配置詳情

tip 生活不易,碼農辛苦 我是小刀,在網際網路中夾縫求生 我希望你開心 工作程序 數目。根據硬體調整,通常等於cpu數量或者2倍於cpu。數量越大,吞吐量越大 worker processes 16 工作模式及連線數上限 定義nginx執行的使用者和使用者組 user username userg...

nginx 配置詳情 解析

配置nginx nginx的配置檔案 usr local nginx conf nginx.conf 配置檔案常見結構的從外到內依次是 http server location 等等,預設的繼承關係是從外到內,也就是說內層塊會自動獲取外層塊的值作為預設值 server 解決監聽的 ip 網域名稱 埠...

配置memtable閾值過程詳情

配置memtable閾值可以提高寫入效能。cassandra將memtables重新整理到磁碟,並在超過提交日誌空間閾值或memtable清除閾值時建立sstables 配置cassandra.yaml中每個節點的提交日誌空間閾值 如何調整memtable的閾值取決於資料和寫入負載。在這些條件下增加...