Initial commit: public frontend for GameNo.

Vue 3 + Vite student-facing app with routing, Pinia state, and API integration.
This commit is contained in:
2026-08-09 04:18:09 +02:00
commit a9135bfa09
32 changed files with 5394 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import moment from 'jalali-moment'
const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']
export function toPersianDigits(value) {
if (value == null) return ''
return String(value).replace(/\d/g, (d) => persianDigits[Number(d)])
}
export function formatJalali(date, format = 'jYYYY/jMM/jDD') {
if (!date) return '—'
return toPersianDigits(moment(date).locale('fa').format(format))
}
export function formatPrice(amount) {
if (amount == null || Number.isNaN(Number(amount))) return '—'
return `${toPersianDigits(Number(amount).toLocaleString('en-US'))} تومان`
}
export function getApiErrorMessage(error, fallback = 'خطایی رخ داد. دوباره تلاش کنید.') {
return (
error?.response?.data?.error?.message ||
error?.response?.data?.message ||
error?.message ||
fallback
)
}