Commit 14fdd33f by Kang Donghun

コード整理

parent ed6da03a
...@@ -203,9 +203,10 @@ CHK_Common.getUrlParameter = function () { ...@@ -203,9 +203,10 @@ CHK_Common.getUrlParameter = function () {
* @returns sid * @returns sid
*/ */
CHK_Common.getSid = function () { CHK_Common.getSid = function () {
return ClientData.userInfo_sid_local(); return ClientData.userInfo_sid();
}; };
/** /**
* cms communication * cms communication
* *
...@@ -215,15 +216,27 @@ CHK_Common.getSid = function () { ...@@ -215,15 +216,27 @@ CHK_Common.getSid = function () {
* @param {Object} callback * @param {Object} callback
* @param {Object} errorCallback * @param {Object} errorCallback
*/ */
CHK_Common.cmsAjax = function (url, param, async = true, callback, errorCallback) { CHK_Common.cmsAjax = function (url, param, async = true, type, dataType, callback, errorCallback) {
var sysSettings = AVWEB.avwSysSetting();
if (url) { if (url) {
$.ajax({ $.ajax({
type: 'POST', type: type,
url: url, url: url,
data: param, data: param,
dataType: 'json', dataType: dataType,
cache: false, cache: false,
async: async, async: async,
crossDomain: true,
beforeSend: function(xhr) {
/*
* ABook viewer for WEB 用のリクエストヘッダに、以下のヘッダを付加する
* X-AGT-AppId: ABookWebCL
* X-AGT-AppVersion: 0.0.1
*/
xhr.setRequestHeader('X-AGT-AppId', sysSettings.appName);
xhr.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
},
success: function (result) { success: function (result) {
if (result.status == '200') { if (result.status == '200') {
if (callback) callback(result); if (callback) callback(result);
...@@ -289,8 +302,9 @@ CHK_Common.postCommunication = function (url, params, method = 'post') { ...@@ -289,8 +302,9 @@ CHK_Common.postCommunication = function (url, params, method = 'post') {
CHK_Common.checkAuth = function (async = true) { CHK_Common.checkAuth = function (async = true) {
let params = {}; let params = {};
params.sid = CHK_Common.getSid; params.sid = CHK_Common.getSid;
const url = CHK_CONSTANT.URL.BASE_CMS + CHK_CONSTANT.URL.AUTH_SESSION; var urlPath = ClientData.userInfo_accountPath();
CHK_Common.cmsAjax(url, params, async, null, function () { const url = CHK_CONSTANT.URL.BASE_CMS + urlPath + CHK_CONSTANT.URL.BASE_CHECKAPI + CHK_CONSTANT.URL.AUTH_SESSION;
CHK_Common.cmsAjax(url, params, async, CONSTANT.API_TYPE.GET, CONSTANT.DATA_TYPE.TEXT, function () {
CHK_Common.goUrlWithCurrentParams(CHK_CONSTANT.PAGE_NAME.LOGIN); CHK_Common.goUrlWithCurrentParams(CHK_CONSTANT.PAGE_NAME.LOGIN);
}); });
}; };
...@@ -46,12 +46,24 @@ CHK_CONSTANT.ADD_REPORT_FLG = { ...@@ -46,12 +46,24 @@ CHK_CONSTANT.ADD_REPORT_FLG = {
}; };
CHK_CONSTANT.URL = { CHK_CONSTANT.URL = {
BASE_CMS: 'https://' + location.host + '/checkapi/web/', // BASE_CMS: 'https://' + location.host + '/checkapi/web/',
BASE_CMS: 'http://localhost:8080/acms/',
BASE_CHECKAPI: '/checkapi/web/',
BASE_WEB: 'abvw/html/', BASE_WEB: 'abvw/html/',
ALL_OPERATION_LIST: 'operationLIstWeb/getOperationList', ALL_OPERATION_LIST: 'operationListWeb/getOperationList',
AUTH_SESSION: 'getsession/checkAuthUser', AUTH_SESSION: 'getSession/checkAuthUser',
}; };
CONSTANT.API_TYPE = {
POST: 'post',
GET: 'get'
}
CONSTANT.DATA_TYPE = {
TEXT: 'text',
JSON: 'json',
}
CHK_CONSTANT.LANG = { CHK_CONSTANT.LANG = {
SAVE_NAME: 'lang', SAVE_NAME: 'lang',
JAPAN: 'ja', JAPAN: 'ja',
......
...@@ -14,17 +14,17 @@ ...@@ -14,17 +14,17 @@
<link rel="stylesheet" type="text/css" href="/abvw/common/css/appCommon/app.css"> <link rel="stylesheet" type="text/css" href="/abvw/common/css/appCommon/app.css">
<link rel="stylesheet" type="text/css" href="/abvw/common/css/appCommon/fontawesome_relative_path.css"> <link rel="stylesheet" type="text/css" href="/abvw/common/css/appCommon/fontawesome_relative_path.css">
<script src="/abvw/common/js/appCommon/constant.js?__UPDATEID__"></script>
<script src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script> <script src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script> <script src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/common.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/avweb.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/constant.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/check-common.js?__UPDATEID__"></script>
<script src="/abvw/js/operationList/operationList.js?__UPDATEID__"></script> <script src="/abvw/js/operationList/operationList.js?__UPDATEID__"></script>
<script src="/abvw/js/topPage/topPage.js?__UPDATEID__"></script> <script src="/abvw/js/topPage/topPage.js?__UPDATEID__"></script>
<script src="/abvw/js/dashboardSetting/check-dashboard-setting.js?__UPDATEID__"></script> <script src="/abvw/js/dashboardSetting/check-dashboard-setting.js?__UPDATEID__"></script>
<script src="/abvw/js/dashboard/check-dashboard.js?__UPDATEID__"></script> <script src="/abvw/js/dashboard/check-dashboard.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/check-footer.js?__UPDATEID__"></script> <script src="/abvw/common/js/appCommon/check-footer.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/check-common.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/common.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/avweb.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/app.js?__UPDATEID__" defer></script> <script src="/abvw/common/js/appCommon/app.js?__UPDATEID__" defer></script>
</head> </head>
......
...@@ -53,10 +53,9 @@ CHK_OL.getAllDataWeb = function (searchKeyword, sortIndex, searchStartDate, sear ...@@ -53,10 +53,9 @@ CHK_OL.getAllDataWeb = function (searchKeyword, sortIndex, searchStartDate, sear
param.startDate = searchStartDate; param.startDate = searchStartDate;
param.endDate = searchEndDate; param.endDate = searchEndDate;
param.operationGroupMasterId = operationGroupMasterId; param.operationGroupMasterId = operationGroupMasterId;
const url = CHK_CONSTANT.URL.BASE_CMS + ClientData.userInfo_accountPath() + CHK_CONSTANT.URL.BASE_CHECKAPI + CHK_CONSTANT.URL.ALL_OPERATION_LIST;
const url = CHK_CONSTANT.URL.BASE_CMS + CHK_CONSTANT.URL.ALL_OPERATION_LIST; CHK_Common.cmsAjax(url, param, false, CONSTANT.API_TYPE.GET, CONSTANT.DATA_TYPE.JSON,function (json) {
CHK_Common.cmsAjax(url, param, false, function (json) {
CHK_OL.operationList = json.operationList; CHK_OL.operationList = json.operationList;
CHK_OL.operationGroupMaster = json.operationGroupMasterList; CHK_OL.operationGroupMaster = json.operationGroupMasterList;
CHK_OL.isOperationGroupMaster = json.isOperationGroupMaster; CHK_OL.isOperationGroupMaster = json.isOperationGroupMaster;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment