Compare commits
4 Commits
sifremi-si
...
5fe3a36893
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fe3a36893 | |||
| 4dae2824fb | |||
| 6d4d0c8be9 | |||
| bf047e36f3 |
@ -251,4 +251,14 @@
|
|||||||
d="M14.3272 17.4867H5.66513C5.33609 17.4867 5.07048 17.7574 5.07048 18.0928C5.07048 18.4281 5.33609 18.6989 5.66513 18.6989H14.3232C14.6522 18.6989 14.9179 18.4281 14.9179 18.0928C14.9179 17.7574 14.6522 17.4867 14.3232 17.4867H14.3272Z"
|
d="M14.3272 17.4867H5.66513C5.33609 17.4867 5.07048 17.7574 5.07048 18.0928C5.07048 18.4281 5.33609 18.6989 5.66513 18.6989H14.3232C14.6522 18.6989 14.9179 18.4281 14.9179 18.0928C14.9179 17.7574 14.6522 17.4867 14.3232 17.4867H14.3272Z"
|
||||||
/>
|
/>
|
||||||
</symbol>
|
</symbol>
|
||||||
|
<symbol id="eyeclose" viewBox="0 0 59 22">
|
||||||
|
<path
|
||||||
|
d="M56.61,11.89l2.55-1.57L52.83.03l-2.55,1.57h0s-11.76,7.25-11.76,7.25c-.94.58-1.91,1.05-2.91,1.43l-2.61.74v.02c-2.43.5-4.94.45-7.36-.14l-1.2-.34c-1.28-.41-2.53-.98-3.72-1.71L7.68.82h0s-1.35-.82-1.35-.82L0,10.28l2.55,1.57,4.76-7.73,6.18,3.81-4.79,7.77,2.55,1.57,4.79-7.77,3.09,1.9c1.15.71,2.35,1.28,3.58,1.74l-2.48,8.78,2.89.82,2.48-8.76c1.32.27,2.66.41,4.01.41,1.41,0,2.82-.16,4.2-.46l2.46,8.7,2.89-.82-2.48-8.75c1.16-.44,2.3-.99,3.39-1.66l3.12-1.92,4.79,7.77,2.55-1.57-4.79-7.77,6.08-3.75,4.75,7.72Z" />
|
||||||
|
</symbol>
|
||||||
|
<symbol id="eye" viewBox="0 0 51 24">
|
||||||
|
<path
|
||||||
|
d="M25.59,24.58c-3.62,0-7.24-.99-10.47-2.98L0,12.29,15.11,2.98c6.46-3.98,14.48-3.98,20.94,0l15.11,9.31-15.11,9.31c-3.23,1.99-6.85,2.98-10.47,2.98ZM5.72,12.29l10.97,6.75c5.49,3.38,12.31,3.38,17.8,0l10.97-6.75-10.97-6.75c-5.49-3.38-12.31-3.38-17.8,0l-10.97,6.75Z" />
|
||||||
|
<path
|
||||||
|
d="M25.59,21.71c-5.19,0-9.42-4.23-9.42-9.42S20.39,2.87,25.59,2.87s9.42,4.23,9.42,9.42-4.23,9.42-9.42,9.42ZM25.59,5.87c-3.54,0-6.42,2.88-6.42,6.42s2.88,6.42,6.42,6.42,6.42-2.88,6.42-6.42-2.88-6.42-6.42-6.42Z" />
|
||||||
|
</symbol>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
@ -454,6 +454,7 @@ label {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
label>span {
|
label>span {
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<input
|
<input
|
||||||
:value="modelValue"
|
:value="modelValue"
|
||||||
:type="type"
|
:type="inputType"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@input="OnInput"
|
@input="OnInput"
|
||||||
@ -22,12 +22,24 @@
|
|||||||
@keyup="OnKeyUp"
|
@keyup="OnKeyUp"
|
||||||
:class="[
|
:class="[
|
||||||
invalidText !== undefined && invalidText !== '' ? 'invalid' : '',
|
invalidText !== undefined && invalidText !== '' ? 'invalid' : '',
|
||||||
iclass || ''
|
iclass || '',
|
||||||
|
isPasswordVisible || props.type === 'password' ? 'password-visible' : ''
|
||||||
]"
|
]"
|
||||||
:min="min"
|
:min="min"
|
||||||
:max="max"
|
:max="max"
|
||||||
:minlength="minlength"
|
:minlength="minlength"
|
||||||
:maxlength="maxlength" />
|
:maxlength="maxlength" />
|
||||||
|
<i
|
||||||
|
class="ico-c ico-password-visible"
|
||||||
|
v-if="props.type === 'password'"
|
||||||
|
@click="PasswordVisibleToggle">
|
||||||
|
<svg>
|
||||||
|
<use
|
||||||
|
:href="
|
||||||
|
'/src/assets/images/icons.svg#' + (isPasswordVisible ? 'eye' : 'eyeclose')
|
||||||
|
"></use>
|
||||||
|
</svg>
|
||||||
|
</i>
|
||||||
<span
|
<span
|
||||||
class="form-item-alert"
|
class="form-item-alert"
|
||||||
v-if="InvalidMessages.length > 0 && InvalidMessages !== ''">
|
v-if="InvalidMessages.length > 0 && InvalidMessages !== ''">
|
||||||
@ -82,9 +94,18 @@
|
|||||||
'keydown',
|
'keydown',
|
||||||
'keyup'
|
'keyup'
|
||||||
])
|
])
|
||||||
const localValue = ref<any>()
|
const isPasswordVisible = ref<boolean>(false)
|
||||||
const InvalidMessageText = reactive<Record<string, any>>({})
|
const InvalidMessageText = reactive<Record<string, any>>({})
|
||||||
|
|
||||||
|
const inputType = computed(() => {
|
||||||
|
if (props.type !== 'password') {
|
||||||
|
return props.type
|
||||||
|
} else {
|
||||||
|
if (isPasswordVisible.value) return 'text'
|
||||||
|
else return 'password'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const InvalidMessages = computed<string>(() => {
|
const InvalidMessages = computed<string>(() => {
|
||||||
let text = ''
|
let text = ''
|
||||||
Object.keys(InvalidMessageText).forEach((k: string, i: number) => {
|
Object.keys(InvalidMessageText).forEach((k: string, i: number) => {
|
||||||
@ -138,7 +159,9 @@
|
|||||||
emit('update:modelValue', (e.target as HTMLInputElement).value)
|
emit('update:modelValue', (e.target as HTMLInputElement).value)
|
||||||
emit('keyup', e)
|
emit('keyup', e)
|
||||||
}
|
}
|
||||||
|
const PasswordVisibleToggle = () => {
|
||||||
|
if (props.type === 'password') isPasswordVisible.value = !isPasswordVisible.value
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => props.invalidText,
|
() => props.invalidText,
|
||||||
() => {
|
() => {
|
||||||
@ -151,3 +174,16 @@
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.ico-password-visible {
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
top: 32px;
|
||||||
|
min-width: 32px;
|
||||||
|
min-height: 32px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.password-visible {
|
||||||
|
padding: 8px 40px 8px 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -48,7 +48,7 @@ axios.interceptors.response.use(
|
|||||||
const token = sessionStorage.getItem(usersStore.userStorageKeys.TOKEN)
|
const token = sessionStorage.getItem(usersStore.userStorageKeys.TOKEN)
|
||||||
if (token !== undefined) {
|
if (token !== undefined) {
|
||||||
usersStore.ResetUserData()
|
usersStore.ResetUserData()
|
||||||
router.push('/giris')
|
router.push('/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
|
|||||||
@ -71,7 +71,7 @@
|
|||||||
let dt = await dataStore.dataPost('Auth/logout')
|
let dt = await dataStore.dataPost('Auth/logout')
|
||||||
}
|
}
|
||||||
usersStore.ResetUserData()
|
usersStore.ResetUserData()
|
||||||
router.push('/giris')
|
router.push('/login')
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeProfileMenu = (e: Event) => {
|
const closeProfileMenu = (e: Event) => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import ForgotPassword from '@/module/auth/views/ForgotPassword.vue'
|
import ForgotPassword from '@/module/auth/views/ForgotPassword.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/sifremi-unuttum',
|
path: '/forgot-password',
|
||||||
name: 'ForgotPassword',
|
name: 'ForgotPassword',
|
||||||
component: ForgotPassword,
|
component: ForgotPassword,
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
import Login from '@/module/auth/routes/login'
|
import Login from "@/module/auth/routes/login";
|
||||||
import Register from '@/module/auth/routes/register'
|
import Register from "@/module/auth/routes/register";
|
||||||
import ForgotPassword from '@/module/auth/routes/forgot-password'
|
import ForgotPassword from "@/module/auth/routes/forgot-password";
|
||||||
import ResetPassword from '@/module/auth/routes/reset-password'
|
|
||||||
|
export default [
|
||||||
|
Login,
|
||||||
|
Register,
|
||||||
|
ForgotPassword
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
export default [Login, Register, ForgotPassword, ResetPassword]
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Login from '@/module/auth/views/Login.vue'
|
import Login from '@/module/auth/views/Login.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/giris',
|
path: '/login',
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
component: Login,
|
component: Login,
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Register from '@/module/auth/views/Register.vue'
|
import Register from '@/module/auth/views/Register.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/kayit-ol',
|
path: '/register',
|
||||||
name: 'Register',
|
name: 'Register',
|
||||||
component: Register,
|
component: Register,
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
import ResetPassword from '@/module/auth/views/ResetPassword.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
path: '/sifreyi-sifirla',
|
|
||||||
name: 'ResetPassword',
|
|
||||||
component: ResetPassword,
|
|
||||||
meta: {
|
|
||||||
authpage: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,59 +1,17 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { useDataStore } from '@/stores/dataStore'
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
import { useAuthStore } from '../stores/authStore'
|
import { useAuthStore } from '../stores/authStore'
|
||||||
import { useAuthValidationStore } from '../validation/authValidationStore'
|
|
||||||
import { useUsersStore } from '@/stores/usersStore'
|
|
||||||
import router from '@/router'
|
|
||||||
|
|
||||||
export const useAuthService = defineStore('authService', () => {
|
export const useAppService = defineStore('appService', () => {
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const authValidationStore = useAuthValidationStore()
|
|
||||||
const usersStore = useUsersStore()
|
|
||||||
|
|
||||||
const Login = async () => {
|
const GetAAuthRoleList = async () => {
|
||||||
if (authValidationStore.LoginFormCheck()) {
|
if (authStore.rolesList.length === 0) {
|
||||||
let login = await dataStore.dataPost('Auth/login', {
|
let data = await dataStore.dataGet('Auth/rolelistesi')
|
||||||
data: authStore.loginData
|
authStore.rolesList = data
|
||||||
})
|
|
||||||
Object.assign(authStore.loginData, authStore.safeLoginData)
|
|
||||||
if (login !== 'errorfalse') {
|
|
||||||
await usersStore.SetUserSessionData(login)
|
|
||||||
await usersStore.SetUserData()
|
|
||||||
|
|
||||||
if (usersStore.isPanelUser) {
|
|
||||||
router.push('/')
|
|
||||||
} else {
|
|
||||||
if (usersStore.userStatus === 0 || usersStore.userStatus === null) {
|
|
||||||
router.push('/profil')
|
|
||||||
} else {
|
|
||||||
router.push('/')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
authValidationStore.loginMessageType = 'alert'
|
|
||||||
authValidationStore.loginMessage =
|
|
||||||
'Kullanıcı adı veya şifrenizi yanlış girdiniz. Lütfen kontrol edip tekrar deneyiniz.'
|
|
||||||
authValidationStore.isLoginMessage = true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
authValidationStore.isLoginFormValid = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ResetPassword = async () => {
|
return {GetAAuthRoleList}
|
||||||
if (authValidationStore.ResetPasswordFormCheck()) {
|
|
||||||
let dt: any
|
|
||||||
|
|
||||||
dt = await dataStore.dataPost('ResetPassword', {
|
|
||||||
data: authStore.resetPasswordForm
|
|
||||||
})
|
|
||||||
if (dt !== 'errorfalse') {
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
authValidationStore.isResetPasswordFormValid = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return { Login, ResetPassword }
|
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,19 +1,12 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref,reactive } from 'vue'
|
||||||
|
|
||||||
export const useAuthStore = defineStore('authStore', () => {
|
export const useAuthStore = defineStore('authStore', () => {
|
||||||
const loginData = reactive<Record<string, any>>({ username: '', password: '' })
|
const loginData = reactive<Record<string, any>>({ username: '', password: '' })
|
||||||
const safeLoginData = reactive<Record<string, any>>({})
|
const safeLoginData = reactive<Record<string, any>>({})
|
||||||
const rolesList = ref<Record<string, any>[]>([])
|
const rolesList = ref<Record<string, any>[]>([])
|
||||||
const resetCheckData = ref<string>('')
|
|
||||||
|
|
||||||
const resetPasswordForm = reactive<Record<string, any>>({
|
|
||||||
newPassword: '',
|
|
||||||
newPasswordRepeat: '',
|
|
||||||
check: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
Object.assign(safeLoginData, loginData)
|
Object.assign(safeLoginData, loginData)
|
||||||
|
|
||||||
return { loginData, safeLoginData, rolesList, resetPasswordForm, resetCheckData }
|
return { loginData, safeLoginData, rolesList }
|
||||||
})
|
})
|
||||||
|
|||||||
46
src/module/auth/stores/authValidationStore.ts
Normal file
46
src/module/auth/stores/authValidationStore.ts
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useAuthStore } from './authStore'
|
||||||
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
|
|
||||||
|
export const useAuthValidationStore = defineStore('authValidationStore', () => {
|
||||||
|
const authStore = useAuthStore()
|
||||||
|
const validationStore = useValidationStore()
|
||||||
|
|
||||||
|
const isFormValid = ref<boolean>(true)
|
||||||
|
const isLoginMessage = ref<boolean>(false)
|
||||||
|
const loginMessageType = ref<string>('success')
|
||||||
|
const loginMessage = ref<string>('')
|
||||||
|
const registerMessage = ref<string>('')
|
||||||
|
const invalidTexts = reactive<Record<string, any>>({})
|
||||||
|
|
||||||
|
const FormCheck = (): boolean => {
|
||||||
|
Object.assign(invalidTexts, {})
|
||||||
|
|
||||||
|
validationStore.IsFieldEmpty(
|
||||||
|
authStore.loginData,
|
||||||
|
invalidTexts,
|
||||||
|
'username',
|
||||||
|
'Kullanıcı adı alanını doldurmalısınız. Örn: isim@alanadi.td'
|
||||||
|
)
|
||||||
|
validationStore.IsFieldEmpty(
|
||||||
|
authStore.loginData,
|
||||||
|
invalidTexts,
|
||||||
|
'password',
|
||||||
|
'Lütfen şifrenizi giriniz.'
|
||||||
|
)
|
||||||
|
|
||||||
|
isFormValid.value = Object.keys(invalidTexts).length === 0
|
||||||
|
return isFormValid.value
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
isFormValid,
|
||||||
|
invalidTexts,
|
||||||
|
isLoginMessage,
|
||||||
|
loginMessageType,
|
||||||
|
loginMessage,
|
||||||
|
registerMessage,
|
||||||
|
FormCheck
|
||||||
|
}
|
||||||
|
})
|
||||||
@ -1,89 +0,0 @@
|
|||||||
import { defineStore } from 'pinia'
|
|
||||||
import { ref, reactive } from 'vue'
|
|
||||||
import { useValidationStore } from '@/stores/validationStore'
|
|
||||||
import { useAuthStore } from '../stores/authStore'
|
|
||||||
|
|
||||||
export const useAuthValidationStore = defineStore('authValidationStore', () => {
|
|
||||||
const validationStore = useValidationStore()
|
|
||||||
const authStore = useAuthStore()
|
|
||||||
|
|
||||||
const isLoginMessage = ref<boolean>(false)
|
|
||||||
const loginMessageType = ref<string>('success')
|
|
||||||
const loginMessage = ref<string>('')
|
|
||||||
const registerMessage = ref<string>('')
|
|
||||||
|
|
||||||
const loginInvalidTexts = reactive<Record<string, any>>({})
|
|
||||||
const isLoginFormValid = ref<boolean>(true)
|
|
||||||
const resetPasswordFormChanged = ref<boolean>(false)
|
|
||||||
const isResetPasswordFormValid = ref<boolean>(true)
|
|
||||||
const resetPasswordInvalidTexts = reactive<Record<string, any>>({})
|
|
||||||
|
|
||||||
const LoginFormCheck = (): boolean => {
|
|
||||||
Object.assign(loginInvalidTexts, {})
|
|
||||||
|
|
||||||
validationStore.IsFieldEmpty(
|
|
||||||
authStore.loginData,
|
|
||||||
loginInvalidTexts,
|
|
||||||
'username',
|
|
||||||
'Kullanıcı adı alanını doldurmalısınız. Örn: isim@alanadi.td'
|
|
||||||
)
|
|
||||||
validationStore.IsFieldEmpty(
|
|
||||||
authStore.loginData,
|
|
||||||
loginInvalidTexts,
|
|
||||||
'password',
|
|
||||||
'Lütfen şifrenizi giriniz.'
|
|
||||||
)
|
|
||||||
|
|
||||||
isLoginFormValid.value = Object.keys(loginInvalidTexts).length === 0
|
|
||||||
return isLoginFormValid.value
|
|
||||||
}
|
|
||||||
|
|
||||||
const ResetPasswordFormCheck = (): boolean => {
|
|
||||||
Object.assign(resetPasswordInvalidTexts, {})
|
|
||||||
|
|
||||||
validationStore.IsFieldEmpty(
|
|
||||||
authStore.resetPasswordForm,
|
|
||||||
resetPasswordInvalidTexts,
|
|
||||||
'newPassword',
|
|
||||||
'Lütfen yeni şifrenizi giriniz.'
|
|
||||||
)
|
|
||||||
|
|
||||||
validationStore.IsFieldEmpty(
|
|
||||||
authStore.resetPasswordForm,
|
|
||||||
resetPasswordInvalidTexts,
|
|
||||||
'newPasswordRepeat',
|
|
||||||
'Lütfen yeni şifrenizi tekrar giriniz.'
|
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
|
||||||
!validationStore.checkEmpty(authStore.resetPasswordForm.newPassword) &&
|
|
||||||
!validationStore.checkEmpty(authStore.resetPasswordForm.newPasswordRepeat)
|
|
||||||
) {
|
|
||||||
if (
|
|
||||||
authStore.resetPasswordForm.newPassword !==
|
|
||||||
authStore.resetPasswordForm.newPasswordRepeat
|
|
||||||
) {
|
|
||||||
isResetPasswordFormValid.value = false
|
|
||||||
resetPasswordInvalidTexts.newPasswordRepeat =
|
|
||||||
'Şifrenizi tekrar doğru girdiğinizden emin olunuz.'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
isResetPasswordFormValid.value = Object.keys(resetPasswordInvalidTexts).length === 0
|
|
||||||
return isResetPasswordFormValid.value
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
isLoginMessage,
|
|
||||||
loginMessageType,
|
|
||||||
loginMessage,
|
|
||||||
loginInvalidTexts,
|
|
||||||
registerMessage,
|
|
||||||
isLoginFormValid,
|
|
||||||
resetPasswordFormChanged,
|
|
||||||
isResetPasswordFormValid,
|
|
||||||
resetPasswordInvalidTexts,
|
|
||||||
LoginFormCheck,
|
|
||||||
ResetPasswordFormCheck
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="login-nav login-nav-back">
|
<div class="login-nav login-nav-back">
|
||||||
<RouterLink to="/giris">< Geri</RouterLink>
|
<RouterLink to="/login">< Geri</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@ -3,12 +3,14 @@
|
|||||||
<section class="section-login">
|
<section class="section-login">
|
||||||
<div class="login-header">
|
<div class="login-header">
|
||||||
<div class="logo-header">
|
<div class="logo-header">
|
||||||
<img src="@/assets/images/cekilisevi-logo-n.png" alt="MPI Çekiliş Evi" />
|
<img
|
||||||
|
src="@/assets/images/cekilisevi-logo-n.png"
|
||||||
|
alt="MPI Çekiliş Evi"/>
|
||||||
</div>
|
</div>
|
||||||
<h1>Giriş Yap</h1>
|
<h1>Giriş Yap</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="section-content">
|
<div class="section-content">
|
||||||
<form action="#" id="login-form" @submit.prevent="authService.Login">
|
<form action="#" id="login-form" @submit.prevent="Login">
|
||||||
<form-input
|
<form-input
|
||||||
type="email"
|
type="email"
|
||||||
modelKey="username"
|
modelKey="username"
|
||||||
@ -16,11 +18,12 @@
|
|||||||
required
|
required
|
||||||
label="Kullanıcı Adı (e-posta adresi)"
|
label="Kullanıcı Adı (e-posta adresi)"
|
||||||
placeholder="eposta@alanadi.com"
|
placeholder="eposta@alanadi.com"
|
||||||
:invalidText="authValidationStore.loginInvalidTexts.username" />
|
:invalidText="authValidationStore.invalidTexts.username" />
|
||||||
|
|
||||||
<form-input
|
<form-input
|
||||||
type="password"
|
type="password"
|
||||||
label="Şifre"
|
label="Şifre"
|
||||||
|
|
||||||
v-model="authStore.loginData.password"
|
v-model="authStore.loginData.password"
|
||||||
required />
|
required />
|
||||||
|
|
||||||
@ -29,38 +32,64 @@
|
|||||||
v-if="authValidationStore.isLoginMessage">
|
v-if="authValidationStore.isLoginMessage">
|
||||||
<span>{{ authValidationStore.loginMessage }}</span>
|
<span>{{ authValidationStore.loginMessage }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button class="button-c button-second button-login" type="submit">
|
||||||
class="button-c button-second button-login"
|
|
||||||
type="submit"
|
|
||||||
@submit="authService.Login"
|
|
||||||
@click="authService.Login">
|
|
||||||
Giriş Yap
|
Giriş Yap
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="login-nav">
|
<div class="login-nav">
|
||||||
<RouterLink to="/sifremi-unuttum">Şifremi Unuttum</RouterLink>
|
<RouterLink to="/forgot-password">Şifremi Unuttum</RouterLink>
|
||||||
<RouterLink to="/kayit-ol">Kayıt Ol</RouterLink>
|
<RouterLink to="/register">Kaydol</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</GuestLayout>
|
</GuestLayout>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeMount } from 'vue'
|
import { onBeforeMount, reactive, ref } from 'vue'
|
||||||
|
|
||||||
import { useUsersStore } from '@/stores/usersStore'
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
const usersStore = useUsersStore()
|
const usersStore = useUsersStore()
|
||||||
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
|
const dataStore = useDataStore()
|
||||||
import { useAuthStore } from '../stores/authStore'
|
import { useAuthStore } from '../stores/authStore'
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
import { useAuthValidationStore } from '../validation/authValidationStore'
|
import { useAuthValidationStore } from '../stores/authValidationStore'
|
||||||
const authValidationStore = useAuthValidationStore()
|
const authValidationStore = useAuthValidationStore()
|
||||||
import { useAuthService } from '../services/authService'
|
|
||||||
const authService = useAuthService()
|
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
import GuestLayout from '@/layouts/GuestLayout.vue'
|
import GuestLayout from '@/layouts/GuestLayout.vue'
|
||||||
|
|
||||||
|
const Login = async () => {
|
||||||
|
if (authValidationStore.FormCheck()) {
|
||||||
|
let login = await dataStore.dataPost('Auth/login', {
|
||||||
|
data: authStore.loginData
|
||||||
|
})
|
||||||
|
Object.assign(authStore.loginData, authStore.safeLoginData)
|
||||||
|
if (login !== 'errorfalse') {
|
||||||
|
await usersStore.SetUserSessionData(login)
|
||||||
|
await usersStore.SetUserData()
|
||||||
|
|
||||||
|
if (usersStore.isPanelUser) {
|
||||||
|
router.push('/')
|
||||||
|
} else {
|
||||||
|
if (usersStore.userStatus === 0 || usersStore.userStatus === null) {
|
||||||
|
router.push('/profil')
|
||||||
|
} else {
|
||||||
|
router.push('/')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authValidationStore.loginMessageType = 'alert'
|
||||||
|
authValidationStore.loginMessage =
|
||||||
|
'Kullanıcı adı veya şifrenizi yanlış girdiniz. Lütfen kontrol edip tekrar deneyiniz.'
|
||||||
|
authValidationStore.isLoginMessage = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authValidationStore.isFormValid = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
if (usersStore.userIsAuth) router.push('/')
|
if(usersStore.userIsAuth) router.push('/')
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -339,7 +339,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<div class="login-nav login-nav-back">
|
<div class="login-nav login-nav-back">
|
||||||
<RouterLink to="/giris">< Geri</RouterLink>
|
<RouterLink to="/login">< Geri</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -355,7 +355,7 @@
|
|||||||
const globalDataStore = useGlobalDataStore()
|
const globalDataStore = useGlobalDataStore()
|
||||||
import { useValidationStore } from '@/stores/validationStore'
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
const validationStore = useValidationStore()
|
const validationStore = useValidationStore()
|
||||||
import { useAuthValidationStore } from '../validation/authValidationStore'
|
import { useAuthValidationStore } from '../stores/authValidationStore'
|
||||||
const authValidationStore = useAuthValidationStore()
|
const authValidationStore = useAuthValidationStore()
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
@ -413,7 +413,7 @@
|
|||||||
'Başarıyla kayıt oldunuz. Kullanıcı adı ve şifreniz ile giriş yapabilirsiniz.'
|
'Başarıyla kayıt oldunuz. Kullanıcı adı ve şifreniz ile giriş yapabilirsiniz.'
|
||||||
authValidationStore.isLoginMessage = true
|
authValidationStore.isLoginMessage = true
|
||||||
|
|
||||||
router.push('/giris')
|
router.push('/login')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uyeBilgileriStore.isFormValid = true
|
uyeBilgileriStore.isFormValid = true
|
||||||
|
|||||||
@ -1,62 +0,0 @@
|
|||||||
<template>
|
|
||||||
<GuestLayout>
|
|
||||||
<section class="section-login">
|
|
||||||
<div class="login-header">
|
|
||||||
<div class="logo-header">
|
|
||||||
<img src="@/assets/images/cekilisevi-logo-n.png" alt="MPI Çekiliş Evi" />
|
|
||||||
</div>
|
|
||||||
<h1>Şifremi Sıfırla</h1>
|
|
||||||
</div>
|
|
||||||
<div class="section-content">
|
|
||||||
<form id="sifremi-unuttum" @submit.prevent="authService.ResetPassword">
|
|
||||||
<form-input
|
|
||||||
type="password"
|
|
||||||
modelKey="newPassword"
|
|
||||||
v-model="authStore.resetPasswordForm.newPassword"
|
|
||||||
required
|
|
||||||
label="Yeni Şifre"
|
|
||||||
placeholder="Yeni Şifre"
|
|
||||||
:invalidText="authValidationStore.resetPasswordInvalidTexts.newPassword" />
|
|
||||||
<form-input
|
|
||||||
type="password"
|
|
||||||
modelKey="newPasswordRepeat"
|
|
||||||
v-model="authStore.resetPasswordForm.newPasswordRepeat"
|
|
||||||
required
|
|
||||||
label="Yeni Şifre Tekrar"
|
|
||||||
placeholder="Yeni Şifre Tekrar"
|
|
||||||
:invalidText="
|
|
||||||
authValidationStore.resetPasswordInvalidTexts.newPasswordRepeat
|
|
||||||
" />
|
|
||||||
<button
|
|
||||||
class="button-c button-second button-login"
|
|
||||||
type="submit"
|
|
||||||
@submit="authService.ResetPassword"
|
|
||||||
@click="authService.ResetPassword">
|
|
||||||
Şifremi Sıfırla
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div class="login-nav login-nav-back">
|
|
||||||
<RouterLink to="/giris">< Geri</RouterLink>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</GuestLayout>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { onMounted } from 'vue'
|
|
||||||
import GuestLayout from '@/layouts/GuestLayout.vue'
|
|
||||||
import { useAuthStore } from '../stores/authStore'
|
|
||||||
const authStore = useAuthStore()
|
|
||||||
import { useAuthService } from '../services/authService'
|
|
||||||
const authService = useAuthService()
|
|
||||||
import { useAuthValidationStore } from '../validation/authValidationStore'
|
|
||||||
const authValidationStore = useAuthValidationStore()
|
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
|
||||||
const route = useRoute()
|
|
||||||
const router = useRouter()
|
|
||||||
onMounted(() => {
|
|
||||||
if (route.query && route.query.check !== undefined)
|
|
||||||
authStore.resetCheckData = route.query.check as string
|
|
||||||
else router.push('/giris')
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
@ -108,6 +108,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const OnIkramiyeChanged = (e: Event, val: any, item: Record<string, any>) => {
|
const OnIkramiyeChanged = (e: Event, val: any, item: Record<string, any>) => {
|
||||||
|
|
||||||
|
piyangoDosyaKapamaStore.dosyaKapamaIkramiyeData.ikramiyeId = item.id
|
||||||
|
|
||||||
piyangoDosyaKapamaStore.dosyaKapamaIkramiyeData.tahhutEdilenIkramiye = `
|
piyangoDosyaKapamaStore.dosyaKapamaIkramiyeData.tahhutEdilenIkramiye = `
|
||||||
${item.cinsi}, ${item.marka}, ${item.model}, (${item.asilTalihliAdedi} adet)
|
${item.cinsi}, ${item.marka}, ${item.model}, (${item.asilTalihliAdedi} adet)
|
||||||
`
|
`
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export const connectToHub = async () => {
|
|||||||
|
|
||||||
connection = new signalR.HubConnectionBuilder()
|
connection = new signalR.HubConnectionBuilder()
|
||||||
.withUrl(import.meta.env.VITE_SOCKET_URL, {
|
.withUrl(import.meta.env.VITE_SOCKET_URL, {
|
||||||
withCredentials: true,
|
withCredentials: false,
|
||||||
skipNegotiation: true, // WebSocket kullanırken negotiation atlanabilir
|
skipNegotiation: true, // WebSocket kullanırken negotiation atlanabilir
|
||||||
transport: signalR.HttpTransportType.WebSockets
|
transport: signalR.HttpTransportType.WebSockets
|
||||||
})
|
})
|
||||||
|
|||||||
@ -2,10 +2,13 @@ import { defineStore } from 'pinia'
|
|||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { useGlobalStore } from '@/stores/globalStore'
|
import { useGlobalStore } from '@/stores/globalStore'
|
||||||
import { usePiyangoStore } from './piyangoStore'
|
import { usePiyangoStore } from './piyangoStore'
|
||||||
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
|
||||||
|
|
||||||
export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore', () => {
|
export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore', () => {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
const piyangoStore = usePiyangoStore()
|
const piyangoStore = usePiyangoStore()
|
||||||
|
const usersStore = useUsersStore()
|
||||||
|
|
||||||
const baseDosyaKapamaData = reactive<Record<string, any>>({
|
const baseDosyaKapamaData = reactive<Record<string, any>>({
|
||||||
katilimSekli: '',
|
katilimSekli: '',
|
||||||
@ -49,6 +52,8 @@ export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore',
|
|||||||
teslimEdilenIkramiye: '',
|
teslimEdilenIkramiye: '',
|
||||||
alinmayanIkramiye: '',
|
alinmayanIkramiye: '',
|
||||||
aciklama: '',
|
aciklama: '',
|
||||||
|
duzenleyenId: usersStore.userId,
|
||||||
|
ikramiyeId:'',
|
||||||
cekilisId: piyangoStore.selectedLottery
|
cekilisId: piyangoStore.selectedLottery
|
||||||
})
|
})
|
||||||
const dosyaKapamaData = reactive<Record<string, any>>({})
|
const dosyaKapamaData = reactive<Record<string, any>>({})
|
||||||
|
|||||||
@ -39,7 +39,7 @@ router.beforeEach((to, from) => {
|
|||||||
const usersStore = useUsersStore()
|
const usersStore = useUsersStore()
|
||||||
|
|
||||||
if (to.meta.authRequired && !usersStore.userIsAuth && from.name !== 'Login') {
|
if (to.meta.authRequired && !usersStore.userIsAuth && from.name !== 'Login') {
|
||||||
router.push('/giris')
|
router.push('/login')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user