增加下载数,页面跳转、展示优化

This commit is contained in:
暮光:城中城
2019-06-18 20:32:37 +08:00
parent 40f594f1ff
commit 994ced47bc
26 changed files with 419 additions and 79 deletions

View File

@@ -22,6 +22,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.util.Map; import java.util.Map;
@Aspect @Aspect
@@ -47,7 +48,8 @@ public class AuthAspect {
} else if (returnType.isAssignableFrom(ModelAndView.class)) { } else if (returnType.isAssignableFrom(ModelAndView.class)) {
HttpServletRequest request = ThreadLocalUtil.getHttpServletRequest(); HttpServletRequest request = ThreadLocalUtil.getHttpServletRequest();
StringBuffer requestURL = request.getRequestURL(); StringBuffer requestURL = request.getRequestURL();
return new ModelAndView("redirect:/static/manage/login.html?returnUrl=" + requestURL); String requestURLStr = URLEncoder.encode(requestURL.toString(), "utf-8");
return new ModelAndView("redirect:/static/manage/login.html?redirect=" + requestURLStr);
} else if (returnType.isAssignableFrom(Map.class)) { } else if (returnType.isAssignableFrom(Map.class)) {
return Maps.newHashMap(); return Maps.newHashMap();
} }

View File

@@ -79,6 +79,11 @@ public class WikiPageFile implements Serializable {
*/ */
private Integer delFlag; private Integer delFlag;
/**
* 下载次数
*/
private Integer downloadNum;
public Long getId() { public Long getId() {
return id; return id;
} }
@@ -181,4 +186,12 @@ public class WikiPageFile implements Serializable {
", delFlag=" + delFlag + ", delFlag=" + delFlag +
"}"; "}";
} }
public Integer getDownloadNum() {
return downloadNum;
}
public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum;
}
} }

View File

@@ -2,15 +2,19 @@ package com.zyplayer.doc.data.repository.manage.mapper;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile; import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
/** /**
* <p> * <p>
* Mapper 接口 * Mapper 接口
* </p> * </p>
* *
* @author 暮光:城中城 * @author 暮光:城中城
* @since 2019-03-06 * @since 2019-03-06
*/ */
public interface WikiPageFileMapper extends BaseMapper<WikiPageFile> { public interface WikiPageFileMapper extends BaseMapper<WikiPageFile> {
@Update("update wiki_page_file set download_num=download_num+1 where id=#{id}")
void addDownloadNum(@Param("id") Long id);
} }

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -151,8 +151,8 @@ function getObjectFirstAttributeIfOnly(data) {
function postService(url, param, success=function(){}, complete=function(){}){ function postService(url, param, success=function(){}, complete=function(){}){
ajaxTemp(url, "POST", "JSON", param, function(result){ ajaxTemp(url, "POST", "JSON", param, function(result){
if (result.errCode == 400) { if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else if (result.errCode != "200") { } else if (result.errCode != "200") {
Toast.warn(result.errMsg); Toast.warn(result.errMsg);
} else { } else {
@@ -185,8 +185,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -151,8 +151,8 @@ function getObjectFirstAttributeIfOnly(data) {
function postService(url, param, success=function(){}, complete=function(){}){ function postService(url, param, success=function(){}, complete=function(){}){
ajaxTemp(url, "POST", "JSON", param, function(result){ ajaxTemp(url, "POST", "JSON", param, function(result){
if (result.errCode == 400) { if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else if (result.errCode != "200") { } else if (result.errCode != "200") {
Toast.warn(result.errMsg); Toast.warn(result.errMsg);
} else { } else {
@@ -185,8 +185,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -197,8 +197,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -197,8 +197,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -13,10 +13,8 @@ import com.zyplayer.doc.data.service.manage.UserAuthService;
import com.zyplayer.doc.data.service.manage.UserInfoService; import com.zyplayer.doc.data.service.manage.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -33,15 +31,11 @@ public class LoginController {
@Autowired @Autowired
private AuthInfoService authInfoService; private AuthInfoService authInfoService;
@GetMapping(value = "/login")
public ModelAndView loginPage() {
return new ModelAndView("/statics/manage/login.html");
}
@PostMapping(value = "/login") @PostMapping(value = "/login")
public DocResponseJson<Object> login(String username, String password, HttpServletResponse response) { public DocResponseJson<Object> login(String username, String password, HttpServletResponse response) {
QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_no", username); queryWrapper.eq("user_no", username);
queryWrapper.eq("del_flag", 0);
UserInfo userInfo = userInfoService.getOne(queryWrapper); UserInfo userInfo = userInfoService.getOne(queryWrapper);
if (userInfo == null) { if (userInfo == null) {
return DocResponseJson.warn("用户名'" + username + "'没有找到!"); return DocResponseJson.warn("用户名'" + username + "'没有找到!");
@@ -60,7 +54,7 @@ public class LoginController {
Map<Long, String> authNameMap = authInfoList.stream().collect(Collectors.toMap(AuthInfo::getId, AuthInfo::getAuthName)); Map<Long, String> authNameMap = authInfoList.stream().collect(Collectors.toMap(AuthInfo::getId, AuthInfo::getAuthName));
userAuthSet = userAuthList.stream().map(val -> { userAuthSet = userAuthList.stream().map(val -> {
String authName = Optional.ofNullable(authNameMap.get(val.getAuthId())).orElse(""); String authName = Optional.ofNullable(authNameMap.get(val.getAuthId())).orElse("");
return authName + val.getAuthCustomSuffix(); return authName + Optional.ofNullable(val.getAuthCustomSuffix()).orElse("");
}).collect(Collectors.toSet()); }).collect(Collectors.toSet());
} }
String accessToken = RandomUtil.simpleUUID(); String accessToken = RandomUtil.simpleUUID();

View File

@@ -70,7 +70,8 @@ public class UserInfoController {
}); });
return DocResponseJson.ok(authInfoVoList); return DocResponseJson.ok(authInfoVoList);
} }
@AuthMan("AUTH_ASSIGN")
@PostMapping("/auth/update") @PostMapping("/auth/update")
public ResponseJson<Object> updateAuth(String userIds, String authIds) { public ResponseJson<Object> updateAuth(String userIds, String authIds) {
List<Long> userIdsList = Arrays.stream(userIds.split(",")).map(Long::valueOf).collect(Collectors.toList()); List<Long> userIdsList = Arrays.stream(userIds.split(",")).map(Long::valueOf).collect(Collectors.toList());

View File

@@ -19,6 +19,297 @@ ALTER TABLE `wiki_page` ADD COLUMN `seq_no` int NOT NULL DEFAULT 0 COMMENT '顺
UPDATE wiki_page SET seq_no=id WHERE del_flag=0; UPDATE wiki_page SET seq_no=id WHERE del_flag=0;
ALTER TABLE `wiki_page_content` ADD COLUMN `preview` varchar(1024) NULL COMMENT '预览内容'; ALTER TABLE `wiki_page_content` ADD COLUMN `preview` varchar(1024) NULL COMMENT '预览内容';
ALTER TABLE `wiki_page_file` ADD COLUMN `download_num` int NOT NULL DEFAULT 0 COMMENT '下载次数';
-- 全新的库:
-- ------------------------全新的库:------------------------
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50724
Source Host : 127.0.0.1:3306
Source Schema : zyplayer_doc_manage
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
Date: 18/06/2019 20:29:06
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for auth_info
-- ----------------------------
DROP TABLE IF EXISTS `auth_info`;
CREATE TABLE `auth_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`auth_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限名',
`auth_desc` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限说明',
`can_edit` tinyint(4) NULL DEFAULT 1 COMMENT '是否可编辑 0=否 1=是',
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '权限信息表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of auth_info
-- ----------------------------
INSERT INTO `auth_info` VALUES (1, 'DOC_ALL', '文档查看权', 0, 1, '2018-12-01 11:40:42');
INSERT INTO `auth_info` VALUES (2, 'AUTH_MANAGE', '权限管理权', 0, 1, '2018-12-01 11:40:42');
INSERT INTO `auth_info` VALUES (3, 'AUTH_ASSIGN', '权限分配权', 0, 1, '2018-12-01 11:40:42');
INSERT INTO `auth_info` VALUES (4, 'USER_MANAGE', '用户管理权', 0, 1, '2018-12-01 11:40:42');
INSERT INTO `auth_info` VALUES (5, 'WIKI_EDIT_PAGE_', '编辑wiki文档', 0, 1, '2019-06-04 13:01:20');
INSERT INTO `auth_info` VALUES (6, 'WIKI_VIEW_PAGE_', '查看wiki文档', 0, 1, '2019-06-04 13:01:20');
INSERT INTO `auth_info` VALUES (7, 'WIKI_COMMENT_PAGE_', '评论wiki文档', 0, 1, '2019-06-04 13:01:20');
INSERT INTO `auth_info` VALUES (8, 'WIKI_DELETE_PAGE_', '删除wiki文档', 0, 1, '2019-06-04 13:01:20');
INSERT INTO `auth_info` VALUES (9, 'WIKI_PAGE_FILE_UPLOAD_', '上传wiki文档附件', 0, 1, '2019-06-04 13:01:20');
INSERT INTO `auth_info` VALUES (10, 'WIKI_PAGE_FILE_DELETE_', '删除wiki文档附件', 0, 1, '2019-06-04 13:01:20');
INSERT INTO `auth_info` VALUES (11, 'WIKI_PAGE_AUTH_MANAGE_', 'wiki权限管理', 0, 1, '2019-06-04 13:01:20');
-- ----------------------------
-- Table structure for user_auth
-- ----------------------------
DROP TABLE IF EXISTS `user_auth`;
CREATE TABLE `user_auth` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
`auth_id` bigint(20) NULL DEFAULT NULL COMMENT '权限ID',
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建用户ID',
`update_uid` bigint(20) NULL DEFAULT NULL COMMENT '更新用户ID',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`auth_custom_suffix` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '自定义权限结尾',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 31 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户权限表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of user_auth
-- ----------------------------
INSERT INTO `user_auth` VALUES (9, 2, 1, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (10, 2, 2, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (11, 2, 3, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (12, 2, 4, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (13, 3, 1, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (14, 3, 2, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (15, 3, 3, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (16, 3, 4, 1, NULL, 0, '2018-12-15 22:19:59', NULL, NULL);
INSERT INTO `user_auth` VALUES (24, 1, 1, 1, NULL, 0, '2018-12-16 21:41:01', NULL, NULL);
INSERT INTO `user_auth` VALUES (25, 1, 2, 1, NULL, 0, '2018-12-16 21:41:01', NULL, NULL);
INSERT INTO `user_auth` VALUES (26, 1, 3, 1, NULL, 0, '2018-12-16 21:41:01', NULL, NULL);
INSERT INTO `user_auth` VALUES (27, 1, 4, 1, NULL, 0, '2018-12-16 21:41:01', NULL, NULL);
INSERT INTO `user_auth` VALUES (28, 1, 5, 1, NULL, 0, '2019-06-12 12:19:47', NULL, '7');
INSERT INTO `user_auth` VALUES (29, 1, 7, 1, NULL, 0, '2019-06-12 12:19:47', NULL, '7');
INSERT INTO `user_auth` VALUES (30, 1, 9, 1, NULL, 0, '2019-06-12 12:19:47', NULL, '7');
-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`user_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户编号,用于登录等',
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
`user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`avatar` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_userNo`(`user_no`) USING BTREE COMMENT '登录用户名'
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of user_info
-- ----------------------------
INSERT INTO `user_info` VALUES (1, 'zyplayer', 'e10adc3949ba59abbe56e057f20f883e', '暮光:城中城', '806783409@qq.com', NULL, 0, '2018-12-01 11:37:39', NULL, '2018-12-15 20:32:08');
INSERT INTO `user_info` VALUES (2, '1', 'e10adc3949ba59abbe56e057f20f883e', '1111', NULL, NULL, 0, '2018-12-15 20:16:10', 1, '2018-12-15 20:19:50');
-- ----------------------------
-- Table structure for wiki_page
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page`;
CREATE TABLE `wiki_page` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`space_id` bigint(20) NULL DEFAULT NULL COMMENT '空间ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名字',
`parent_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '父ID',
`node_type` tinyint(4) NULL DEFAULT 0 COMMENT '节点类型 0=有子节点 1=终节点',
`zan_num` int(11) NOT NULL DEFAULT 0 COMMENT '赞的数量',
`edit_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '编辑类型 0=可编辑 1=不允许编辑',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名字',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
`update_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人名字',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0=有效 1=删除',
`view_num` int(11) NOT NULL DEFAULT 0 COMMENT '阅读数',
`seq_no` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page
-- ----------------------------
INSERT INTO `wiki_page` VALUES (1, 1, '关于zyplayer-doc工具', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:01:41', 1, '暮光:城中城', '2019-06-14 16:51:44', 0, 25, 1);
INSERT INTO `wiki_page` VALUES (2, 1, '开发规划', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:14:02', 1, '暮光:城中城', '2019-06-14 13:30:22', 0, 30, 4);
INSERT INTO `wiki_page` VALUES (3, 1, '升级日志', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 14:16:20', 1, '暮光:城中城', '2019-06-14 16:49:30', 0, 21, 5);
INSERT INTO `wiki_page` VALUES (4, 1, '贡献人员列表', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 15:16:15', 1, '暮光:城中城', '2019-06-14 13:20:43', 0, 13, 7);
INSERT INTO `wiki_page` VALUES (5, 1, 'zyplayer-doc-swagger', 0, 0, 1, 0, 1, '暮光:城中城', '2019-03-09 15:33:14', NULL, NULL, NULL, 0, 20, 9);
INSERT INTO `wiki_page` VALUES (6, 1, '如何使用', 5, 0, 0, 0, 1, '暮光:城中城', '2019-03-09 15:33:33', 1, '暮光:城中城', '2019-03-09 15:33:46', 0, 3, 14);
INSERT INTO `wiki_page` VALUES (7, 2, '所有格式测试', 0, 0, 0, 0, 1, '暮光:城中城', '2019-03-12 12:21:26', NULL, NULL, NULL, 0, 13, 13);
-- ----------------------------
-- Table structure for wiki_page_comment
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_comment`;
CREATE TABLE `wiki_page_comment` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
`parent_id` bigint(20) NULL DEFAULT NULL COMMENT '父评论ID',
`content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评论内容',
`zan_num` int(11) NOT NULL DEFAULT 0 COMMENT '赞的数量',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名字',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page_comment
-- ----------------------------
-- ----------------------------
-- Table structure for wiki_page_content
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_content`;
CREATE TABLE `wiki_page_content` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
`content` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名字',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
`update_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '修改人名字',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
`preview` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '预览内容',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_page_id`(`page_id`) USING BTREE COMMENT '页面ID'
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page_content
-- ----------------------------
INSERT INTO `wiki_page_content` VALUES (1, 1, '<p>一入开源深似海</p><br>源码地址:<a href=\"https://gitee.com/zyplayer/zyplayer-doc\" target=\"_blank\">https://gitee.com/zyplayer/zyplayer-doc</a><p>体验地址:<a href=\"http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html\" target=\"_blank\">http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html</a>&nbsp;账号zyplayer 密码123456</p><p><br></p><p>更多实用功能请提交评论或加群交流!谢谢!<br></p><p>QQ群466363173</p>tips想要编辑本文请修改表wiki_page的edit_type字段值为0才行哦~<p><br></p><p>有什么问题可以来评论本文章哦!当然,如果你是部署在你们自己本地的我肯定看不到此文章的评论</p><p>可以到本工具官网下评论此文章,我会随时去查看的!</p><p>唯一官网地址:<a href=\"http://doc.zyplayer.com\" target=\"_blank\">http://doc.zyplayer.com</a></p><p><br></p><p>欢迎提交各种变态无理的要求~</p>', 1, '暮光:城中城', '2019-03-09 14:01:41', 1, '暮光:城中城', '2019-06-14 16:51:44', '一入开源深似海源码地址https://gitee.com/zyplayer/zyplayer-doc体验地址http://doc.zyplayer.com/zyplayer-doc-manage/static/manage/home.html&nbsp;账号zyplayer 密码123456更多实用功能请提交评论或加群交流谢谢QQ群466363173tips想要编辑本文请修改表w...');
INSERT INTO `wiki_page_content` VALUES (2, 2, '<p>zyplayer-doc-manage</p><p>1、首页做大的调整优化希望使用element重构一下</p><p>2、人员导入方案权限优化人员管理细化</p><p>&nbsp;</p><p>zyplayer-doc-wiki</p><p><prefira code\';font-size:10.5pt;\"=\"\">1<spancourier new\';\"=\"\"></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">2<spancourier new\';\"=\"\">、</spancourier></spancourier></spancourier></prefira>支持把一个空间里的文档一键同步到git<spancourier new\';\"=\"\">的wiki上统一管理文档</spancourier></p><p><spancourier new\';\"=\"\">3</spancourier></p><p>4</p><p>5</p><p>6</p><p>7访</p><p>8url动态变动</p><p>9https://www.kancloud.cn</p><p><br></p><p></p><p>PR</p><p><a href=\"https://gitee.com/zyplayer/zyplayer-doc\" target=\"_blank\">https://gitee.com/zyplayer/zyplayer-doc</a></p><p><br></p><p></p><p>QQ群466363173</p>', 1, '', '2019-03-09 14:14:02', 1, '', '2019-06-14 13:30:22', 'zyplayer-doc-manage1使element重构一下2&nbsp;zyplayer-doc-wiki12git的wiki上3456...');
INSERT INTO `wiki_page_content` VALUES (3, 3, '<p><span style=\"color: rgb(249, 150, 59);\">V1.0.1 2019-03-09</span></p><p>1zyplayer-doc-wiki模块</p><ul><li><br></li><li><br></li><li>wiki顺序<br></li><li></li></ul><p><prefira code\';font-size:10.5pt;\"=\"\">2<spancourier new\';\"=\"\">、dubbo<spancourier new\';\"=\"\">使dubbo2.7.0</spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">3<spancourier new\';\"=\"\">、框架进行了大的拆分,表修改较多</spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">4<spancourier new\';\"=\"\"></spancourier></spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\">5<spancourier new\';\"=\"\"></spancourier></spancourier></spancourier></spancourier></spancourier></prefira></p><p><prefira code\';font-size:10.5pt;\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><spancourier new\';\"=\"\"><br></spancourier></spancourier></spancourier></spancourier></spancourier></prefira></p><p><span style=\"color: rgb(249, 150, 59);\">V1.0.0 2019-02-15</span><br></p><p></p><p>1zyplayer-doc-swaggerswagger接口文档展示方案使访<br>2zyplayer-doc-dubbodubbo服务的自动扫描线zookeepernacos注册中心的服务扫描<br>3zyplayer-doc-db/mysql和sqlserver数据库<br>4zyplayer-doc-managespring boot项目spring security做权限管理</p>', 1, '', '2019-03-09 14:16:20', 1, '', '2019-06-14 16:49:30', 'V1.0.1 2019-03-091zyplayer-doc-wiki模块支持空间隔离支持附件上传拖动可以改变wiki顺序基本的文档创建2dubbo文档支持使用元数据生成参数和返回值dubbo2.7.0345V1.0.0 2019-02-151zyplayer-doc-swagge...');
INSERT INTO `wiki_page_content` VALUES (4, 4, '<p></p><p><a href=\"http://www.zyplayer.com\" target=\"_blank\"></a><br></p>', 1, '', '2019-03-09 15:16:15', 1, '', '2019-06-14 13:20:43', '');
INSERT INTO `wiki_page_content` VALUES (5, 5, '<p>zyplayer-doc-swagger 使</p>', 1, '', '2019-03-09 15:33:14', NULL, NULL, NULL, NULL);
INSERT INTO `wiki_page_content` VALUES (6, 6, '<p></p>', 1, '', '2019-03-09 15:33:33', 1, '', '2019-03-09 15:33:46', NULL);
INSERT INTO `wiki_page_content` VALUES (7, 7, '<h2>H2</h2><p><span style=\"font-weight: bold;\"></span></p><p><span style=\"font-size: xx-large;\"></span><span style=\"font-weight: bold;\"><br></span></p><p><span style=\"font-family: 宋体;\"></span>&nbsp;</p><p><span style=\"font-style: italic;\"></span></p><p><span style=\"text-decoration-line: underline;\">线线线</span><span style=\"font-style: italic;\"><br></span></p><p><span style=\"text-decoration-line: line-through;\">线线线</span><span style=\"text-decoration-line: underline;\"><br></span></p><p><span style=\"color: rgb(249, 150, 59);\"></span><span style=\"text-decoration-line: line-through;\"><br></span></p><p><span style=\"background-color: rgb(194, 79, 74);\"></span></p><p><a href=\"http://www.baidu.com/\" target=\"_blank\"></a><br></p><ol><li></li><li>xxx</li><li>xxx</li></ol><ul><li></li><li>xxx</li><li>xxx</li></ul><p style=\"text-align: center;\"></p><p style=\"text-align: right;\"></p><blockquote style=\"font-size: medium;\">xxxxx</blockquote><p><img src=\"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/50/pcmoren_huaixiao_org.png\" alt=\"[坏笑]\"><br></p><p></p><table border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><th>&nbsp;ID</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th><th>&nbsp;</th></tr><tr><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td><td>&nbsp;xx</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table><p><br></p><pre><code>public static void main(String[] args) {<br> System.out.println(\"hello world\");<br>}</code></pre><p><br></p>', 1, '', '2019-03-12 12:21:26', NULL, NULL, NULL, NULL);
-- ----------------------------
-- Table structure for wiki_page_file
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_file`;
CREATE TABLE `wiki_page_file` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`file_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`file_url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'URL',
`uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'UUID',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`update_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`update_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0= 1=',
`download_num` int(11) NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_uuid`(`uuid`) USING BTREE COMMENT 'ID'
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page_file
-- ----------------------------
-- ----------------------------
-- Table structure for wiki_page_zan
-- ----------------------------
DROP TABLE IF EXISTS `wiki_page_zan`;
CREATE TABLE `wiki_page_zan` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`page_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`comment_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`yn` tinyint(4) NULL DEFAULT NULL COMMENT ' 0= 1=',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_page_zan
-- ----------------------------
-- ----------------------------
-- Table structure for wiki_space
-- ----------------------------
DROP TABLE IF EXISTS `wiki_space`;
CREATE TABLE `wiki_space` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`type` tinyint(4) NULL DEFAULT 1 COMMENT ' 1= 2= 3=',
`space_explain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`edit_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`tree_lazy_load` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`open_doc` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
`uuid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'UUID',
`create_user_id` bigint(20) NULL DEFAULT NULL COMMENT 'ID',
`create_user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`del_flag` tinyint(4) NOT NULL DEFAULT 0 COMMENT ' 0= 1=',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of wiki_space
-- ----------------------------
INSERT INTO `wiki_space` VALUES (1, 'zyplayer-doc交流专用', 1, '', 0, 0, 1, '23f3f59a60824d21af9f7c3bbc9bc3cb', 1, '', '2019-03-09 13:59:14', 0);
INSERT INTO `wiki_space` VALUES (2, '', 2, '', 0, 0, 0, '91995a9a67bf45db9b5e58266517393e', 1, '', '2019-03-09 14:24:30', 0);
-- ----------------------------
-- Table structure for zyplayer_storage
-- ----------------------------
DROP TABLE IF EXISTS `zyplayer_storage`;
CREATE TABLE `zyplayer_storage` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`doc_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '',
`doc_value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '',
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `key`(`doc_key`) USING BTREE COMMENT 'key唯一索引'
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '' ROW_FORMAT = Compact;
-- ----------------------------
-- Records of zyplayer_storage
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -38,8 +38,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = ctx + "static/manage/login.html?redirect=" + href;
} else { } else {
alert(result.errMsg); alert(result.errMsg);
} }
@@ -226,8 +226,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = ctx + "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);
@@ -346,7 +346,7 @@ var common = {
}, },
getParam: function(name){ getParam: function(name){
var url = location.search;// 获取url中"?"符后的字串 var url = location.search;// 获取url中"?"符后的字串
url = decodeURIComponent(url); // url = decodeURIComponent(url);
if (url.indexOf("?") != -1) { if (url.indexOf("?") != -1) {
var str = url.substr(1); var str = url.substr(1);
strs = str.split("&"); strs = str.split("&");

View File

@@ -74,16 +74,20 @@
app.passwordError = "密码不能为空"; app.passwordError = "密码不能为空";
return; return;
} }
var returnUrl = common.getParam("returnUrl"); // 获取url中"?"符后的字串
if (!!returnUrl) { var href = location.href;
returnUrl = decodeURI(returnUrl); var url = href.substring(href.indexOf("?"), href.length);
var redirect = "";
if (url.indexOf("redirect=") > 0) {
redirect = url.substring(url.indexOf("redirect=") + 9, url.length);
redirect = decodeURIComponent(redirect);
} else { } else {
returnUrl = ctx + "static/manage/home.html"; redirect = ctx + "static/manage/home.html";
} }
post(ctx + "login", param, function (result) { post(ctx + "login", param, function (result) {
console.log(result); console.log(result);
if (result.errCode == 200) { if (result.errCode == 200) {
location.href = returnUrl; location.href = redirect;
} else { } else {
app.passwordError = "登录失败," + result.errMsg; app.passwordError = "登录失败," + result.errMsg;
} }

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -196,8 +196,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -196,8 +196,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -196,8 +196,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);

View File

@@ -418,6 +418,15 @@
init() { init() {
}, },
switchSpacePage(spaceId) {
spaceId = parseInt(spaceId);
if (app.choiceSpace == spaceId) {
return;
}
app.choiceSpace = spaceId;
app.nowClickPath.spaceId = spaceId;
this.doGetPageList(null);
},
} }
} }
</script> </script>

View File

@@ -4,9 +4,12 @@ var href = window.location.href;
var _fn = { var _fn = {
href: href, href: href,
// 这里设置接口域名 // 本地启动时使用本地接口调试
HOST: 'http://local.zyplayer.com:8083/zyplayer-doc-manage', // HOST: 'http://local.zyplayer.com:8083/zyplayer-doc-manage',
HOST1: 'http://local.zyplayer.com:8083/zyplayer-doc-manage', // HOST1: 'http://local.zyplayer.com:8083/zyplayer-doc-manage',
// 也可以直接使用线上的服务调试
HOST: 'http://doc.zyplayer.com/zyplayer-doc-manage',
HOST1: 'http://doc.zyplayer.com/zyplayer-doc-manage',
// 打包时使用下面这两行,文件就放在根目录下,所以当前路劲就好 // 打包时使用下面这两行,文件就放在根目录下,所以当前路劲就好
// HOST: './', // HOST: './',
// HOST1: './', // HOST1: './',

View File

@@ -23,8 +23,8 @@ export default {
global.vue.$message('请求错误:' + res.message); global.vue.$message('请求错误:' + res.message);
} else if (res.data.errCode == 400) { } else if (res.data.errCode == 400) {
global.vue.$message('请先登录'); global.vue.$message('请先登录');
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = apimix.apilist1.HOST + "/static/manage/login.html?returnUrl=" + href; window.location = apimix.apilist1.HOST + "/static/manage/login.html?redirect=" + href;
} else if (res.data.errCode == 402) { } else if (res.data.errCode == 402) {
global.vue.$router.push("/common/noAuth"); global.vue.$router.push("/common/noAuth");
} else if (res.data.errCode !== 200) { } else if (res.data.errCode !== 200) {

View File

@@ -30,8 +30,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createUserName" label="创建人"></el-table-column> <el-table-column prop="createUserName" label="创建人"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column> <el-table-column prop="createTime" label="创建时间" width="180px"></el-table-column>
<el-table-column label="操作"> <el-table-column prop="downloadNum" label="下载次数" width="80px"></el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="small" v-on:click="deletePageFile(scope.row)">删除</el-button> <el-button size="small" v-on:click="deletePageFile(scope.row)">删除</el-button>
</template> </template>
@@ -172,6 +173,10 @@
if (!!this.parentPath.pageId) { if (!!this.parentPath.pageId) {
// 延迟设置展开的目录edit比app先初始化 // 延迟设置展开的目录edit比app先初始化
setTimeout(function () { setTimeout(function () {
if (!!app.parentPath.spaceId) {
// 调用父方法切换选择的空间
global.vue.$app.switchSpacePage(app.parentPath.spaceId);
}
global.vue.$app.changeWikiPageExpandedKeys(app.parentPath.pageId); global.vue.$app.changeWikiPageExpandedKeys(app.parentPath.pageId);
}, 500); }, 500);
} }
@@ -267,6 +272,7 @@
app.pageContent = json.data.pageContent || {}; app.pageContent = json.data.pageContent || {};
app.pageFileList = json.data.fileList || []; app.pageFileList = json.data.fileList || [];
app.uploadFormData = {pageId: app.wikiPage.id}; app.uploadFormData = {pageId: app.wikiPage.id};
app.parentPath.spaceId = wikiPage.spaceId;
// 修改最后点击的项,保证刷新后点击编辑能展示编辑的项 // 修改最后点击的项,保证刷新后点击编辑能展示编辑的项
// if (!app.lastClickNode.id) { // if (!app.lastClickNode.id) {
// app.lastClickNode = {id: wikiPage.id, nodePath: wikiPage.name}; // app.lastClickNode = {id: wikiPage.id, nodePath: wikiPage.name};

View File

@@ -13,6 +13,7 @@ import com.zyplayer.doc.data.repository.manage.entity.UserInfo;
import com.zyplayer.doc.data.repository.manage.entity.WikiPage; import com.zyplayer.doc.data.repository.manage.entity.WikiPage;
import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile; import com.zyplayer.doc.data.repository.manage.entity.WikiPageFile;
import com.zyplayer.doc.data.repository.manage.entity.WikiSpace; import com.zyplayer.doc.data.repository.manage.entity.WikiSpace;
import com.zyplayer.doc.data.repository.manage.mapper.WikiPageFileMapper;
import com.zyplayer.doc.data.service.manage.UserInfoService; import com.zyplayer.doc.data.service.manage.UserInfoService;
import com.zyplayer.doc.data.service.manage.WikiPageFileService; import com.zyplayer.doc.data.service.manage.WikiPageFileService;
import com.zyplayer.doc.data.service.manage.WikiPageService; import com.zyplayer.doc.data.service.manage.WikiPageService;
@@ -59,6 +60,8 @@ public class WikiCommonController {
WikiSpaceService wikiSpaceService; WikiSpaceService wikiSpaceService;
@Resource @Resource
UserInfoService userInfoService; UserInfoService userInfoService;
@Resource
WikiPageFileMapper wikiPageFileMapper;
@PostMapping("/user/base") @PostMapping("/user/base")
public ResponseJson<Object> userBaseInfo(String search) { public ResponseJson<Object> userBaseInfo(String search) {
@@ -153,6 +156,8 @@ public class WikiCommonController {
return DocResponseJson.warn("登陆后才可访问此文件"); return DocResponseJson.warn("登陆后才可访问此文件");
} }
} }
// 增加下载次数
wikiPageFileMapper.addDownloadNum(pageFile.getId());
try { try {
String fileName = Optional.ofNullable(pageFile.getFileName()).orElse(""); String fileName = Optional.ofNullable(pageFile.getFileName()).orElse("");
File file = new File(pageFile.getFileUrl()); File file = new File(pageFile.getFileUrl());

View File

@@ -79,8 +79,10 @@ public class WikiOpenApiController {
} }
Map<Long, List<WikiPageVo>> listMap = wikiPageList.stream().map(val -> mapper.map(val, WikiPageVo.class)).collect(Collectors.groupingBy(WikiPageVo::getParentId)); Map<Long, List<WikiPageVo>> listMap = wikiPageList.stream().map(val -> mapper.map(val, WikiPageVo.class)).collect(Collectors.groupingBy(WikiPageVo::getParentId));
List<WikiPageVo> nodePageList = listMap.get(0L); List<WikiPageVo> nodePageList = listMap.get(0L);
nodePageList = nodePageList.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(nodePageList)) {
this.setChildren(listMap, nodePageList); nodePageList = nodePageList.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList());
this.setChildren(listMap, nodePageList);
}
return DocResponseJson.ok(nodePageList); return DocResponseJson.ok(nodePageList);
} }
@@ -129,7 +131,7 @@ public class WikiOpenApiController {
} }
for (WikiPageVo page : nodePageList) { for (WikiPageVo page : nodePageList) {
List<WikiPageVo> wikiPageVos = listMap.get(page.getId()); List<WikiPageVo> wikiPageVos = listMap.get(page.getId());
if (wikiPageVos != null && wikiPageVos.size() > 0) { if (CollectionUtils.isNotEmpty(wikiPageVos)) {
wikiPageVos = wikiPageVos.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList()); wikiPageVos = wikiPageVos.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList());
page.setChildren(wikiPageVos); page.setChildren(wikiPageVos);
this.setChildren(listMap, wikiPageVos); this.setChildren(listMap, wikiPageVos);

View File

@@ -18,6 +18,7 @@ import com.zyplayer.doc.wiki.controller.vo.WikiPageContentVo;
import com.zyplayer.doc.wiki.controller.vo.WikiPageVo; import com.zyplayer.doc.wiki.controller.vo.WikiPageVo;
import com.zyplayer.doc.wiki.framework.consts.SpaceType; import com.zyplayer.doc.wiki.framework.consts.SpaceType;
import com.zyplayer.doc.wiki.framework.consts.WikiAuthType; import com.zyplayer.doc.wiki.framework.consts.WikiAuthType;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.dozer.Mapper; import org.dozer.Mapper;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -74,11 +75,15 @@ public class WikiPageController {
List<WikiPageVo> nodePageList; List<WikiPageVo> nodePageList;
if (wikiPage.getParentId() == null) { if (wikiPage.getParentId() == null) {
nodePageList = listMap.get(0L); nodePageList = listMap.get(0L);
nodePageList = nodePageList.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(nodePageList)) {
this.setChildren(listMap, nodePageList, ""); nodePageList = nodePageList.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList());
this.setChildren(listMap, nodePageList, "");
}
} else { } else {
nodePageList = listMap.get(wikiPage.getParentId()); nodePageList = listMap.get(wikiPage.getParentId());
nodePageList = nodePageList.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(nodePageList)) {
nodePageList = nodePageList.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList());
}
} }
return DocResponseJson.ok(nodePageList); return DocResponseJson.ok(nodePageList);
} }
@@ -234,6 +239,7 @@ public class WikiPageController {
lastSeq = Optional.ofNullable(lastSeq).orElse(0); lastSeq = Optional.ofNullable(lastSeq).orElse(0);
wikiPage.setSeqNo(lastSeq + 1); wikiPage.setSeqNo(lastSeq + 1);
wikiPage.setCreateTime(new Date()); wikiPage.setCreateTime(new Date());
wikiPage.setUpdateTime(new Date());
wikiPage.setCreateUserId(currentUser.getUserId()); wikiPage.setCreateUserId(currentUser.getUserId());
wikiPage.setCreateUserName(currentUser.getUsername()); wikiPage.setCreateUserName(currentUser.getUsername());
wikiPageService.save(wikiPage); wikiPageService.save(wikiPage);
@@ -305,7 +311,7 @@ public class WikiPageController {
String nowPath = path + "/" + page.getName(); String nowPath = path + "/" + page.getName();
page.setPath(nowPath); page.setPath(nowPath);
List<WikiPageVo> wikiPageVos = listMap.get(page.getId()); List<WikiPageVo> wikiPageVos = listMap.get(page.getId());
if (wikiPageVos != null && wikiPageVos.size() > 0) { if (CollectionUtils.isNotEmpty(wikiPageVos)) {
wikiPageVos = wikiPageVos.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList()); wikiPageVos = wikiPageVos.stream().sorted(Comparator.comparingInt(WikiPage::getSeqNo)).collect(Collectors.toList());
page.setChildren(wikiPageVos); page.setChildren(wikiPageVos);
this.setChildren(listMap, wikiPageVos, nowPath); this.setChildren(listMap, wikiPageVos, nowPath);

View File

@@ -8,7 +8,7 @@
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="text/javascript" src="manifest.js?850ec2db42e66a151b7c"></script><script type="text/javascript" src="vendor.js?82212d6e35030c02aff9"></script><script type="text/javascript" src="index.js?d63c91c5b1bf6dec2ea0"></script></body> <script type="text/javascript" src="manifest.js?d019d6194cc995a8346a"></script><script type="text/javascript" src="vendor.js?82212d6e35030c02aff9"></script><script type="text/javascript" src="index.js?e0d7e5de80109913da55"></script></body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
!function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n=window.webpackJsonp;window.webpackJsonp=function(t,c,u){for(var i,a,f,l=0,s=[];l<t.length;l++)a=t[l],o[a]&&s.push(o[a][0]),o[a]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(t,c,u);s.length;)s.shift()();if(u)for(l=0;l<u.length;l++)f=r(r.s=u[l]);return f};var t={},o={2:0};r.e=function(e){function n(){u.onerror=u.onload=null,clearTimeout(i);var r=o[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}if(0===o[e])return Promise.resolve();if(o[e])return o[e][2];var t=new Promise(function(r,n){o[e]=[r,n]});o[e][2]=t;var c=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,r.nc&&u.setAttribute("nonce",r.nc),u.src=r.p+""+e+".js?"+{0:"82212d6e35030c02aff9",1:"d63c91c5b1bf6dec2ea0"}[e];var i=setTimeout(n,12e4);return u.onerror=u.onload=n,c.appendChild(u),t},r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r.oe=function(e){throw console.error(e),e}}([]); !function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n=window.webpackJsonp;window.webpackJsonp=function(t,c,u){for(var i,a,f,l=0,s=[];l<t.length;l++)a=t[l],o[a]&&s.push(o[a][0]),o[a]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(t,c,u);s.length;)s.shift()();if(u)for(l=0;l<u.length;l++)f=r(r.s=u[l]);return f};var t={},o={2:0};r.e=function(e){function n(){u.onerror=u.onload=null,clearTimeout(i);var r=o[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}if(0===o[e])return Promise.resolve();if(o[e])return o[e][2];var t=new Promise(function(r,n){o[e]=[r,n]});o[e][2]=t;var c=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,r.nc&&u.setAttribute("nonce",r.nc),u.src=r.p+""+e+".js?"+{0:"82212d6e35030c02aff9",1:"e0d7e5de80109913da55"}[e];var i=setTimeout(n,12e4);return u.onerror=u.onload=n,c.appendChild(u),t},r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="",r.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.js.map?850ec2db42e66a151b7c //# sourceMappingURL=manifest.js.map?d019d6194cc995a8346a

View File

@@ -30,8 +30,8 @@ function validateResult(result) {
if (result.errCode == 200) { if (result.errCode == 200) {
return true; return true;
} else if (result.errCode == 400) { } else if (result.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
Toast.error(result.errMsg); Toast.error(result.errMsg);
} }
@@ -212,8 +212,8 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
contentType : "application/x-www-form-urlencoded; charset=UTF-8", contentType : "application/x-www-form-urlencoded; charset=UTF-8",
success : function(msg) { success : function(msg) {
if (msg.errCode == 400) { if (msg.errCode == 400) {
var href = encodeURI(window.location.href); var href = encodeURIComponent(window.location.href);
window.location = "static/manage/login.html?returnUrl=" + href; window.location = "static/manage/login.html?redirect=" + href;
} else { } else {
if (typeof successFunction == "function") { if (typeof successFunction == "function") {
successFunction(msg, id); successFunction(msg, id);