Merge branch 'main' of https://gitea.hmac.kr/b24014/kngil_home
This commit is contained in:
@@ -102,7 +102,7 @@ userGrid
|
||||
document.getElementById('detailCard').style.display = 'block'
|
||||
|
||||
// 하단 사용자 로드
|
||||
// fetch(`/kngil/bbs/adm.php?action=user_list&member_id=${record.member_id}`)
|
||||
// fetch(`/admin/api/super?action=user_list&member_id=${record.member_id}`)
|
||||
// .then(res => res.json())
|
||||
// .then(d => {
|
||||
// if (d.status !== 'success') {
|
||||
@@ -243,7 +243,7 @@ function formatBizNo(value) {
|
||||
상단 회사 목록 로드
|
||||
---------------------------------------- */
|
||||
function loadCompanies() {
|
||||
fetch('/kngil/bbs/adm.php')
|
||||
fetch('/admin/api/super')
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (!json.records) return
|
||||
@@ -340,7 +340,7 @@ export function bindSaveButton() {
|
||||
return
|
||||
}
|
||||
|
||||
fetch('/kngil/bbs/adm.php?action=save', {
|
||||
fetch('/admin/api/super?action=save', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
|
||||
@@ -9,7 +9,7 @@ function destroyGrid(name) {
|
||||
}
|
||||
|
||||
function loadBaseCode(mainCd) {
|
||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
||||
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.status !== 'success') {
|
||||
@@ -144,7 +144,7 @@ export async function createUserGrid(boxId, options = {}) {
|
||||
}
|
||||
|
||||
function loadUsers() {
|
||||
fetch('/kngil/bbs/adm_comp.php')
|
||||
fetch('/admin/api/company')
|
||||
.then(res => res.text()) // 🔥 먼저 text로 확인
|
||||
.then(text => {
|
||||
try {
|
||||
@@ -168,7 +168,7 @@ export function loadUsersByMember(member_id) {
|
||||
return
|
||||
}
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php')
|
||||
fetch('/admin/api/company')
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
g.clear()
|
||||
@@ -198,7 +198,7 @@ export function setUserGridMode(mode = 'view') {
|
||||
|
||||
export function loadData({ loadSummary = true } = {}) {
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php')
|
||||
fetch('/admin/api/company')
|
||||
.then(res => res.json())
|
||||
.then(async d => {
|
||||
|
||||
@@ -323,7 +323,7 @@ document.getElementById('btnSave_comp')?.addEventListener('click', () => {
|
||||
console.log('INSERTS', inserts)
|
||||
console.log('UPDATES', updates)
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php', {
|
||||
fetch('/admin/api/company', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -408,7 +408,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
||||
w2confirm(`선택한 ${ids.length}명의 사용자를 삭제하시겠습니까?`)
|
||||
.yes(() => {
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php', {
|
||||
fetch('/admin/api/company', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -436,7 +436,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
||||
})
|
||||
|
||||
function loadTotalArea(memberId) {
|
||||
return fetch(`/kngil/bbs/adm_comp.php?action=total_area&member_id=${memberId}`)
|
||||
return fetch(`/admin/api/company?action=total_area&member_id=${memberId}`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.status !== 'success') {
|
||||
@@ -467,7 +467,7 @@ function doSearch() {
|
||||
}
|
||||
// ⚠️ type === 'id' 는 DB로 안 보냄
|
||||
|
||||
fetch(`/kngil/bbs/adm_comp.php?action=list`
|
||||
fetch(`/admin/api/company?action=list`
|
||||
+ `&user_nm=${encodeURIComponent(p_user_nm)}`
|
||||
+ `&dept_nm=${encodeURIComponent(p_dept_nm)}`
|
||||
+ `&use_yn=${useYn}`
|
||||
|
||||
@@ -22,7 +22,7 @@ function destroyGrid(name) {
|
||||
}
|
||||
|
||||
function loadBaseCode(mainCd) {
|
||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
||||
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.status !== 'success') {
|
||||
@@ -252,7 +252,7 @@ export function loadUsersByMember(memberId) {
|
||||
return
|
||||
}
|
||||
|
||||
fetch(`/kngil/bbs/adm_comp.php?action=list&member_id=${memberId}`)
|
||||
fetch(`/admin/api/company?action=list&member_id=${memberId}`)
|
||||
.then(res => res.json())
|
||||
.then(d => {
|
||||
|
||||
@@ -286,7 +286,7 @@ export function setUserGridMode(mode = 'view') {
|
||||
}
|
||||
|
||||
export function loadData({ loadSummary = true } = {}) {
|
||||
fetch('/kngil/bbs/adm_comp.php?action=list')
|
||||
fetch('/admin/api/company?action=list')
|
||||
.then(res => res.json())
|
||||
.then(async d => {
|
||||
|
||||
@@ -405,7 +405,7 @@ document.getElementById('btnSave_comp')?.addEventListener('click', () => {
|
||||
console.log('INSERTS', inserts)
|
||||
console.log('UPDATES', updates)
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php', {
|
||||
fetch('/admin/api/company', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -490,7 +490,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
||||
w2confirm(`선택한 ${ids.length}명의 사용자를 삭제하시겠습니까?`)
|
||||
.yes(() => {
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php', {
|
||||
fetch('/admin/api/company', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -518,7 +518,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
||||
})
|
||||
|
||||
function loadTotalArea(memberId) {
|
||||
return fetch(`/kngil/bbs/adm_comp.php?action=total_area`)
|
||||
return fetch(`/admin/api/company?action=total_area`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.status !== 'success') {
|
||||
@@ -549,7 +549,7 @@ function doSearch() {
|
||||
}
|
||||
// ⚠️ type === 'id' 는 DB로 안 보냄
|
||||
|
||||
fetch(`/kngil/bbs/adm_comp.php?action=list`
|
||||
fetch(`/admin/api/company?action=list`
|
||||
+ `&user_nm=${encodeURIComponent(p_user_nm)}`
|
||||
+ `&dept_nm=${encodeURIComponent(p_dept_nm)}`
|
||||
+ `&use_yn=${useYn}`
|
||||
@@ -671,7 +671,7 @@ function openBulkCreatePopup(memberId) {
|
||||
|
||||
function runBulkCreate(memberId, csvUrl) {
|
||||
|
||||
fetch('/kngil/bbs/adm_comp.php', {
|
||||
fetch('/admin/api/company', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -772,7 +772,7 @@ function loadDataByMemberId(memberId) {
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(`/kngil/bbs/adm_comp.php?action=list&member_id=${encodeURIComponent(memberId)}`)
|
||||
fetch(`/admin/api/company?action=list&member_id=${encodeURIComponent(memberId)}`)
|
||||
.then(res => res.json())
|
||||
.then(async d => {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ function destroyGrid(name) {
|
||||
}
|
||||
|
||||
function loadBaseCode(mainCd) {
|
||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
||||
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.status !== 'success') {
|
||||
@@ -101,7 +101,7 @@ export function openfaqPopup() {
|
||||
|
||||
// 3. 브라우저 기본 확인창 사용 (가장 확실함)
|
||||
if (confirm(`선택한 ${ids.length}개의 상품을 삭제하시겠습니까?`)) {
|
||||
fetch('/kngil/bbs/adm_faq_popup_delete.php', {
|
||||
fetch('/admin/api/faq/delete', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ action: 'delete', ids: ids })
|
||||
@@ -170,7 +170,7 @@ export function openfaqPopup() {
|
||||
console.log('INSERTS', inserts)
|
||||
console.log('UPDATES', updates)
|
||||
|
||||
fetch('/kngil/bbs/adm_faq_popup_save.php', {
|
||||
fetch('/admin/api/faq/save', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -271,7 +271,7 @@ async function loadfaqData() {
|
||||
try {
|
||||
w2ui.faqGrid.lock('조회 중...', true);
|
||||
|
||||
const response = await fetch('/kngil/bbs/adm_faq_popup.php'); // PHP 파일 호출
|
||||
const response = await fetch('/admin/api/faq'); // PHP 파일 호출
|
||||
const data = await response.json();
|
||||
|
||||
w2ui.faqGrid.clear();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { w2grid, w2ui, w2popup, w2alert } from 'https://cdn.jsdelivr.net/gh/vitmalina/w2ui@master/dist/w2ui.es6.min.js'
|
||||
|
||||
const USE_YN_ITEMS = [
|
||||
{ id: 'Y', text: '사용' },
|
||||
{ id: 'N', text: '미사용' }
|
||||
{ id: 'Y', text: '사용' },
|
||||
{ id: 'N', text: '미사용' }
|
||||
]
|
||||
/* -------------------------------------------------
|
||||
공통 유틸
|
||||
@@ -14,7 +14,7 @@ function destroyGrid(name) {
|
||||
}
|
||||
|
||||
function loadBaseCode(mainCd) {
|
||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
||||
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
if (json.status !== 'success') {
|
||||
@@ -57,12 +57,12 @@ export function openProductPopup() {
|
||||
onOpen(event) {
|
||||
event.onComplete = () => {
|
||||
// 1. 그리드를 생성합니다.
|
||||
createProductGrid('#productGrid');
|
||||
createProductGrid('#productGrid');
|
||||
|
||||
|
||||
// 1. 추가 버튼
|
||||
|
||||
// 1. 추가 버튼
|
||||
document.getElementById('prodAdd').onclick = () => {
|
||||
const g = w2ui.productGrid
|
||||
const g = w2ui.productGrid
|
||||
if (!g) return
|
||||
// 신규 row용 recid (음수로 충돌 방지)
|
||||
const newRecid = -Date.now()
|
||||
@@ -79,7 +79,7 @@ export function openProductPopup() {
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 삭제 버튼 이벤트 연결
|
||||
const removeBtn = document.getElementById('prodRemove');
|
||||
if (removeBtn) {
|
||||
@@ -106,43 +106,43 @@ export function openProductPopup() {
|
||||
|
||||
// 3. 브라우저 기본 확인창 사용 (가장 확실함)
|
||||
if (confirm(`선택한 ${ids.length}개의 상품을 삭제하시겠습니까?`)) {
|
||||
fetch('/kngil/bbs/adm_product_popup_delete.php', {
|
||||
fetch('/admin/api/product/delete', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ action: 'delete', ids: ids })
|
||||
})
|
||||
.then(res => {
|
||||
// 서버 응답이 오면 일단 텍스트로 받아서 확인
|
||||
return res.text();
|
||||
})
|
||||
.then(text => {
|
||||
try {
|
||||
const json = JSON.parse(text);
|
||||
if (json.status === 'success') {
|
||||
alert('삭제 완료');
|
||||
loadProductData(); // 목록 새로고침
|
||||
} else {
|
||||
alert(json.message || '삭제 실패');
|
||||
.then(res => {
|
||||
// 서버 응답이 오면 일단 텍스트로 받아서 확인
|
||||
return res.text();
|
||||
})
|
||||
.then(text => {
|
||||
try {
|
||||
const json = JSON.parse(text);
|
||||
if (json.status === 'success') {
|
||||
alert('삭제 완료');
|
||||
loadProductData(); // 목록 새로고침
|
||||
} else {
|
||||
alert(json.message || '삭제 실패');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('응답 파싱 에러:', text);
|
||||
alert('서버 응답 처리 중 오류가 발생했습니다.');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('응답 파싱 에러:', text);
|
||||
alert('서버 응답 처리 중 오류가 발생했습니다.');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('통신 에러:', err);
|
||||
alert('서버와 통신할 수 없습니다.');
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('통신 에러:', err);
|
||||
alert('서버와 통신할 수 없습니다.');
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 3. 저장 버튼
|
||||
document.getElementById('prodSave').onclick = () => {
|
||||
|
||||
// 현재 사용 중인 grid
|
||||
const g = w2ui.productGrid
|
||||
const g = w2ui.productGrid
|
||||
if (!g) return
|
||||
const changes = g.getChanges()
|
||||
if (!changes.length) {
|
||||
@@ -163,20 +163,20 @@ export function openProductPopup() {
|
||||
} else {
|
||||
// UPDATE → PK + 변경 컬럼
|
||||
updates.push({
|
||||
itm_cd : merged.itm_cd,
|
||||
itm_nm : merged.itm_nm,
|
||||
area : merged.area,
|
||||
itm_cd: merged.itm_cd,
|
||||
itm_nm: merged.itm_nm,
|
||||
area: merged.area,
|
||||
itm_amt: merged.itm_amt,
|
||||
use_yn : merged.use_yn?.id || merged.use_yn,
|
||||
rmks : merged.rmks
|
||||
use_yn: merged.use_yn?.id || merged.use_yn,
|
||||
rmks: merged.rmks
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
console.log('INSERTS', inserts)
|
||||
console.log('UPDATES', updates)
|
||||
|
||||
fetch('/kngil/bbs/adm_product_popup_save.php', {
|
||||
|
||||
fetch('/admin/api/product/save', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -186,26 +186,26 @@ export function openProductPopup() {
|
||||
})
|
||||
})
|
||||
|
||||
.then(res => {
|
||||
// 서버가 준 응답이 괜찮은지 확인
|
||||
if (!res.ok) throw new Error('서버 응답 오류');
|
||||
return res.json(); // 처음부터 깔끔하게 데이터로 읽기
|
||||
})
|
||||
.then(res => {
|
||||
// 서버가 준 응답이 괜찮은지 확인
|
||||
if (!res.ok) throw new Error('서버 응답 오류');
|
||||
return res.json(); // 처음부터 깔끔하게 데이터로 읽기
|
||||
})
|
||||
|
||||
.then(json => {
|
||||
// 이제 json.status를 바로 쓸 수 있습니다.
|
||||
if (json.status === 'success') {
|
||||
w2alert('저장 완료');
|
||||
w2ui.productGrid.save(); // 빨간 삼각형 없애기
|
||||
loadProductData(); // 목록 새로고침
|
||||
} else {
|
||||
w2alert(json.message || '저장 실패');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('에러 발생:', err);
|
||||
w2alert('처리 중 오류가 발생했습니다.');
|
||||
});
|
||||
.then(json => {
|
||||
// 이제 json.status를 바로 쓸 수 있습니다.
|
||||
if (json.status === 'success') {
|
||||
w2alert('저장 완료');
|
||||
w2ui.productGrid.save(); // 빨간 삼각형 없애기
|
||||
loadProductData(); // 목록 새로고침
|
||||
} else {
|
||||
w2alert(json.message || '저장 실패');
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('에러 발생:', err);
|
||||
w2alert('처리 중 오류가 발생했습니다.');
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
@@ -220,7 +220,7 @@ export async function createProductGrid(boxId) {
|
||||
const authItems = await loadBaseCode('BS210')
|
||||
|
||||
const grid = new w2grid({
|
||||
|
||||
|
||||
name: 'productGrid',
|
||||
box: boxId,
|
||||
show: {
|
||||
@@ -230,27 +230,27 @@ export async function createProductGrid(boxId) {
|
||||
},
|
||||
columns: [
|
||||
|
||||
{ field: 'itm_cd', text: '상품코드', size: '80px',style: 'text-align: center', attr: 'align=center', editable: { type: 'text' } ,sortable: true}, // name 아님!
|
||||
{ field: 'itm_nm', text: '상품명', size: '120px', style: 'text-align: center', editable: { type: 'text' } ,sortable: true}, // name 아님!
|
||||
{ field: 'area', text: '제공량', size: '100px', attr: 'align=center',render: 'number:0' , editable: { type: 'float' } ,sortable: true}, // volume 아님!
|
||||
{ field: 'itm_amt', text: '단가', size: '120px', attr: 'align=center',render: 'number:0', editable: { type: 'int' } ,sortable: true}, //
|
||||
{ field: 'itm_cd', text: '상품코드', size: '80px', style: 'text-align: center', attr: 'align=center', editable: { type: 'text' }, sortable: true }, // name 아님!
|
||||
{ field: 'itm_nm', text: '상품명', size: '120px', style: 'text-align: center', editable: { type: 'text' }, sortable: true }, // name 아님!
|
||||
{ field: 'area', text: '제공량', size: '100px', attr: 'align=center', render: 'number:0', editable: { type: 'float' }, sortable: true }, // volume 아님!
|
||||
{ field: 'itm_amt', text: '단가', size: '120px', attr: 'align=center', render: 'number:0', editable: { type: 'int' }, sortable: true }, //
|
||||
{
|
||||
field: 'use_yn',
|
||||
text: '사용여부',
|
||||
size: '80px',
|
||||
attr: 'align=center',
|
||||
editable: {
|
||||
type: 'list',
|
||||
items: USE_YN_ITEMS,
|
||||
showAll: true,
|
||||
openOnFocus: true
|
||||
field: 'use_yn',
|
||||
text: '사용여부',
|
||||
size: '80px',
|
||||
attr: 'align=center',
|
||||
editable: {
|
||||
type: 'list',
|
||||
items: USE_YN_ITEMS,
|
||||
showAll: true,
|
||||
openOnFocus: true
|
||||
},
|
||||
render(record, extra) {
|
||||
return extra?.value?.text || ''
|
||||
},
|
||||
sortable: true
|
||||
},
|
||||
render(record, extra) {
|
||||
return extra?.value?.text || ''
|
||||
},
|
||||
sortable: true
|
||||
},
|
||||
{ field: 'rmks', text: '비고', size: '200px', editable: { type: 'text' } ,sortable: true} // memo 아님!
|
||||
{ field: 'rmks', text: '비고', size: '200px', editable: { type: 'text' }, sortable: true } // memo 아님!
|
||||
],
|
||||
records: [] // 처음엔 비워둠
|
||||
});
|
||||
@@ -266,12 +266,10 @@ export async function createProductGrid(boxId) {
|
||||
async function loadProductData() {
|
||||
try {
|
||||
w2ui.productGrid.lock('조회 중...', true);
|
||||
|
||||
const response = await fetch('/kngil/bbs/adm_product_popup.php'); // PHP 파일 호출
|
||||
let data = await response.json();
|
||||
|
||||
data = normalizeProductUseYn(data)
|
||||
|
||||
const response = await fetch('/kngil/bbs/adm_product_popup.php'); // PHP 파일 호출
|
||||
const data = await response.json();
|
||||
|
||||
w2ui.productGrid.clear();
|
||||
w2ui.productGrid.add(data);
|
||||
w2ui.productGrid.unlock();
|
||||
@@ -284,11 +282,11 @@ async function loadProductData() {
|
||||
}
|
||||
|
||||
function normalizeProductUseYn(records) {
|
||||
return records.map(r => {
|
||||
const item = USE_YN_ITEMS.find(u => u.id === r.use_yn)
|
||||
return {
|
||||
...r,
|
||||
use_yn: item || null
|
||||
}
|
||||
})
|
||||
return records.map(r => {
|
||||
const item = USE_YN_ITEMS.find(u => u.id === r.use_yn)
|
||||
return {
|
||||
...r,
|
||||
use_yn: item || null
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -133,7 +133,7 @@ async function loadPurchaseHistoryData() {
|
||||
searchParams.append('fbuy_dt', sfdt);
|
||||
searchParams.append('tbuy_dt', stdt);
|
||||
|
||||
const response = await fetch('/kngil/bbs/adm_purch_popup.php', {
|
||||
const response = await fetch('/admin/api/purchase-history', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body: searchParams
|
||||
|
||||
@@ -173,7 +173,7 @@ function addServiceFromProduct(p) {
|
||||
------------------------------------------------- */
|
||||
function loadExistingPurchase(memberId, buyDate) {
|
||||
|
||||
fetch(`/kngil/bbs/adm_service.php?member_id=${memberId}&buy_date=${buyDate}`)
|
||||
fetch(`/admin/api/service?member_id=${memberId}&buy_date=${buyDate}`)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ function deleteServiceImmediately(row) {
|
||||
sq_no: row.sq_no
|
||||
})
|
||||
|
||||
fetch('/kngil/bbs/adm_service.php', {
|
||||
fetch('/admin/api/service', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -484,7 +484,7 @@ function isServiceItem(r) {
|
||||
------------------------------------------------- */
|
||||
function loadExistingPurchase(memberId, buyDate) {
|
||||
|
||||
fetch('/kngil/bbs/adm_service.php', {
|
||||
fetch('/admin/api/service', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -647,7 +647,7 @@ function saveService(ctx) {
|
||||
_deleted: !!r._deleted
|
||||
}))
|
||||
|
||||
fetch('/kngil/bbs/adm_service.php', {
|
||||
fetch('/admin/api/service', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
|
||||
@@ -156,7 +156,7 @@ async function loadUseHistoryData(memberId = ''){
|
||||
searchParams.append('fuse_dt', sfdt);
|
||||
searchParams.append('tuse_dt', stdt);
|
||||
|
||||
const response = await fetch('/kngil/bbs/adm_use_history.php', {
|
||||
const response = await fetch('/admin/api/use-history', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
body: searchParams
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -894,6 +894,10 @@ function join() {
|
||||
}
|
||||
|
||||
function login() {
|
||||
if (typeof window.openOidcLogin === "function") {
|
||||
window.openOidcLogin();
|
||||
return;
|
||||
}
|
||||
$(".popup_wrap").hide();
|
||||
//새로고침 없이 다시 팝업창 열었을때 자동 입력된 id, pw 제거
|
||||
$("#login_id").val("");
|
||||
@@ -906,6 +910,12 @@ function login() {
|
||||
}
|
||||
|
||||
function mypage01() {
|
||||
const raw = (window.IDP_SERVICE_URL || "").trim();
|
||||
if (raw) {
|
||||
const url = raw.replace(/\/+$/, "") + "/profile";
|
||||
window.open(url, "idp_profile", "noopener,noreferrer");
|
||||
return;
|
||||
}
|
||||
$(".popup_wrap").hide();
|
||||
$(".btn_close").show();
|
||||
$("#pop_mypage01").show(0, function () {
|
||||
|
||||
@@ -35,23 +35,6 @@ if (form) {
|
||||
})
|
||||
}
|
||||
|
||||
// OIDC 로그인 처리
|
||||
const btnOidc = document.getElementById('btn_oidc_login')
|
||||
if (btnOidc) {
|
||||
btnOidc.addEventListener('click', () => {
|
||||
const width = 500;
|
||||
const height = 600;
|
||||
const left = (window.screen.width / 2) - (width / 2);
|
||||
const top = (window.screen.height / 2) - (height / 2);
|
||||
|
||||
window.open(
|
||||
'/kngil/auth/oidc-login.php',
|
||||
'oidc_login_popup',
|
||||
`width=${width},height=${height},left=${left},top=${top},scrollbars=yes`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// 팝업으로부터의 메시지 수신 (로그인 성공 시 새로고침)
|
||||
window.addEventListener('message', (event) => {
|
||||
// 보안을 위해 실제 서비스에서는 event.origin을 체크하는 것이 좋습니다.
|
||||
|
||||
@@ -20,7 +20,27 @@ function hide(id) {
|
||||
마이페이지 1단계 (비밀번호 인증)
|
||||
- 헤더에서 호출
|
||||
========================= */
|
||||
function getIdpProfileUrl() {
|
||||
const raw = (window.IDP_SERVICE_URL || '').trim()
|
||||
if (!raw) {
|
||||
return ''
|
||||
}
|
||||
return raw.replace(/\/+$/, '') + '/profile'
|
||||
}
|
||||
|
||||
function openIdpProfile() {
|
||||
const url = getIdpProfileUrl()
|
||||
if (!url) {
|
||||
return false
|
||||
}
|
||||
window.open(url, 'idp_profile', 'noopener,noreferrer')
|
||||
return true
|
||||
}
|
||||
|
||||
window.mypage01 = function () {
|
||||
if (openIdpProfile()) {
|
||||
return
|
||||
}
|
||||
if (!window.IS_LOGIN) {
|
||||
if (typeof window.login === 'function') {
|
||||
window.login()
|
||||
|
||||
@@ -894,6 +894,10 @@ function join() {
|
||||
}
|
||||
|
||||
function login() {
|
||||
if (typeof window.openOidcLogin === "function") {
|
||||
window.openOidcLogin();
|
||||
return;
|
||||
}
|
||||
$(".popup_wrap").hide();
|
||||
//새로고침 없이 다시 팝업창 열었을때 자동 입력된 id, pw 제거
|
||||
$("#login_id").val("");
|
||||
@@ -906,6 +910,12 @@ function login() {
|
||||
}
|
||||
|
||||
function mypage01() {
|
||||
const raw = (window.IDP_SERVICE_URL || "").trim();
|
||||
if (raw) {
|
||||
const url = raw.replace(/\/+$/, "") + "/profile";
|
||||
window.open(url, "idp_profile", "noopener,noreferrer");
|
||||
return;
|
||||
}
|
||||
$(".popup_wrap").hide();
|
||||
$(".btn_close").show();
|
||||
$("#pop_mypage01").show(0, function () {
|
||||
|
||||
Reference in New Issue
Block a user