new UI and handle cashing
This commit is contained in:
+3
-2
@@ -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
@@ -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() {
|
||||
|
||||
@@ -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',
|
||||
})
|
||||
|
||||
|
||||
@@ -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 }>,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user