增加权限和登录跳转

This commit is contained in:
暮光:城中城
2019-06-12 22:28:38 +08:00
parent f9d53da7fe
commit 494149fad2
41 changed files with 228 additions and 111 deletions

View File

@@ -3,9 +3,8 @@ package com.zyplayer.doc.grpc.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.protobuf.ByteString;
import com.nxest.grpc.client.GrpcChannelFactory;
import com.nxest.grpc.server.GrpcService;
import com.zyplayer.doc.core.exception.ConfirmException;
import com.zyplayer.doc.core.annotation.AuthMan;
import com.zyplayer.doc.core.json.DocResponseJson;
import com.zyplayer.doc.grpc.controller.po.ColumnInfo;
import com.zyplayer.doc.grpc.controller.po.GrpcDocInfo;
@@ -26,8 +25,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.HashMap;
@@ -43,6 +40,7 @@ import java.util.regex.Pattern;
* @author 暮光:城中城
* @since 2019年3月31日
*/
@AuthMan
@RestController
@RequestMapping("/zyplayer-doc-grpc")
public class GrpcDocController {

View File

@@ -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);
}
@@ -193,8 +196,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() {