feat(system3): TKQC 모바일 전용 페이지 구현 및 데스크탑 관리함 반응형 개선
- 모바일 전용 페이지 신규: /m/dashboard, /m/inbox, /m/management - 공통 모바일 CSS/JS: m-common.css, m-common.js (바텀시트, 바텀네비, 터치 최적화) - nginx.conf에 /m/ location 블록 추가 - 데스크탑 HTML에 모바일 뷰포트 리다이렉트 추가 (<=768px) - 데스크탑 관리함 카드 헤더 반응형 레이아웃 (flex-wrap, 1280px 브레이크포인트) - collapse-content overflow:hidden → overflow:visible 수정 (내용 잘림 해결) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ DB_NAME = os.getenv("DB_NAME", "hyungi")
|
||||
|
||||
DATABASE_URL = f"mysql+pymysql://{DB_USER}:{quote_plus(DB_PASSWORD)}@{DB_HOST}:{DB_PORT}/{DB_NAME}?charset=utf8mb4"
|
||||
|
||||
engine = create_engine(DATABASE_URL, pool_recycle=3600)
|
||||
engine = create_engine(DATABASE_URL, pool_recycle=3600, pool_pre_ping=True)
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
@@ -140,23 +140,26 @@ async def update_issue(
|
||||
# 업데이트
|
||||
update_data = issue_update.dict(exclude_unset=True)
|
||||
|
||||
# 사진 업데이트 처리 (최대 5장)
|
||||
# 사진 업데이트 처리 (최대 5장) - 새 사진 저장 후 기존 사진 삭제 (안전)
|
||||
old_photos_to_delete = []
|
||||
for i in range(1, 6):
|
||||
photo_field = f"photo{i if i > 1 else ''}"
|
||||
path_field = f"photo_path{i if i > 1 else ''}"
|
||||
|
||||
if photo_field in update_data:
|
||||
# 기존 사진 삭제
|
||||
existing_path = getattr(issue, path_field, None)
|
||||
if existing_path:
|
||||
delete_file(existing_path)
|
||||
|
||||
# 새 사진 저장
|
||||
if update_data[photo_field]:
|
||||
new_path = save_base64_image(update_data[photo_field])
|
||||
update_data[path_field] = new_path
|
||||
# 새 사진 저장 성공 시에만 기존 사진 삭제 예약
|
||||
if new_path and existing_path:
|
||||
old_photos_to_delete.append(existing_path)
|
||||
else:
|
||||
update_data[path_field] = None
|
||||
if existing_path:
|
||||
old_photos_to_delete.append(existing_path)
|
||||
|
||||
# photo 필드는 제거 (DB에는 photo_path만 저장)
|
||||
del update_data[photo_field]
|
||||
@@ -171,6 +174,14 @@ async def update_issue(
|
||||
|
||||
db.commit()
|
||||
db.refresh(issue)
|
||||
|
||||
# DB 커밋 성공 후 기존 사진 파일 삭제
|
||||
for old_path in old_photos_to_delete:
|
||||
try:
|
||||
delete_file(old_path)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return issue
|
||||
|
||||
@router.delete("/{issue_id}")
|
||||
@@ -456,15 +467,8 @@ async def reject_completion_request(
|
||||
raise HTTPException(status_code=403, detail="완료 반려 권한이 없습니다.")
|
||||
|
||||
try:
|
||||
# 완료 사진 파일 삭제 (최대 5장)
|
||||
for i in range(1, 6):
|
||||
path_field = f"completion_photo_path{i if i > 1 else ''}"
|
||||
photo_path = getattr(issue, path_field, None)
|
||||
if photo_path:
|
||||
try:
|
||||
delete_file(photo_path)
|
||||
except Exception:
|
||||
pass
|
||||
# 완료 사진은 파일 삭제하지 않음 (재신청 시 참고용으로 보존)
|
||||
# DB 참조만 초기화
|
||||
|
||||
# 완료 신청 정보 초기화
|
||||
issue.completion_requested_at = None
|
||||
|
||||
Reference in New Issue
Block a user