260707_02_ENH: apikey 오류 수정
This commit is contained in:
@@ -30,19 +30,19 @@ namespace REPORT_API_ver6.Controllers
|
||||
hcAccessor.HttpContext.Response.ContentType = "text/plain";
|
||||
|
||||
var configuration = Common.GetConfiguration();
|
||||
var value = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
||||
var apikey = configuration.GetSection("X-API-Key")[xApiKey ?? ""];
|
||||
UserInfo? userInfo = String.IsNullOrEmpty(token)? null : Security.ValidateToken(token);
|
||||
|
||||
if (userInfo != null || !String.IsNullOrEmpty(value))
|
||||
if (userInfo != null || !String.IsNullOrEmpty(apikey))
|
||||
{
|
||||
string okey = "REPORT";
|
||||
if(userInfo.ID == "KON" || userInfo.ID == "KIWI" || userInfo.ID == "NEWSSAK")
|
||||
if(userInfo != null && (userInfo.ID == "KON" || userInfo.ID == "KIWI" || userInfo.ID == "NEWSSAK"))
|
||||
{
|
||||
okey = userInfo.ID;
|
||||
}
|
||||
else if(!String.IsNullOrEmpty(value))
|
||||
else if(!String.IsNullOrEmpty(apikey))
|
||||
{
|
||||
okey = value;
|
||||
okey = apikey;
|
||||
}
|
||||
|
||||
PkeyInfo pkeyInfo = new PkeyInfo(skey);
|
||||
@@ -54,7 +54,7 @@ namespace REPORT_API_ver6.Controllers
|
||||
int mode = shortURLParam.Mode == "P" ? 1 : 0;
|
||||
string returnString = "https://kart.kric.com/External/" + URI.GetURIKey(shortURLParam.RealURI, mode, skey, proejctInfo.Rows[0]["title"].ToString(), okey);
|
||||
string cLogContent = "{ \"REAL_URI\": \"" + shortURLParam.RealURI + "\",\"MODE\": \"" + shortURLParam.Mode + "\", \"COPY_URI\": \"" + returnString + "\" }";
|
||||
Log.InsertSiteLog(userInfo.ID, pkeyInfo.Pkey, "URL Copy", cLogContent);
|
||||
Log.InsertSiteLog(userInfo != null ? userInfo.ID : apikey, pkeyInfo.Pkey, "URL Copy", cLogContent);
|
||||
|
||||
Response.StatusCode = (int)HttpStatusCode.OK;
|
||||
return Content(returnString);
|
||||
|
||||
Reference in New Issue
Block a user