java - Shiro的Subject.login()是怎麼知道我的使用者資料在哪張表格裡?
为情所困
为情所困 2017-05-27 17:40:56
0
2
649

##shiro-jdbc-realm.ini


##

为情所困
为情所困

全部回覆(2)
PHPzhong

shirojdbcRealm中有这么些默认的query

   /**
     * The default query used to retrieve account data for the user.
     */
    protected static final String DEFAULT_AUTHENTICATION_QUERY = "select password from users where username = ?";
    
    /**
     * The default query used to retrieve account data for the user when {@link #saltStyle} is COLUMN.
     */
    protected static final String DEFAULT_SALTED_AUTHENTICATION_QUERY = "select password, password_salt from users where username = ?";

    /**
     * The default query used to retrieve the roles that apply to a user.
     */
    protected static final String DEFAULT_USER_ROLES_QUERY = "select role_name from user_roles where username = ?";

    /**
     * The default query used to retrieve permissions that apply to a particular role.
     */
    protected static final String DEFAULT_PERMISSIONS_QUERY = "select permission from roles_permissions where role_name = ?";

要不就是你資料庫的表就是上面這些表, 要不是你自己指定了query

阿神

shiro是在你指定的realm中去做使用者名稱密碼校驗功能的,這個校驗還是要自己寫的

看這篇http://jinnianshilongnian.ite...

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!