权限开发,页面交互开发,增加阅读数

This commit is contained in:
暮光:城中城
2019-06-05 22:53:24 +08:00
parent 96d081fdae
commit 605c97347d
34 changed files with 537 additions and 5282 deletions

View File

@@ -1,20 +0,0 @@
package com.zyplayer.doc.manage.web.generator;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author 暮光:城中城
* @since 2018-12-05
*/
@RestController
@RequestMapping("/auth-info")
public class GeneratorAuthInfoController {
}

View File

@@ -1,20 +0,0 @@
package com.zyplayer.doc.manage.web.generator;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author 暮光:城中城
* @since 2018-12-05
*/
@RestController
@RequestMapping("/user-auth")
public class GeneratorUserAuthController {
}

View File

@@ -1,20 +0,0 @@
package com.zyplayer.doc.manage.web.generator;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author 暮光:城中城
* @since 2018-12-05
*/
@RestController
@RequestMapping("/user-info")
public class GeneratorUserInfoController {
}

View File

@@ -1,20 +0,0 @@
package com.zyplayer.doc.manage.web.generator;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author 暮光:城中城
* @since 2018-12-05
*/
@RestController
@RequestMapping("/zyplayer-storage")
public class GeneratorZyplayerStorageController {
}

View File

@@ -0,0 +1,34 @@
package com.zyplayer.doc.manage.web.manage;
import com.zyplayer.doc.data.aspect.AuthMan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* 使用路劲的方式访问页面
*/
@AuthMan
@Controller
public class DocSystemController {
@GetMapping("/doc-wiki")
public ModelAndView wiki() {
return new ModelAndView("/doc-wiki-v2.html");
}
@GetMapping("/doc-db")
public ModelAndView db() {
return new ModelAndView("/doc-db.html");
}
@GetMapping("/doc-swagger")
public ModelAndView swagger() {
return new ModelAndView("/document.html");
}
@GetMapping("/doc-dubbo")
public ModelAndView dubbo() {
return new ModelAndView("/doc-dubbo.html");
}
}

View File

@@ -72,6 +72,11 @@ public class LoginController {
cookie.setDomain("zyplayer.com");
cookie.setMaxAge(60 * 60 * 24);
response.addCookie(cookie);
// 再搞一份当前路劲的cookie
cookie = new Cookie("accessToken", accessToken);
cookie.setPath("/");
cookie.setMaxAge(60 * 60 * 24);
response.addCookie(cookie);
return DocResponseJson.ok();
}

View File

@@ -3,6 +3,21 @@
-- 直接存权限名,不搞中间表了
ALTER TABLE `user_auth` ADD COLUMN `auth_custom_suffix` varchar(100) NULL COMMENT '自定义权限结尾';
INSERT INTO `auth_info`(`auth_name`, `auth_desc`, `can_edit`, `create_uid`, `creation_time`)
VALUES
( 'WIKI_CREATE_PAGE_', '创建wiki文档', 0, 1, '2019-06-04 13:01:20')
,('WIKI_EDIT_PAGE_', '编辑wiki文档', 0, 1, '2019-06-04 13:01:20')
,('WIKI_COMMENT_PAGE_', '评论wiki文档', 0, 1, '2019-06-04 13:01:20')
,('WIKI_DELETE_PAGE_', '删除wiki文档', 0, 1, '2019-06-04 13:01:20')
,('WIKI_PAGE_FILE_UPLOAD_', '上传wiki文档附件', 0, 1, '2019-06-04 13:01:20')
,('WIKI_PAGE_FILE_DELETE_', '删除wiki文档附件', 0, 1, '2019-06-04 13:01:20')
,('WIKI_PAGE_AUTH_MANAGE_', 'wiki权限管理', 0, 1, '2019-06-04 13:01:20')
;
ALTER TABLE `wiki_page` ADD COLUMN `view_num` int NOT NULL DEFAULT 0 COMMENT '阅读数';
-- 权限的库:

View File

@@ -74,16 +74,22 @@
app.passwordError = "密码不能为空";
return;
}
post(ctx + "login", param, function (result) {
console.log(result);
if (result.errCode == 200) {
location.href = ctx + "static/manage/home.html";
} else {
app.passwordError = "登录失败," + result.errMsg;
}
}, function(){
// 通过nginx代理之后没端口但tomcat容器有端口会跨域异常但正常登陆了的直接跳
location.href = ctx + "static/manage/home.html";
var returnUrl = common.getParam("returnUrl");
if (!!returnUrl) {
returnUrl = decodeURI(returnUrl);
} else {
returnUrl = ctx + "static/manage/home.html";
}
post(ctx + "login", param, function (result) {
console.log(result);
if (result.errCode == 200) {
location.href = returnUrl;
} else {
app.passwordError = "登录失败," + result.errMsg;
}
}, function () {
// 通过nginx代理之后没端口但tomcat容器有端口会跨域异常但正常登陆了的直接跳
// location.href = returnUrl;
});
},
init: function () {