Add customer multi-level referral profit editor and related settings UI.
Expose enable_customer_level_profit in config and let admins edit per-customer level percents from the customers table/mobile sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+20
-14
@@ -87,29 +87,35 @@ _axios.interceptors.response.use(
|
||||
await router.push({ name: 'login' })
|
||||
} else if (error.response && error.response.status == 403) {
|
||||
if (!error.config?.meta?.silent) {
|
||||
message.error('شما دسترسی لازم برای انجام این عملیات را ندارید')
|
||||
message.error('شما دسترسی لازم برای انجام این عملیات را ندارید (403)')
|
||||
}
|
||||
} else if (error.response && error.response.status == 422) {
|
||||
if (!error.config?.meta?.silent) {
|
||||
message.error(error.response.data?.message)
|
||||
}
|
||||
} else if (error.response) {
|
||||
if (!error.config?.meta?.silent) {
|
||||
const apiMessage = error.response.data?.message
|
||||
message.error(
|
||||
typeof apiMessage === 'string' && apiMessage.trim()
|
||||
? formatApiErrorMessage(apiMessage)
|
||||
: 'خطا در بارگذاری اطلاعات',
|
||||
? `${apiMessage} (422)`
|
||||
: 'خطا در اعتبارسنجی (422)',
|
||||
)
|
||||
}
|
||||
} else if (error.response) {
|
||||
if (!error.config?.meta?.silent) {
|
||||
const status = Number(error.response.status)
|
||||
if (status >= 500) {
|
||||
message.error(`خطا در برقراری ارتباط با سرور (${status})`)
|
||||
} else {
|
||||
const apiMessage = error.response.data?.message
|
||||
const base =
|
||||
typeof apiMessage === 'string' && apiMessage.trim()
|
||||
? formatApiErrorMessage(apiMessage)
|
||||
: 'خطا در بارگذاری اطلاعات'
|
||||
message.error(`${base} (${status})`)
|
||||
}
|
||||
}
|
||||
} else if (!error.config?.meta?.silent) {
|
||||
// بدون status (نه 4xx نه 5xx): قطع شبکه، timeout، DNS، …
|
||||
message.error('لطفا اینترنت خود را بررسی کنید و مجددا تلاش کنید')
|
||||
}
|
||||
// Any status codes that falls outside the range of 2xx cause this function to trigger
|
||||
// Do something with response error
|
||||
|
||||
//const { response, code, message, config } = error || {}
|
||||
//const errorMessageMode = config?.requestOptions?.errorMessageMode || 'none'
|
||||
//const msg: string = response?.data?.error?.message ?? ''
|
||||
//checkStatus(error?.response?.status, msg)
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user