Merge branch 'master' of gitlab.com:zd-team/tb/tb320eva_zd
This commit is contained in:
@@ -15,6 +15,7 @@ using TodoAPI2.Models;
|
||||
using System.Data;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace TodoAPI2.Controllers
|
||||
{
|
||||
@@ -94,11 +95,14 @@ namespace TodoAPI2.Controllers
|
||||
try
|
||||
{
|
||||
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
|
||||
var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
//var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
var httpclient = new WebClient();
|
||||
string mainurl = Configuration["JasperReportServer:MainURL"];
|
||||
string reportsite = Configuration["JasperReportServer:reportsite"];
|
||||
string username = Configuration["JasperReportServer:username"];
|
||||
string password = Configuration["JasperReportServer:password"];
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_eva01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
|
||||
string url = $"{mainurl}{reportsite}/rep_eva01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
@@ -97,8 +97,10 @@ namespace TodoAPI2.Controllers
|
||||
var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
string mainurl = Configuration["JasperReportServer:MainURL"];
|
||||
string reportsite = Configuration["JasperReportServer:reportsite"];
|
||||
string username = Configuration["JasperReportServer:username"];
|
||||
string password = Configuration["JasperReportServer:password"];
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
|
||||
string url = $"{mainurl}{reportsite}/rep_eva02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
@@ -96,8 +96,10 @@ namespace TodoAPI2.Controllers
|
||||
var httpclient = MyHelper.getHttpClient(Configuration);
|
||||
string mainurl = Configuration["JasperReportServer:MainURL"];
|
||||
string reportsite = Configuration["JasperReportServer:reportsite"];
|
||||
string username = Configuration["JasperReportServer:username"];
|
||||
string password = Configuration["JasperReportServer:password"];
|
||||
|
||||
string url = $"{mainurl}{reportsite}/rep_eva03.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}";
|
||||
string url = $"{mainurl}{reportsite}/rep_eva03.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
|
||||
|
||||
var data = httpclient.DownloadData(url);
|
||||
var stream = new MemoryStream(data);
|
||||
|
||||
@@ -251,7 +251,8 @@ public class MyHelper
|
||||
string password = Configuration["JasperReportServer:password"];
|
||||
|
||||
WebClient httpclient = new WebClient();
|
||||
var result = httpclient.DownloadString($"{loginurl}?j_username={username}&j_password={password}");
|
||||
string login_url = $"{loginurl}?j_username={username}&j_password={password}";
|
||||
var result = httpclient.DownloadString(loginurl);
|
||||
string session = httpclient.ResponseHeaders.Get("Set-Cookie");
|
||||
httpclient.Headers.Add("Cookie", session);
|
||||
return httpclient;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"connectionStrings": {
|
||||
"mainDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;",
|
||||
"externalDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;"
|
||||
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
|
||||
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
|
||||
},
|
||||
"IdentityServer": {
|
||||
"url": "",
|
||||
@@ -27,17 +27,17 @@
|
||||
"From": ""
|
||||
},
|
||||
"JasperReportServer": {
|
||||
"MainURL": "http://jasper.appgek.com:8480/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://jasper.appgek.com:8480/jasperserver/rest/login",
|
||||
"username": "jasperadmin",
|
||||
"password": "jasperadmin",
|
||||
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"username": "jasper",
|
||||
"password": "ZdPr0jects",
|
||||
"reportsite": "/tb320hr"
|
||||
},
|
||||
"SiteInformation": {
|
||||
"appsite": "/eva",
|
||||
"apisite": "/eva",
|
||||
"mainsite": "https://tb320.dev.appgek.com",
|
||||
"modulesite": "https://tb320.dev.appgek.com/menu/evaluation",
|
||||
"mainsite": "http://tb320dev.zd.co.th",
|
||||
"modulesite": "http://tb320dev.zd.co.th/menu/evaluation",
|
||||
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
||||
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
||||
"chatsite": "http://chat.rmutto.ac.th"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"connectionStrings": {
|
||||
"mainDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr_site2;User ID=zerpa;Password=zerpa1234;",
|
||||
"externalDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr_site2;User ID=zerpa;Password=zerpa1234;"
|
||||
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
|
||||
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
|
||||
},
|
||||
"IdentityServer": {
|
||||
"url": "",
|
||||
@@ -27,17 +27,17 @@
|
||||
"From": ""
|
||||
},
|
||||
"JasperReportServer": {
|
||||
"MainURL": "http://jasper.appgek.com:8480/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://jasper.appgek.com:8480/jasperserver/rest/login",
|
||||
"username": "jasperadmin",
|
||||
"password": "jasperadmin",
|
||||
"reportsite": "/tb320hrsite2"
|
||||
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"username": "jasper",
|
||||
"password": "ZdPr0jects",
|
||||
"reportsite": "/tb320hr"
|
||||
},
|
||||
"SiteInformation": {
|
||||
"appsite": "/eva",
|
||||
"apisite": "/eva",
|
||||
"mainsite": "https://tb320site2.dev.appgek.com",
|
||||
"modulesite": "https://tb320site2.dev.appgek.com/menu/evaluation",
|
||||
"mainsite": "http://tb320dev.zd.co.th",
|
||||
"modulesite": "http://tb320dev.zd.co.th/menu/evaluation",
|
||||
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
||||
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
||||
"chatsite": "http://chat.rmutto.ac.th"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"connectionStrings": {
|
||||
"mainDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;",
|
||||
"externalDBConnectionString": "Server=appgek.com;Port=15432;Database=tb320_hr;User ID=zerpa;Password=zerpa1234;"
|
||||
"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;",
|
||||
"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320dev;User ID=postgres;Password=project0*;"
|
||||
},
|
||||
"IdentityServer": {
|
||||
"url": "",
|
||||
@@ -27,17 +27,17 @@
|
||||
"From": ""
|
||||
},
|
||||
"JasperReportServer": {
|
||||
"MainURL": "http://jasper.appgek.com:8480/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://jasper.appgek.com:8480/jasperserver/rest/login",
|
||||
"username": "jasperadmin",
|
||||
"password": "jasperadmin",
|
||||
"MainURL": "http://tb320.zd.co.th/jasperserver/rest_v2/reports",
|
||||
"LoginURL": "http://tb320.zd.co.th/jasperserver/rest_v2/login",
|
||||
"username": "jasper",
|
||||
"password": "ZdPr0jects",
|
||||
"reportsite": "/tb320hr"
|
||||
},
|
||||
"SiteInformation": {
|
||||
"appsite": "/eva",
|
||||
"apisite": "/eva",
|
||||
"mainsite": "https://tb320.dev.appgek.com",
|
||||
"modulesite": "https://tb320.dev.appgek.com/menu/evaluation",
|
||||
"mainsite": "http://tb320dev.zd.co.th",
|
||||
"modulesite": "http://tb320dev.zd.co.th/menu/evaluation",
|
||||
"sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์",
|
||||
"modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน",
|
||||
"chatsite": "http://chat.rmutto.ac.th"
|
||||
|
||||
Reference in New Issue
Block a user