feat: 更新 @riwa/api-types 依赖地址,优化语言加载逻辑

This commit is contained in:
2025-12-20 04:44:13 +07:00
parent 37ddeb1a07
commit 82fe8e8f6f
5 changed files with 36 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ import type { App } from "@riwa/api-types";
import type { WatchSource } from "vue";
import { treaty } from "@elysiajs/eden";
import { toastController } from "@ionic/vue";
import { i18n } from "@/locales";
const client = treaty<App>(window.location.origin, {
fetch: {
@@ -54,7 +55,9 @@ export function safeClient<T, E>(
if (res.error && res.status === 418) {
if (!options.silent) {
const toast = await toastController.create({
message: (res.error as any).value.message,
message: i18n.global.t((res.error as any).value.code, {
...(res.error as any).value.context,
}),
duration: 3000,
position: "bottom",
color: "danger",