mirror of https://gitee.com/stylefeng/guns
初步调通登录和首页的界面
parent
b7f7a9c3e2
commit
31f9a6ef0f
|
@ -1,7 +1,9 @@
|
||||||
package cn.stylefeng.guns.core.beetl;
|
package cn.stylefeng.guns.core.beetl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.LoginUserApi;
|
import cn.stylefeng.roses.kernel.auth.api.LoginUserApi;
|
||||||
|
import cn.stylefeng.roses.kernel.system.expander.SystemConfigExpander;
|
||||||
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
|
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,8 +22,16 @@ public class CustomBeetlGroupUtilConfiguration extends BeetlGroupUtilConfigurati
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initOther() {
|
public void initOther() {
|
||||||
|
|
||||||
|
// 获取当前用户的接口
|
||||||
groupTemplate.registerFunctionPackage("loginUserApi", loginUserApi);
|
groupTemplate.registerFunctionPackage("loginUserApi", loginUserApi);
|
||||||
groupTemplate.registerFunctionPackage("strUtil", StrUtil.class);
|
|
||||||
|
// 字符串处理工具类
|
||||||
|
groupTemplate.registerFunctionPackage("objectUtil", ObjectUtil.class);
|
||||||
|
|
||||||
|
// 获取基本信息的工具
|
||||||
|
groupTemplate.registerFunctionPackage("constants", SystemConfigExpander.class);
|
||||||
|
|
||||||
// todo 多语言
|
// todo 多语言
|
||||||
// groupTemplate.registerFunctionPackage("lang", new UserTranslationContext());
|
// groupTemplate.registerFunctionPackage("lang", new UserTranslationContext());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
package cn.stylefeng.guns.modular.controller;
|
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
|
||||||
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
|
||||||
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
|
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页接口
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2020/12/13 17:19
|
|
||||||
*/
|
|
||||||
@Controller
|
|
||||||
@Slf4j
|
|
||||||
@ApiResource(name = "首页接口")
|
|
||||||
public class IndexController {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页接口
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2020/12/13 17:19
|
|
||||||
*/
|
|
||||||
@ResponseBody
|
|
||||||
@GetResource(name = "首页接口", path = "/", requiredPermission = false, requiredLogin = false)
|
|
||||||
public ResponseData logoutPage() {
|
|
||||||
return new SuccessResponseData("欢迎使用Guns");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页接口
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2020/12/13 17:19
|
|
||||||
*/
|
|
||||||
@GetResource(name = "首页接口 view渲染", path = "/test")
|
|
||||||
public String test() {
|
|
||||||
return "/demos/test.html";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户信息
|
|
||||||
*
|
|
||||||
* @return 用户登录可见的个人信息
|
|
||||||
* @author huangyao
|
|
||||||
* @date 2020/12/20 21:36
|
|
||||||
*/
|
|
||||||
@GetResource(name = "获取当前登录用户信息", path = "/getLoginUserDetail")
|
|
||||||
public ResponseData getLoginUserDetail() {
|
|
||||||
return new SuccessResponseData(LoginContext.me().getLoginUser());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户左侧菜单 todo
|
|
||||||
*
|
|
||||||
* @author fengshuonan
|
|
||||||
* @date 2020/12/24 22:23
|
|
||||||
*/
|
|
||||||
@GetResource(name = "获取用户左侧菜单", path = "/getLeftMenuTree")
|
|
||||||
public ResponseData getLeftMenuTree() {
|
|
||||||
return new SuccessResponseData();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package cn.stylefeng.guns.modular.controller;
|
||||||
|
|
||||||
|
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||||
|
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||||
|
import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleUserInfo;
|
||||||
|
import cn.stylefeng.roses.kernel.file.FileOperatorApi;
|
||||||
|
import cn.stylefeng.roses.kernel.menu.modular.service.SysMenuService;
|
||||||
|
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
||||||
|
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
|
||||||
|
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
|
||||||
|
import cn.stylefeng.roses.kernel.system.pojo.menu.layui.LayuiAppIndexMenus;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页相关的界面渲染
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2020/12/27 16:23
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@Slf4j
|
||||||
|
@ApiResource(name = "首页相关的界面渲染")
|
||||||
|
public class IndexViewController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysMenuService sysMenuService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysUserService sysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页界面
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2020/12/13 17:19
|
||||||
|
*/
|
||||||
|
@GetResource(name = "首页界面", path = "/", requiredPermission = false, requiredLogin = false)
|
||||||
|
public String indexView(Model model) {
|
||||||
|
|
||||||
|
// 当前用户已经登录,跳转到首页
|
||||||
|
if (LoginContext.me().hasLogin()) {
|
||||||
|
|
||||||
|
LoginUser loginUser = LoginContext.me().getLoginUser();
|
||||||
|
SimpleUserInfo simpleUserInfo = loginUser.getSimpleUserInfo();
|
||||||
|
|
||||||
|
// 渲染首页的菜单
|
||||||
|
List<LayuiAppIndexMenus> layuiAppIndexMenus = sysMenuService.getLayuiIndexMenus();
|
||||||
|
model.addAttribute("layuiAppIndexMenus", layuiAppIndexMenus);
|
||||||
|
|
||||||
|
// 获取首页的头像
|
||||||
|
model.addAttribute("avatar", sysUserService.getUserAvatarUrl(simpleUserInfo.getAvatar()));
|
||||||
|
|
||||||
|
// 获取人员姓名
|
||||||
|
model.addAttribute("name", simpleUserInfo.getRealName());
|
||||||
|
|
||||||
|
return "/index.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前用户没有登录,跳转到登录页面
|
||||||
|
return "/login.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package cn.stylefeng.guns.modular.controller;
|
package cn.stylefeng.guns.modular.controller;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.auth.api.AuthServiceApi;
|
import cn.stylefeng.roses.kernel.auth.api.AuthServiceApi;
|
||||||
|
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginRequest;
|
import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginRequest;
|
||||||
import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginResponse;
|
import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginResponse;
|
||||||
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
|
||||||
|
@ -9,36 +10,52 @@ import cn.stylefeng.roses.kernel.resource.api.annotation.PostResource;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录登出控制器
|
* 首页相关的界面渲染
|
||||||
*
|
*
|
||||||
* @author majianguo
|
* @author fengshuonan
|
||||||
* @date 2020/12/3 下午6:15
|
* @date 2020/12/27 16:23
|
||||||
*/
|
*/
|
||||||
@RestController
|
@Controller
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ApiResource(name = "登陆登出管理")
|
@ApiResource(name = "登录相关的接口")
|
||||||
public class LoginController {
|
public class LoginViewController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AuthServiceApi authServiceApi;
|
private AuthServiceApi authServiceApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户登陆
|
* 登录界面
|
||||||
*
|
*
|
||||||
* @param loginRequest 用户帐号和密码
|
* @author fengshuonan
|
||||||
* @return 登陆成功返回token以及用户信息
|
* @date 2020/12/27 17:10
|
||||||
* @author majianguo
|
|
||||||
* @date 2020/12/4 上午9:05
|
|
||||||
*/
|
*/
|
||||||
@PostResource(name = "登陆", path = "/login", requiredLogin = false, requiredPermission = false)
|
@GetResource(name = "登录界面", path = "/login", requiredPermission = false, requiredLogin = false)
|
||||||
public ResponseData doAuth(@RequestBody @Validated LoginRequest loginRequest) {
|
public String login() {
|
||||||
|
if (LoginContext.me().hasLogin()) {
|
||||||
|
return "redirect:/";
|
||||||
|
} else {
|
||||||
|
return "/login.html";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录接口
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2020/12/27 17:10
|
||||||
|
*/
|
||||||
|
@PostResource(name = "登录接口", path = "/loginAction", requiredPermission = false, requiredLogin = false)
|
||||||
|
@ResponseBody
|
||||||
|
public ResponseData loginAction(@RequestBody @Validated LoginRequest loginRequest) {
|
||||||
LoginResponse loginResponse = authServiceApi.login(loginRequest);
|
LoginResponse loginResponse = authServiceApi.login(loginRequest);
|
||||||
return new SuccessResponseData(loginResponse.getToken());
|
return new SuccessResponseData(loginResponse.getToken());
|
||||||
}
|
}
|
||||||
|
@ -50,7 +67,8 @@ public class LoginController {
|
||||||
* @author majianguo
|
* @author majianguo
|
||||||
* @date 2020/12/4 上午9:05
|
* @date 2020/12/4 上午9:05
|
||||||
*/
|
*/
|
||||||
@GetResource(name = "登出", path = "/logout", requiredPermission = false)
|
@GetResource(name = "登出接口", path = "/logout", requiredPermission = false)
|
||||||
|
@ResponseBody
|
||||||
public ResponseData logoutPage() {
|
public ResponseData logoutPage() {
|
||||||
authServiceApi.logout();
|
authServiceApi.logout();
|
||||||
return new SuccessResponseData();
|
return new SuccessResponseData();
|
|
@ -0,0 +1,15 @@
|
||||||
|
package cn.stylefeng.guns.modular.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页相关数据组装服务
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2020/12/27 18:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class IndexService {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "scanner.open",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for scanner.open."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sys-log.type",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for sys-log.type."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sys-log.file-save-path",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for sys-log.file-save-path."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.datasource.max-active",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for spring.datasource.max-active."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.datasource.max-pool-prepared-statement-per-connection-size",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Description for spring.datasource.max-pool-prepared-statement-per-connection-size."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -24,7 +24,8 @@ spring:
|
||||||
scanner:
|
scanner:
|
||||||
open: true
|
open: true
|
||||||
sys-log:
|
sys-log:
|
||||||
type: db # db-数据库,file-文件
|
# db-数据库,file-文件
|
||||||
|
type: db
|
||||||
file-save-path: _sys_logs
|
file-save-path: _sys_logs
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
|
@ -39,10 +40,4 @@ mybatis-plus:
|
||||||
enable-sql-runner: true
|
enable-sql-runner: true
|
||||||
db-config:
|
db-config:
|
||||||
id-type: assign_id
|
id-type: assign_id
|
||||||
table-underline: true
|
table-underline: true
|
||||||
|
|
||||||
session:
|
|
||||||
expiredSeconds: 1800
|
|
||||||
|
|
||||||
log:
|
|
||||||
path: _app_logs
|
|
|
@ -5,6 +5,7 @@ layui.define(['jquery'], function (exports) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.type = "post";
|
this.type = "post";
|
||||||
this.data = {};
|
this.data = {};
|
||||||
|
this.contentType = "application/json";
|
||||||
this.dataType = "json";
|
this.dataType = "json";
|
||||||
this.async = false;
|
this.async = false;
|
||||||
this.success = success;
|
this.success = success;
|
||||||
|
@ -25,9 +26,10 @@ layui.define(['jquery'], function (exports) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: me.type,
|
type: me.type,
|
||||||
url: me.url,
|
url: me.url,
|
||||||
|
contentType: me.contentType,
|
||||||
dataType: me.dataType,
|
dataType: me.dataType,
|
||||||
async: me.async,
|
async: me.async,
|
||||||
data: me.data,
|
data: JSON.stringify(me.data),
|
||||||
beforeSend: function (data) {
|
beforeSend: function (data) {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,21 +16,21 @@
|
||||||
<div class="layui-layout layui-layout-admin">
|
<div class="layui-layout layui-layout-admin">
|
||||||
|
|
||||||
<!-- 头部 -->
|
<!-- 头部 -->
|
||||||
@include("/common/_header.html"){}
|
@include("/layout/_header.html"){}
|
||||||
|
|
||||||
<!-- 侧边栏 -->
|
<!-- 侧边栏 -->
|
||||||
@include("/common/_sidebar.html"){}
|
@include("/layout/_sidebar.html"){}
|
||||||
|
|
||||||
<!-- 主体部分 -->
|
<!-- 主体部分 -->
|
||||||
@include("/common/_body.html"){}
|
@include("/layout/_body.html"){}
|
||||||
|
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
@include("/common/_footer.html"){}
|
@include("/layout/_footer.html"){}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 加载动画,移除位置在common.js中 -->
|
<!-- 加载动画,移除位置在common.js中 -->
|
||||||
@include("/common/loading.html"){}
|
@include("/layout/loading.html"){}
|
||||||
|
|
||||||
@/* 加入contextPath属性和session超时的配置 */
|
@/* 加入contextPath属性和session超时的配置 */
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -13,29 +13,16 @@
|
||||||
<a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
|
<a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@var types = shiro.getUser().systemTypes;
|
@if(objectUtil.isNotEmpty(layuiAppIndexMenus)){
|
||||||
@if(tool.isNotEmpty(types)){
|
@for(item in layuiAppIndexMenus) {
|
||||||
@for(type in types) {
|
@if(itemLP.index == 1){
|
||||||
@if(typeLP.index == 1){
|
<li class="layui-nav-item layui-hide-xs layui-this" lay-unselect><a nav-bind="${item.appCode}">${item.appCode}</a></li>
|
||||||
<li class="layui-nav-item layui-hide-xs layui-this" lay-unselect><a nav-bind="${type.code}">${type.name}</a></li>
|
|
||||||
@}else{
|
@}else{
|
||||||
<li class="layui-nav-item layui-hide-xs" lay-unselect><a nav-bind="${type.code}">${type.name}</a></li>
|
<li class="layui-nav-item layui-hide-xs" lay-unselect><a nav-bind="${item.appCode}">${item.appCode}</a></li>
|
||||||
@}
|
@}
|
||||||
@}
|
@}
|
||||||
@}
|
@}
|
||||||
|
|
||||||
@if(constants.getDefaultAdvert()){
|
|
||||||
<li class="layui-nav-item" lay-unselect>
|
|
||||||
<a href="https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=p4kqz45e" target="_blank">阿里云5折优惠券,点我领取</a>
|
|
||||||
</li>
|
|
||||||
<li class="layui-nav-item" lay-unselect>
|
|
||||||
<a style="color: #5FB878;" href="https://www.stylefeng.cn" target="_blank">Guns企业版,加群找群主买优惠</a>
|
|
||||||
</li>
|
|
||||||
<li class="layui-nav-item" lay-unselect>
|
|
||||||
<a style="color: #fe7300;" href="https://gitee.com/stylefeng/guns" target="_blank">请star支持一下Guns</a>
|
|
||||||
</li>
|
|
||||||
@}
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="layui-nav layui-layout-right">
|
<ul class="layui-nav layui-layout-right">
|
||||||
<li class="layui-nav-item layui-hide-xs" lay-unselect>
|
<li class="layui-nav-item layui-hide-xs" lay-unselect>
|
||||||
|
@ -47,20 +34,20 @@
|
||||||
<li class="layui-nav-item" lay-unselect>
|
<li class="layui-nav-item" lay-unselect>
|
||||||
<a>
|
<a>
|
||||||
<img src="${avatar!}" class="layui-nav-img">
|
<img src="${avatar!}" class="layui-nav-img">
|
||||||
<cite>${name!"用户"}</cite>
|
<cite>写死的用户</cite>
|
||||||
</a>
|
</a>
|
||||||
<dl class="layui-nav-child">
|
<dl class="layui-nav-child">
|
||||||
<dd lay-unselect>
|
<dd lay-unselect>
|
||||||
<a ew-href="${ctxPath}/system/user_info">${lang.get("MENU_PERSONAL_INFO","个人中心")}</a>
|
<a ew-href="${ctxPath}/system/user_info">个人中心</a>
|
||||||
</dd>
|
</dd>
|
||||||
<dd lay-unselect>
|
<dd lay-unselect>
|
||||||
<a id="setPsw">${lang.get("MENU_CHANGE_PASSWORD","修改密码")}</a>
|
<a id="setPsw">修改密码</a>
|
||||||
</dd>
|
</dd>
|
||||||
<hr>
|
<hr>
|
||||||
<div id="languageDiv"></div>
|
<div id="languageDiv"></div>
|
||||||
<hr>
|
<hr>
|
||||||
<dd lay-unselect>
|
<dd lay-unselect>
|
||||||
<a id="btnLogout">${lang.get("MENU_LOGOUT","退出")}</a>
|
<a id="btnLogout">退出</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -2,48 +2,48 @@
|
||||||
<div class="layui-side">
|
<div class="layui-side">
|
||||||
<div class="layui-side-scroll">
|
<div class="layui-side-scroll">
|
||||||
|
|
||||||
@for(item in menus){
|
@for(item in layuiAppIndexMenus){
|
||||||
<ul class="layui-nav layui-nav-tree arrow2" nav-id="${item.systemType}" lay-shrink="all" lay-filter="admin-side-nav" style="margin-top: 15px;">
|
<ul class="layui-nav layui-nav-tree arrow2" nav-id="${item.appCode}" lay-shrink="all" lay-filter="admin-side-nav" style="margin-top: 15px;">
|
||||||
@for(menu in item.menus) {
|
@for(menu in item.layuiIndexMenuTreeNodes) {
|
||||||
@if(tool.isEmpty(menu.children)){
|
@if(objectUtil.isEmpty(menu.children)){
|
||||||
<li class="layui-nav-item">
|
<li class="layui-nav-item">
|
||||||
@if(itemLP.first && menuLP.first){
|
@if(itemLP.first && menuLP.first){
|
||||||
<a id="firstPageAction" lay-href="${menu.url}"><i class="layui-icon ${menu.icon}"></i> <cite>${menu.name}</cite></a>
|
<a id="firstPageAction" lay-href="${menu.router}"><i class="layui-icon ${menu.icon}"></i> <cite>${menu.menuName}</cite></a>
|
||||||
@}else{
|
@}else{
|
||||||
<a lay-href="${menu.url}"><i class="layui-icon ${menu.icon}"></i> <cite>${menu.name}</cite></a>
|
<a lay-href="${menu.router}"><i class="layui-icon ${menu.icon}"></i> <cite>${menu.menuName}</cite></a>
|
||||||
@}
|
@}
|
||||||
</li>
|
</li>
|
||||||
@}else{
|
@}else{
|
||||||
<li class="layui-nav-item">
|
<li class="layui-nav-item">
|
||||||
<a><i class="layui-icon ${menu.icon}"></i> <cite>${menu.name}</cite></a>
|
<a><i class="layui-icon ${menu.icon}"></i> <cite>${menu.menuName}</cite></a>
|
||||||
<dl class="layui-nav-child">
|
<dl class="layui-nav-child">
|
||||||
@for(subMenu in menu.children){
|
@for(subMenu in menu.children){
|
||||||
@if(tool.isEmpty(subMenu.children)){
|
@if(objectUtil.isEmpty(subMenu.children)){
|
||||||
@if(itemLP.first && menuLP.first && subMenuLP.first){
|
@if(itemLP.first && menuLP.first && subMenuLP.first){
|
||||||
<dd><a id="firstPageAction" lay-href="${subMenu.url}">${subMenu.name}</a></dd>
|
<dd><a id="firstPageAction" lay-href="${subMenu.router}">${subMenu.menuName}</a></dd>
|
||||||
@}else{
|
@}else{
|
||||||
<dd><a lay-href="${subMenu.url}">${subMenu.name}</a></dd>
|
<dd><a lay-href="${subMenu.router}">${subMenu.menuName}</a></dd>
|
||||||
@}
|
@}
|
||||||
@}else{
|
@}else{
|
||||||
<dd>
|
<dd>
|
||||||
<a>${subMenu.name}</a>
|
<a>${subMenu.menuName}</a>
|
||||||
<dl class="layui-nav-child">
|
<dl class="layui-nav-child">
|
||||||
@for(subSubMenu in subMenu.children){
|
@for(subSubMenu in subMenu.children){
|
||||||
@if(tool.isEmpty(subSubMenu.children)){
|
@if(objectUtil.isEmpty(subSubMenu.children)){
|
||||||
@if(itemLP.first && menuLP.first && subMenuLP.first && subSubMenuLP.first){
|
@if(itemLP.first && menuLP.first && subMenuLP.first && subSubMenuLP.first){
|
||||||
<dd><a id="firstPageAction" lay-href="${subSubMenu.url}">${subSubMenu.name}</a></dd>
|
<dd><a id="firstPageAction" lay-href="${subSubMenu.router}">${subSubMenu.menuName}</a></dd>
|
||||||
@}else{
|
@}else{
|
||||||
<dd><a lay-href="${subSubMenu.url}">${subSubMenu.name}</a></dd>
|
<dd><a lay-href="${subSubMenu.router}">${subSubMenu.menuName}</a></dd>
|
||||||
@}
|
@}
|
||||||
@}else{
|
@}else{
|
||||||
<dd>
|
<dd>
|
||||||
<a>${subSubMenu.name}</a>
|
<a>${subSubMenu.menuName}</a>
|
||||||
<dl class="layui-nav-child">
|
<dl class="layui-nav-child">
|
||||||
@for(subSubSubMenu in subSubMenu.children){
|
@for(subSubSubMenu in subSubMenu.children){
|
||||||
@if(itemLP.first && menuLP.first && subMenuLP.first && subSubMenuLP.first && subSubSubMenuLP.first){
|
@if(itemLP.first && menuLP.first && subMenuLP.first && subSubMenuLP.first && subSubSubMenuLP.first){
|
||||||
<dd><a id="firstPageAction" lay-href="${subSubSubMenu.url}">${subSubSubMenu.name}</a></dd>
|
<dd><a id="firstPageAction" lay-href="${subSubSubMenu.router}">${subSubSubMenu.menuName}</a></dd>
|
||||||
@}else{
|
@}else{
|
||||||
<dd><a lay-href="${subSubSubMenu.url}">${subSubSubMenu.name}</a></dd>
|
<dd><a lay-href="${subSubSubMenu.router}">${subSubSubMenu.menuName}</a></dd>
|
||||||
@}
|
@}
|
||||||
@}
|
@}
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
@ -179,17 +179,13 @@
|
||||||
<i class="layui-icon layui-icon-password"></i>
|
<i class="layui-icon layui-icon-password"></i>
|
||||||
<input class="layui-input" id="password" name="password" placeholder="请输入登录密码" value="111111" type="password" lay-verType="tips" lay-verify="required" required/>
|
<input class="layui-input" id="password" name="password" placeholder="请输入登录密码" value="111111" type="password" lay-verType="tips" lay-verify="required" required/>
|
||||||
</div>
|
</div>
|
||||||
@if(constants.getKaptchaOpen()){
|
@if(constants.getCaptchaOpen()){
|
||||||
<div class="layui-form-item layui-input-icon-group login-captcha-group">
|
<div class="layui-form-item layui-input-icon-group login-captcha-group">
|
||||||
<i class="layui-icon layui-icon-auz"></i>
|
<i class="layui-icon layui-icon-auz"></i>
|
||||||
<input class="layui-input" id="kaptcha" placeholder="请输入验证码" autocomplete="off" lay-verType="tips" lay-verify="required" required/>
|
<input class="layui-input" id="kaptcha" placeholder="请输入验证码" autocomplete="off" lay-verType="tips" lay-verify="required" required/>
|
||||||
<img class="login-captcha" src="${ctxPath}/kaptcha" alt=""/>
|
<img class="login-captcha" src="${ctxPath}/kaptcha" alt=""/>
|
||||||
</div>
|
</div>
|
||||||
@}
|
@}
|
||||||
<!-- <div class="layui-form-item">-->
|
|
||||||
<!-- <input type="checkbox" name="remember" title="记住密码" lay-skin="primary" checked>-->
|
|
||||||
<!-- <a href="javascript:;" class="layui-link pull-right">注册账号</a>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<button class="layui-btn layui-btn-fluid" id="submit">登录</button>
|
<button class="layui-btn layui-btn-fluid" id="submit">登录</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -215,13 +211,12 @@
|
||||||
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
|
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
|
||||||
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
|
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
|
||||||
<script>
|
<script>
|
||||||
layui.use(['layer', 'form', 'index', 'ax', 'notice'], function () {
|
layui.use(['layer', 'form', 'index', 'ax'], function () {
|
||||||
var $ = layui.jquery;
|
var $ = layui.jquery;
|
||||||
var layer = layui.layer;
|
var layer = layui.layer;
|
||||||
var form = layui.form;
|
var form = layui.form;
|
||||||
var $ax = layui.ax;
|
var $ax = layui.ax;
|
||||||
var index = layui.index;
|
var index = layui.index;
|
||||||
var notice = layui.notice;
|
|
||||||
|
|
||||||
$('.login-wrapper').removeClass('layui-hide');
|
$('.login-wrapper').removeClass('layui-hide');
|
||||||
|
|
||||||
|
@ -251,19 +246,19 @@
|
||||||
|
|
||||||
//登录操作
|
//登录操作
|
||||||
$('#submit').click(function () {
|
$('#submit').click(function () {
|
||||||
var ajax = new $ax(Feng.ctxPath + "/login", function (data) {
|
var ajax = new $ax(Feng.ctxPath + "/loginAction", function (data) {
|
||||||
Feng.success("登录成功!");
|
Feng.success("登录成功!");
|
||||||
index.clearTabCache();
|
index.clearTabCache();
|
||||||
window.location.href = Feng.ctxPath + "/";
|
window.location.href = Feng.ctxPath + "/";
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
layer.msg("登录失败!" + data.responseJSON.message, {icon: 5, anim: 6});
|
layer.msg("登录失败!" + data.responseJSON.message, {icon: 5, anim: 6});
|
||||||
});
|
});
|
||||||
ajax.set("username", $("#username").val());
|
ajax.set("account", $("#username").val());
|
||||||
ajax.set("password", $("#password").val());
|
ajax.set("password", $("#password").val());
|
||||||
@if(constants.getTenantOpen()){
|
@if(constants.getTenantOpen()){
|
||||||
ajax.set("tenantCode", $("#tenantCode").val());
|
ajax.set("tenantCode", $("#tenantCode").val());
|
||||||
@}
|
@}
|
||||||
@if(constants.getKaptchaOpen()){
|
@if(constants.getCaptchaOpen()){
|
||||||
ajax.set("kaptcha", $("#kaptcha").val());
|
ajax.set("kaptcha", $("#kaptcha").val());
|
||||||
@}
|
@}
|
||||||
ajax.start();
|
ajax.start();
|
||||||
|
@ -272,6 +267,5 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue