idea使用登入許可權auntiry 1

2021-08-28 21:59:39 字數 849 閱讀 3200

首先我們考慮為什麼使用許可權.

1.每個公司每個人都擁有這自己在該公司扮演的角色。

角色用來分配許可權,每個角色都擁有這自己該角色擁有的許可權

那麼現在開始講解許可權怎麼使用

首先建立乙個許可權資料庫

建立乙個role角色表.如果不懂請看注釋

建立完角色表後開啟idea

在src下面建立乙個登入許可權包

建立兩個類分別是beetlextconfig和securitconfig

在securitconfig繼承下websecurityconfigureradapter這個類

也就是這樣,然後重寫所有的configure這個方法.

這個方法有三個,乙個是路徑,乙個jdbc,乙個自定義.

首先我們在有authenticationmanagerbuilder屬性這個方法裡面設定下密碼

這個方法是禁止所有的靜態路徑.防止專案出錯.

最後乙個是配置登入許可權的網頁路徑和一些基本配置.

vue中使用登入許可權控制思路

1.在登入元件的登入方法中請求後台獲取token,並存入session中,在其餘每次請求發起時,帶著token一起請求 if res.meta.status 200 return this.message.error 登入失敗 this.message.success 登入成功 window.ses...

vue登入許可權實現 登入攔截

用sessionstorage實現,資料夾結構如下 關鍵部分如下 import vue from vue import router from vue router import index from components index import login from components log...

許可權 處理登入資訊

許可權系統處理登入資訊 public static setcreatexps listroles return expset public employee login string username,string password return null autowired private emp...