admin user and ui panel
This commit is contained in:
@@ -94,8 +94,13 @@
|
||||
<a-button class="mt-4" type="primary" @click="saveTags">ذخیره برچسب ها</a-button>
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- اسلایدر موبایل -->
|
||||
<a-tab-pane key="slider" tab="اسلایدر موبایل">
|
||||
<!-- اسلایدر موبایل — دسترسی جدا از بقیهی این صفحه، چون آپلود بنر عمومی
|
||||
سایت حساستر از ویرایش برند/برچسب است (custom.config.statics.slider) -->
|
||||
<a-tab-pane
|
||||
v-if="hasPermission('custom.config.statics.slider')"
|
||||
key="slider"
|
||||
tab="اسلایدر موبایل"
|
||||
>
|
||||
<div v-for="(s, index) in sliders" :key="index" class="slide">
|
||||
<h6 class="mobile-c">اسلاید {{ index + 1 }}</h6>
|
||||
<div class="row">
|
||||
@@ -275,9 +280,14 @@ async function saveTags() {
|
||||
}
|
||||
|
||||
// ── slider
|
||||
// Gated server-side by its own `custom.config.statics.slider` permission (not
|
||||
// the broad `config.statics` that guards the rest of this screen) — see
|
||||
// admin-misc.controller.ts. Uses the dedicated `const/slider` route rather
|
||||
// than the generic `const/:key`, which the server only accepts under that
|
||||
// specific permission.
|
||||
async function saveSliders() {
|
||||
try {
|
||||
await api.put('const/mobile_main_slider', { val: sliders.value });
|
||||
await api.put('const/slider', { val: sliders.value });
|
||||
message.success('اسلایدر ذخیره شد');
|
||||
} catch (e: any) {
|
||||
message.error(e?.response?.data?.message ?? 'خطا در ذخیره');
|
||||
@@ -334,10 +344,10 @@ onMounted(async () => {
|
||||
await Promise.all([loadBrands(), loadCollections()]);
|
||||
const [t, s] = await Promise.all([
|
||||
api.get('const/__list__tags'),
|
||||
api.get('const/mobile_main_slider'),
|
||||
hasPermission('custom.config.statics.slider') ? api.get('const/slider') : Promise.resolve(null),
|
||||
]);
|
||||
tags.value = Array.isArray(t.data) ? t.data : [];
|
||||
sliders.value = Array.isArray(s.data) ? s.data : [];
|
||||
sliders.value = Array.isArray(s?.data) ? s.data : [];
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user