bug fix
This commit is contained in:
parent
4ce9f78fed
commit
e85a300703
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,4 +3,4 @@ hesabixArchive/
|
|||
hesabixBackup/
|
||||
backup/
|
||||
.idea/
|
||||
public_html/webui/*
|
||||
public_html/u/*
|
||||
|
|
2
hesabixCore/.gitignore
vendored
2
hesabixCore/.gitignore
vendored
|
@ -11,7 +11,7 @@
|
|||
/../hesabixBackup/
|
||||
/../backup/
|
||||
###< symfony/framework-bundle ###
|
||||
/../public_html/webui/
|
||||
/../public_html/u/
|
||||
/../webUI/node_modules/
|
||||
|
||||
###> phpunit/phpunit ###
|
||||
|
|
|
@ -4,15 +4,16 @@ namespace App\Controller\Front;
|
|||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use App\Service\registryMGR;
|
||||
|
||||
class UiGeneralController extends AbstractController
|
||||
{
|
||||
#[Route('/', name: 'general_home')]
|
||||
public function general_home(): JsonResponse
|
||||
public function general_home(): Response
|
||||
{
|
||||
return $this->json(['message' => 'System is running ...']);
|
||||
return $this->redirect('/u');
|
||||
}
|
||||
|
||||
#[Route('/system/getname', name: 'general_get_name')]
|
||||
|
|
|
@ -3,8 +3,8 @@ DirectoryIndex index.php
|
|||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
|
||||
# اگه درخواست با /webui شروع بشه، قوانین بعدی رو اعمال نکن و بذار فایلهای اونجا مستقیماً لود بشن
|
||||
RewriteCond %{REQUEST_URI} ^/webui(/|$) [NC]
|
||||
# اگه درخواست با /u شروع بشه، قوانین بعدی رو اعمال نکن و بذار فایلهای اونجا مستقیماً لود بشن
|
||||
RewriteCond %{REQUEST_URI} ^/u(/|$) [NC]
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# اگه فایل یا دایرکتوری فیزیکی وجود داره (مثل فایلهای استاتیک)، مستقیماً لودش کن
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
DirectoryIndex index.html
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /webui/
|
||||
|
||||
# اگه درخواست مستقیماً index.html باشه، همون رو لود کن
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
|
||||
# اگه فایل یا دایرکتوری فیزیکی وجود نداره، به index.html برو
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^ /webui/index.html [L]
|
||||
</IfModule>
|
|
@ -2,7 +2,7 @@ DirectoryIndex index.html
|
|||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /webui/
|
||||
RewriteBase /u/
|
||||
|
||||
# اگه درخواست مستقیماً index.html باشه، همون رو لود کن
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
|
@ -10,5 +10,5 @@ DirectoryIndex index.html
|
|||
# اگه فایل یا دایرکتوری فیزیکی وجود نداره، به index.html برو
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^ /webui/index.html [L]
|
||||
RewriteRule ^ /u/index.html [L]
|
||||
</IfModule>
|
|
@ -4,23 +4,23 @@ export const name = "hesabixConfig";
|
|||
|
||||
export function getApiUrl() {
|
||||
const origin = window.location.origin; // دامنه اصلی مثل http://localhost.com
|
||||
const path = window.location.pathname; // مسیر فعلی مثل /app/etc/webui
|
||||
const path = window.location.pathname; // مسیر فعلی مثل /app/etc/u
|
||||
|
||||
// مسیر رو به آرایه تبدیل میکنم تا بتونم پوشهها رو جدا کنم
|
||||
const pathParts = path.split('/').filter(part => part !== ''); // ['app', 'etc', 'webui']
|
||||
const pathParts = path.split('/').filter(part => part !== ''); // ['app', 'etc', 'u']
|
||||
|
||||
// پیدا کردن جایگاه webui و حذفش به همراه هر چی بعدش هست
|
||||
const webuiIndex = pathParts.indexOf('webui');
|
||||
if (webuiIndex !== -1) {
|
||||
// فقط مسیر تا قبل از webui رو نگه میدارم
|
||||
const basePath = pathParts.slice(0, webuiIndex).join('/'); // app/etc
|
||||
// پیدا کردن جایگاه u و حذفش به همراه هر چی بعدش هست
|
||||
const uIndex = pathParts.indexOf('u');
|
||||
if (uIndex !== -1) {
|
||||
// فقط مسیر تا قبل از u رو نگه میدارم
|
||||
const basePath = pathParts.slice(0, uIndex).join('/'); // app/etc
|
||||
if (basePath === '') {
|
||||
return `${origin}`;
|
||||
}
|
||||
return `${origin}/${basePath}`; // http://localhost.com/app/etc
|
||||
}
|
||||
|
||||
// اگه webui توی مسیر نبود، مسیر روت رو برگشت بده
|
||||
// اگه u توی مسیر نبود، مسیر روت رو برگشت بده
|
||||
return `${origin}`;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
|
||||
import axios from "axios";
|
||||
|
||||
// گرفتن base بهصورت داینامیک تا بخش /webui
|
||||
// گرفتن base بهصورت داینامیک تا بخش /u
|
||||
const getBasePath = () => {
|
||||
const fullPath = window.location.pathname;
|
||||
const webuiIndex = fullPath.indexOf('/webui');
|
||||
if (webuiIndex !== -1) {
|
||||
// از اول مسیر تا آخر /webui رو بگیریم
|
||||
return fullPath.substring(0, webuiIndex + '/webui'.length) + '/';
|
||||
const uIndex = fullPath.indexOf('/u');
|
||||
if (uIndex !== -1) {
|
||||
// از اول مسیر تا آخر /u رو بگیریم
|
||||
return fullPath.substring(0, uIndex + '/u'.length) + '/';
|
||||
}
|
||||
// اگه /webui توی مسیر نبود (که بعیده)، یه پیشفرض بذاریم
|
||||
return '/webui/';
|
||||
// اگه /u توی مسیر نبود (که بعیده)، یه پیشفرض بذاریم
|
||||
return '/u/';
|
||||
};
|
||||
const base = getBasePath();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ export default defineConfig({
|
|||
}
|
||||
},
|
||||
build: {
|
||||
outDir: '../public_html/webui',
|
||||
outDir: '../public_html/u',
|
||||
chunkSizeWarningLimit: 1600,
|
||||
rollupOptions: {
|
||||
input: {
|
||||
|
@ -34,5 +34,5 @@ export default defineConfig({
|
|||
}
|
||||
}
|
||||
},
|
||||
base: process.env.VITE_BASE_PATH || '/webui/' // برای سرور فعلی /webui/
|
||||
base: process.env.VITE_BASE_PATH || '/u/' // برای سرور فعلی /u/
|
||||
});
|
|
@ -1,9 +1,9 @@
|
|||
module.exports = {
|
||||
globDirectory: '../public_html/webui/',
|
||||
globDirectory: '../public_html/u/',
|
||||
globPatterns: [
|
||||
'**/*.{html,js,css,scss,eot,ttf,woff,woff2,svg,txt,mjs,png,json,md,jpg,gif,php,ts,rb,less,ico,rar,mp4}'
|
||||
],
|
||||
swDest: '../public_html/webui/sw.js',
|
||||
swDest: '../public_html/u/sw.js',
|
||||
ignoreURLParametersMatching: [
|
||||
/^utm_/,
|
||||
/^fbclid$/
|
||||
|
|
Loading…
Reference in a new issue