java - Shiro的Subject.login()是怎么知道我的用户信息在哪张表里?
为情所困
为情所困 2017-05-27 17:40:56
0
2
642

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学习者快速成长!