beetlsql3-dev
Mlxa0324 2 years ago
parent 4486517ded
commit d6b2f7d9b8

@ -35,16 +35,14 @@ import com.ibeetl.jlw.dao.UniversitiesCollegesDao;
import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.service.*; import com.ibeetl.jlw.service.*;
import com.ibeetl.jlw.web.query.CompetitionQuery; import com.ibeetl.jlw.web.query.CompetitionQuery;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
@ -904,72 +902,31 @@ public class IndexController {
} }
//跳转到电脑端首页 //跳转到电脑端首页
@SneakyThrows
@RequestMapping("/index.do") @RequestMapping("/index.do")
public void index(HttpServletRequest request, HttpServletResponse response, public void index(HttpServletRequest request, HttpServletResponse response,
@TTeacher Teacher teacher, @TStudent Student student) { @TTeacher Teacher teacher, @TStudent Student student, @RequestParam(name = "_role_tag", required = false) String roleTag ) {
log.error("教师用户信息:"+ JSONUtil.toJsonStr(teacher)); log.error("教师用户信息:"+ JSONUtil.toJsonStr(teacher));
log.error("学生用户信息:"+ JSONUtil.toJsonStr(student)); log.error("学生用户信息:"+ JSONUtil.toJsonStr(student));
//判断是老师还是学生
if(null != student || null != teacher){//学生
try {
String token = createSessionByUserId();
// UniversitiesCollegesJurisdictionExperimentalSystem uSystem = (UniversitiesCollegesJurisdictionExperimentalSystem)platformService.getOther(token);
try { String roleTagCopy = StringUtils.isNotBlank(roleTag) ? ( "?_role_tag=" + roleTag ) : "";
if(ApplicationRunnerController.isOnline){ //判断是老师还是学生
//TODO 根据 uSystem 跳不同的页面 if(null != student || null != teacher){
String token = createSessionByUserId();
String tsUrl = SpringUtil.getBean(Environment.class).getProperty("student.teacher.url"); if(ApplicationRunnerController.isOnline){
// response.sendRedirect(tsUrl +"home/"+token); String tsUrl = SpringUtil.getBean(Environment.class).getProperty("student.teacher.url");
response.sendRedirect(tsUrl +"Home"); response.sendRedirect(tsUrl + "Home" + roleTagCopy);
// return "redirect:" + redirectUrl + "Home"; }else {
// if(uSystem.getTypeId().toString().equals("1")){ //大数据基础 子应用 response.sendRedirect("http://localhost:8080/home" + roleTagCopy);
// response.sendRedirect(redirectUrl+"/studentEnd_dsj/index.html");
// }else if(uSystem.getTypeId().toString().equals("2")){ //金融大数据 子应用
// response.sendRedirect(redirectUrl+"/studentEnd_jr/index.html");
// }else if(uSystem.getTypeId().toString().equals("3")){ //财会大数据 子应用
// response.sendRedirect(redirectUrl+"/studentEnd_ch/index.html");
// }else if(uSystem.getTypeId().toString().equals("4")){ //商业大数据 子应用
// response.sendRedirect(redirectUrl+"/studentEnd_sy/index.html");
// }else if(uSystem.getTypeId().toString().equals("5")){ //营销大数据 子应用
// response.sendRedirect(redirectUrl+"/studentEnd_yx/index.html");
// }
}else {
// response.sendRedirect("http://localhost:8080/Home"+token);
response.sendRedirect("http://localhost:8080/home");
// return "redirect:" + "http://localhost:8080/Home";
// if(uSystem.getTypeId().toString().equals("1")){ //大数据基础 子应用
// response.sendRedirect("http://localhost:8080/studentEnd_dsj/index.html");
// }else if(uSystem.getTypeId().toString().equals("2")){ //金融大数据 子应用
// response.sendRedirect("http://localhost:8080/studentEnd_jr/index.html");
// }else if(uSystem.getTypeId().toString().equals("3")){ //财会大数据 子应用
// response.sendRedirect("http://localhost:8080/studentEnd_ch/index.html");
// }else if(uSystem.getTypeId().toString().equals("4")){ //商业大数据 子应用
// response.sendRedirect("http://localhost:8080/studentEnd_sy/index.html");
// }else if(uSystem.getTypeId().toString().equals("5")){ //营销大数据 子应用
// response.sendRedirect("http://localhost:8080/studentEnd_yx/index.html");
// }
}
}catch (Exception e){
e.printStackTrace();
}
}catch (Exception e){
e.printStackTrace();
}
}else{//老师 或 管理员
try {
// response.sendRedirect(redirectUrl+"/server/pc/index.do");
request.getRequestDispatcher("/pc/index.do").forward(request, response);
// return "forward:/pc/index.do";
}catch (Exception e){
e.printStackTrace();
} }
} }
// return "forward:/pc/index.do"; //老师 或 管理员
else{
request.getRequestDispatcher("/pc/index.do" + roleTagCopy).forward(request, response);
}
} }
//跳转到电脑端首页 //跳转到电脑端首页

Loading…
Cancel
Save