tokenGainUrlGetTest.jsp
2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<%--
Created by IntelliJ IDEA.
User: zhaiyaqi
Date: 2020/3/15
Time: 7:34 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.cntytz.HttpUtils" %>
<%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.hrm.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
response.setContentType("application/json;charset=utf-8");
out.clear();
writeLog("【the start interface ....】:");
JSONObject result = new JSONObject(true);
User user = HrmUserVarify.getUser(request,response);
String url = request.getParameter("url");
writeLog("【the start interface ....】url={}"+url);
String oAUrl = request.getParameter("oAUrl");
writeLog("【the start interface ....】oAUrl={}"+oAUrl);
JSONObject json = new JSONObject();
String loginid ="";
writeLog("user=========================" + JSONObject.toJSONString(user));
try {
loginid = user.getLoginid();
//正式
// String tokenGainurl = "https://ty.cntytz.com/uasSign/sign/authentication";
//测试
String tokenGainurl = "http://192.168.150.192:28879/uasSign/sign/authentication";
writeLog("json =============url " + url);
json.put("url",url);
json.put("oAUrl",oAUrl);
json.put("userLoginName",loginid);
writeLog("json =============url " + JSONObject.toJSONString(json));
JSONObject jsonObject = HttpUtils.doPost(tokenGainurl, json);
writeLog("===================="+jsonObject);
String url1 = jsonObject.get("url").toString();
writeLog("===================="+url1);
response.sendRedirect(url1);
} catch (Exception e) {
result.put("code", -1);
result.put("message", "用户信息不完善,请联系管理员进一步完善,谢谢");
out.print("用户信息不完善,请联系管理员进一步完善,谢谢");
return;
}
out.print(result.toJSONString());
%>
<%!
private void writeLog(Object o) {
Log var3 = LogFactory.getLog(this.getClass().getName());
if(o instanceof Exception) {
var3.info(this.getClass().getName(), (Exception)o);
} else {
var3.info(o);
}
}
%>