new UI and handle cashing

This commit is contained in:
2026-06-16 19:47:28 +03:30
parent e174ae28c5
commit 6e5ea0319f
41 changed files with 2936 additions and 641 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
import { baseURL } from '@/themeConfig'
import { resolveProjectBase } from '@/themeConfig'
import type { User } from '@/models/login'
export interface ProductFile {
@@ -19,7 +19,8 @@ export function getFileUrl(file?: ProductFile | null): string | null {
const relative = file.src || file.full_src
if (!relative) return null
const base = baseURL.replace(/\/$/, '')
const base = resolveProjectBase().replace(/\/$/, '')
if (!base) return relative.startsWith('/') ? relative : `/${relative}`
const path = String(relative).replace(/^\//, '')
return `${base}/${path}`
}
+4 -4
View File
@@ -1,4 +1,4 @@
import { tokenName } from '@/themeConfig'
import { getTokenName } from '@/themeConfig'
import { ref } from 'vue'
import {useConfigStore} from "@/store/configStore";
@@ -11,7 +11,7 @@ const nameProject= getConfigApp('name')
function setToken(token: string | undefined) {
return localStorage.setItem(tokenName, token)
return localStorage.setItem(getTokenName(), token)
}
function setFingerPrint(val: string | undefined) {
@@ -19,7 +19,7 @@ function setFingerPrint(val: string | undefined) {
}
function getToken() {
return localStorage.getItem(tokenName)
return localStorage.getItem(getTokenName())
}
function getIsActiveFingerprint() {
@@ -78,7 +78,7 @@ export async function authenticateWithFingerprint() {
function removeToken() {
return localStorage.removeItem(tokenName)
return localStorage.removeItem(getTokenName())
}
function removeFingerPrint() {
+1 -1
View File
@@ -340,7 +340,7 @@ export function buildBoursecuHomeAssetRows(
rows.push({
id: 'rial-total',
label: 'دارایی ریالی',
value: `${formatRialNumber(summary.total_rial_value ?? 0)} ریال`,
value: `${formatRialNumber(summary.cash_wallet ?? 0)} ریال`,
info: 'rial',
})
+1 -1
View File
@@ -19,7 +19,7 @@ export interface SupportMessengerSettings {
export const supportMessengerSettings = ref<SupportMessengerSettings>({})
export const DEFAULT_SUPPORT_MESSENGER_TEXT =
'جهت شارژ حساب کاربری خود، مبلغ موردنظر را واریز نموده و از طریق پیام‌رسان به پشتیبانی اطلاع دهید.'
'جهت شارژ حساب کاربری خود، کلمه «شماره حساب» را برای پشتیبانی ارسال نمایید.'
function getSupportSettingValue(
settings: Array<{ key?: string; is_active?: boolean | number; value?: unknown }>,
+7 -3
View File
@@ -1,4 +1,5 @@
import {baseURL} from '@/themeConfig'
import { getConfigApp } from '@/utils/config'
import { baseURL as fallbackBaseURL } from '@/themeConfig'
import type {AxiosRequestConfig, AxiosResponse} from 'axios'
import axios from 'axios'
import {getToken, removeToken} from "@/utils";
@@ -20,13 +21,16 @@ const headers = {
}
const _axios = axios.create({
baseURL,
baseURL: fallbackBaseURL,
headers,
})
_axios.interceptors.request.use(
(config) => {
//console.log('request config', config)
const runtimeBaseURL = getConfigApp('node_server')
if (runtimeBaseURL) {
config.baseURL = runtimeBaseURL
}
if (config.headers) {
const token = getToken()
if (token) {