-
-
+
+
+
+ {{ error }}
+
+
+
در حال بارگذاری…
+
+
+
+ {{ card.label }}
+ {{ card.value }}
+
+
+
+
+
ورود شما
+
{{ auth.user.mobile }}
+
{{ auth.user.fullName ?? 'بدون نام' }}
diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue
index 963a8a6..1cb8a17 100644
--- a/src/views/LoginView.vue
+++ b/src/views/LoginView.vue
@@ -28,6 +28,7 @@
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { requestOtp } from '@/api/auth';
+import { isValidIranMobile, normalizeIranMobile } from '@/utils/mobile';
import { ApiError } from '@/api/client';
import AppButton from '@/components/ui/AppButton.vue';
import AppInput from '@/components/ui/AppInput.vue';
@@ -42,11 +43,16 @@ async function onSubmit() {
error.value = '';
loading.value = true;
try {
- const res = await requestOtp(mobile.value.trim());
+ const normalized = normalizeIranMobile(mobile.value);
+ if (!isValidIranMobile(normalized)) {
+ error.value = 'شماره موبایل معتبر نیست. مثال: 09121234567';
+ return;
+ }
+ const res = await requestOtp(normalized);
await router.push({
name: 'verify',
query: {
- mobile: mobile.value.trim(),
+ mobile: normalized,
expires: String(res.expiresInSeconds),
...(res.otpCode ? { devCode: res.otpCode } : {}),
},
diff --git a/src/views/ProfileView.vue b/src/views/ProfileView.vue
new file mode 100644
index 0000000..6741413
--- /dev/null
+++ b/src/views/ProfileView.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+ {{ message }}
+
+
+ {{ error }}
+
+
+
+
+
+
+
diff --git a/src/views/UsersView.vue b/src/views/UsersView.vue
index 729c0e2..1d24028 100644
--- a/src/views/UsersView.vue
+++ b/src/views/UsersView.vue
@@ -1,14 +1,140 @@
- کاربران
-
- بهزودی
-
+
+
+
+ {{ error }}
+
+
+ در حال بارگذاری…
+
+ کاربری ثبت نشده است.
+
+
+ -
+
+
+
{{ user.fullName ?? 'بدون نام' }}
+
{{ user.mobile }}
+
+
{{ roleLabel(user.role) }}
+
+ {{ activeLabel(user.isActive) }}
+
+
+
+
+ ویرایش
+
+
+
+
+
+
+
+
diff --git a/vite.config.ts b/vite.config.ts
index e0d1695..fa644dc 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -2,6 +2,8 @@ import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url';
+const API_TARGET = 'https://api.montime.ir';
+
export default defineConfig({
plugins: [vue()],
resolve: {
@@ -11,5 +13,13 @@ export default defineConfig({
},
server: {
port: 5174,
+ proxy: {
+ '/api': {
+ target: API_TARGET,
+ changeOrigin: true,
+ secure: true,
+ rewrite: (path) => path.replace(/^\/api/, ''),
+ },
+ },
},
});