界面跳转问题
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.modules.common.utils;
|
||||
package org.nl.utils;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.modules.common.utils;
|
||||
package org.nl.utils;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
@@ -24,6 +24,7 @@ import net.dreamlu.mica.ip2region.core.IpInfo;
|
||||
import nl.basjes.parse.useragent.UserAgent;
|
||||
import nl.basjes.parse.useragent.UserAgentAnalyzer;
|
||||
import org.nl.modules.common.config.ElAdminProperties;
|
||||
import org.nl.modules.common.utils.ElAdminConstant;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -83,10 +83,12 @@ export const logOut = (commit) => {
|
||||
|
||||
export const setUserInfo = (res, commit) => {
|
||||
// 如果没有任何权限,则赋予一个默认的权限,避免请求死循环
|
||||
if (res.roles.length === 0) {
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
commit('SET_ROLES', res.roles)
|
||||
} else if (res.permissions.length === 0) {
|
||||
commit('SET_ROLES', ['ROLE_SYSTEM_DEFAULT'])
|
||||
} else {
|
||||
commit('SET_ROLES', res.roles)
|
||||
commit('SET_ROLES', res.permissions)
|
||||
}
|
||||
commit('SET_USER', res.user)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user