增加权限和登录跳转
This commit is contained in:
@@ -2,6 +2,7 @@ package com.zyplayer.doc.swagger.controller;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.swagger.controller.vo.LocationListVo;
|
||||
@@ -33,6 +34,7 @@ import java.util.stream.Collectors;
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/swagger-mg-ui/document")
|
||||
public class MgDocumentController {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.zyplayer.doc.swagger.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.swagger.framework.service.MgStorage;
|
||||
import com.zyplayer.doc.swagger.framework.service.MgStorageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.swagger.framework.service.MgStorage;
|
||||
import com.zyplayer.doc.swagger.framework.service.MgStorageService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 后台存储服务控制器
|
||||
@@ -18,6 +18,7 @@ import com.zyplayer.doc.swagger.framework.service.MgStorageService;
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年8月21日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
@RequestMapping("/swagger-mg-ui/storage")
|
||||
public class MgStorageController {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zyplayer.doc.swagger.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.zyplayer.doc.core.annotation.AuthMan;
|
||||
import com.zyplayer.doc.swagger.controller.vo.SwaggerResourcesInfoVo;
|
||||
import com.zyplayer.doc.swagger.framework.constant.Consts;
|
||||
import com.zyplayer.doc.swagger.framework.constant.StorageKeys;
|
||||
@@ -26,6 +27,7 @@ import java.util.List;
|
||||
* @author 暮光:城中城
|
||||
* @since 2018年12月16日
|
||||
*/
|
||||
@AuthMan
|
||||
@RestController
|
||||
public class ZyplayerSwaggerController {
|
||||
|
||||
|
||||
@@ -27,8 +27,11 @@ function deserialize(value) {
|
||||
}
|
||||
|
||||
function validateResult(result) {
|
||||
if(result.errCode == 200) {
|
||||
if (result.errCode == 200) {
|
||||
return true;
|
||||
} else if (result.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
} else {
|
||||
Toast.error(result.errMsg);
|
||||
}
|
||||
@@ -192,8 +195,13 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
|
||||
data : eval(paramsStr),
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
success : function(msg) {
|
||||
if(typeof successFunction == "function") {
|
||||
successFunction(msg,id);
|
||||
if (msg.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
} else {
|
||||
if (typeof successFunction == "function") {
|
||||
successFunction(msg, id);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeSend : function() {
|
||||
|
||||
@@ -27,11 +27,14 @@ function deserialize(value) {
|
||||
}
|
||||
|
||||
function validateResult(result) {
|
||||
if(result.errCode == 200) {
|
||||
return true;
|
||||
} else {
|
||||
Toast.error(result.errMsg);
|
||||
}
|
||||
if (result.errCode == 200) {
|
||||
return true;
|
||||
} else if (result.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
} else {
|
||||
Toast.error(result.errMsg);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -175,7 +178,7 @@ function getObjectFirstAttributeIfOnly(data) {
|
||||
|
||||
/**
|
||||
* ajax处理事件模板
|
||||
*
|
||||
*
|
||||
* @url 后台处理的url,即action
|
||||
* @dataSentType 数据发送的方式,有post,get方式
|
||||
* @dataReceiveType 数据接收格式,有html json text等
|
||||
@@ -192,12 +195,17 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
|
||||
data : eval(paramsStr),
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
success : function(msg) {
|
||||
if(typeof successFunction == "function") {
|
||||
successFunction(msg,id);
|
||||
if (msg.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
} else {
|
||||
if (typeof successFunction == "function") {
|
||||
successFunction(msg, id);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeSend : function() {
|
||||
|
||||
|
||||
},
|
||||
complete : function(msg) {
|
||||
if (msg.responseText.startWith("<!doctype html>")) {
|
||||
@@ -233,7 +241,7 @@ function postWithFile(url, paramsStr, successFunction, errorFunction, completeFu
|
||||
}
|
||||
},
|
||||
beforeSend: function () {
|
||||
|
||||
|
||||
},
|
||||
complete: function (msg) {
|
||||
if (typeof completeFunction == "function") {
|
||||
|
||||
@@ -27,8 +27,11 @@ function deserialize(value) {
|
||||
}
|
||||
|
||||
function validateResult(result) {
|
||||
if(result.errCode == 200) {
|
||||
if (result.errCode == 200) {
|
||||
return true;
|
||||
} else if (result.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
} else {
|
||||
Toast.error(result.errMsg);
|
||||
}
|
||||
@@ -192,8 +195,13 @@ function ajaxTemp(url, dataSentType, dataReceiveType, paramsStr, successFunction
|
||||
data : eval(paramsStr),
|
||||
contentType : "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
success : function(msg) {
|
||||
if(typeof successFunction == "function") {
|
||||
successFunction(msg,id);
|
||||
if (msg.errCode == 400) {
|
||||
var href = encodeURI(window.location.href);
|
||||
window.location = "static/manage/login.html?returnUrl=" + href;
|
||||
} else {
|
||||
if (typeof successFunction == "function") {
|
||||
successFunction(msg, id);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeSend : function() {
|
||||
|
||||
Reference in New Issue
Block a user