Merge branch 'main' of https://git2.tavasi.ir/front/base_ui into shadi/develop

This commit is contained in:
Mehdi104797 2025-04-16 08:34:59 +03:30
commit aa40ac3ae6
34 changed files with 75 additions and 189 deletions

3
.env
View File

@ -1,3 +1,6 @@
NUXT_PUBLIC_API_NAME=api/
NUXT_PUBLIC_BASE_URL=/
# For more information refere to documents: https://cli.vuejs.org/guide/mode-and-env.html#example-staging-mode
VITE_GOOGLECLIENTID="1044522269248-903n0gpd6kv9slmmr7cp2o8u04ru78qv.apps.googleusercontent.com"

View File

@ -1,5 +1,4 @@
NUXT_PUBLIC_API_NAME=api/
NUXT_PUBLIC_BASE_URL=http://192.168.23.60/
NUXT_PUBLIC_BASE_URL=http://192.168.23.161/
VITE_APP_NAME=Hadith

14
dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM node:22
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build-haditha
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]

View File

@ -51,7 +51,7 @@ export default defineNuxtConfig({
nitro: {
compressPublicAssets: true,
prerender: {
routes: ["/haditha/about-us", "/haditha/contact"], // Pre-render these routes
routes: ["/haditha/about-us", "/haditha/contact-us"], // Pre-render these routes
},
},

View File

@ -6,14 +6,16 @@ import { useStorage } from "@vueuse/core";
// lsToken = "GuestAccess";
export default defineNuxtPlugin((nuxtApp) => {
const config = useRuntimeConfig();
// const { session } = useUserSession();
// const authStore = useAuthStore();
let token = useStorage("id_token", "GuestAccess").value;
const api = $fetch.create({
onRequest({ request, options, error }) {
options.baseURL =
import.meta.env.VITE_BASE_URL +
import.meta.env.NUXT_PUBLIC_API_NAME+
config.public.NUXT_PUBLIC_BASE_URL +
config.public.NUXT_PUBLIC_API_NAME +
options.baseURL;
if (token) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 783 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -43,7 +43,7 @@ export default [
{
name: "hadithaContact",
path: "/haditha/contact-us",
file: "~/systems/hadith_ui/pages/haditha/public-pages/ContactUs.vue",
file: "~/systems/hadith_ui/pages/haditha/public-pages/contactus.vue",
},
{
name: "hadithaRules",

View File

@ -69,7 +69,7 @@ export const useAuthStore = defineStore("authStore", {
isGuest(state) {
return !state.isRealUser;
},
async isAuthenticatedGetter(state) {
isAuthenticatedGetter(state) {
let isAuthenticated = useStorage("id_token", "GuestAccess").value;
// updating value sample
// isAuthenticated.value = null
@ -266,8 +266,6 @@ export const useAuthStore = defineStore("authStore", {
// });
},
async login(credentials) {
console.info(import.meta.env.VITE_AUTH_BASE_URL)
try {
const { $api } = useNuxtApp();
const response = await $api(apis.login, {

View File

@ -1,24 +1,32 @@
module.exports = {
prefix: 'tw-',
prefix: "tw-",
content: [
'./components/**/*.{js,vue,ts}',
'./layouts/**/*.vue',
'./pages/**/*.vue',
'./plugins/**/*.{js,ts}',
'./nuxt.config.{js,ts}',
"./components/**/*.{js,vue,ts}",
"./layouts/**/*.vue",
"./pages/**/*.vue",
"./plugins/**/*.{js,ts}",
"./nuxt.config.{js,ts}",
],
theme: {
screens: {
sm: "360px",
md: "720px",
lg: "992px",
xl: "1200px",
"2xl": "1400px",
"3xl": "1900px",
},
extend: {},
},
plugins: [],
purge: {
enabled: process.env.NODE_ENV === 'production',
enabled: process.env.NODE_ENV === "production",
content: [
'./components/**/*.{js,vue,ts}',
'./layouts/**/*.vue',
'./pages/**/*.vue',
'./plugins/**/*.{js,ts}',
'./nuxt.config.{js,ts}',
"./components/**/*.{js,vue,ts}",
"./layouts/**/*.vue",
"./pages/**/*.vue",
"./plugins/**/*.{js,ts}",
"./nuxt.config.{js,ts}",
],
},
};
};

View File

@ -169,6 +169,8 @@ export const copyToClipboard = async (
id = undefined,
domainUrl = undefined
) => {
const toast = useToast();
try {
const _id = id ? "/" + id : "";
let url = location.href;
@ -177,27 +179,37 @@ export const copyToClipboard = async (
}
await navigator.clipboard.writeText(url + _id);
mySwalToast({
html: "نشانی پیوند کپی شد.",
toast.add({
title: "انجام شد.",
description: "نشانی پیوند کپی شد.",
color: "success",
});
} catch (err) {
console.log(err.message);
mySwalToast({
html: "خطایی رخ داد.لطفا دوباره امتحان کنید.",
toast.add({
title: "انجام شد.",
description: "خطایی رخ داد.لطفا دوباره امتحان کنید.",
color: "error",
});
}
};
export const copyTextToClipboard = async (text) => {
const toast = useToast();
try {
await navigator.clipboard.writeText(text);
mySwalToast({
html: "متن کپی شد.",
toast.add({
title: "انجام شد.",
description: "متن کپی شد.",
color: "success",
});
} catch (err) {
console.log(err.message);
mySwalToast({
html: "خطایی رخ داد.لطفا دوباره امتحان کنید.",
toast.add({
title: "انجام شد.",
description: "خطایی رخ داد.لطفا دوباره امتحان کنید.",
color: "error",
});
}
};
@ -275,7 +287,7 @@ export const userAvatar = (user = undefined) => {
if (user?.avatar && user?.avatar?.length) {
return (
import.meta.env.VITE_BASE_URL +
import.meta.env.NUXT_PUBLIC_API_NAME+
import.meta.env.NUXT_PUBLIC_API_NAME +
fileUrl() +
user.avatar
);