flameresttable 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/pages/user/Auth.vue
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<template lang="pug">
|
|
2
|
-
.flex.justify-center.h-screen.items-center.flex-col
|
|
3
|
-
//h3.text-xl.font-bold.text-center Вход
|
|
4
|
-
.px-8.py-6.mt-4.text-left.bg-white.shadow-lg.desktop:w-[700px]
|
|
5
|
-
.mt-0
|
|
6
|
-
.h-4.mb-3.text-gray-400 Войти через
|
|
7
|
-
.flex.text-sm.flex-col.desktop:flex-row
|
|
8
|
-
a.flex.flex-1.items-center(href="/auth/social?authclient=google")
|
|
9
|
-
img.max-h-8(src="/src/assets/icons/google.svg")
|
|
10
|
-
span.pl-6 Google
|
|
11
|
-
a.flex.flex-1.items-center(
|
|
12
|
-
href="/auth/social?authclient=facebook",
|
|
13
|
-
v-if="store.User.country !== 'RU'"
|
|
14
|
-
)
|
|
15
|
-
img.max-h-8(src="/src/assets/icons/facebook.svg")
|
|
16
|
-
span.pl-6 Facebook
|
|
17
|
-
.h-4.mb-3.text-gray-400.text-xs.mt-4.desktop:mt-6.desktop:text-sm Или с помощью почты и пароля
|
|
18
|
-
|
|
19
|
-
.mt-4
|
|
20
|
-
label.block
|
|
21
|
-
input.w-full.px-4.py-2.mt-0.border.rounded-md.focus:outline-none.focus:ring-1.focus:ring-blue-600.placeholder:text-gray-500(
|
|
22
|
-
v-model="state.login",
|
|
23
|
-
name="email",
|
|
24
|
-
type="text",
|
|
25
|
-
placeholder="Почта",
|
|
26
|
-
)
|
|
27
|
-
span.text-xs.tracking-wide.text-red-600 {{ state.loginErr }}
|
|
28
|
-
.mt-2
|
|
29
|
-
label.block
|
|
30
|
-
input.w-full.px-4.py-2.mt-0.border.rounded-md.focus:outline-none.focus:ring-1.focus:ring-blue-600.placeholder:text-gray-500(
|
|
31
|
-
v-model="state.passw",
|
|
32
|
-
name="password",
|
|
33
|
-
type="password",
|
|
34
|
-
placeholder="Пароль",
|
|
35
|
-
)
|
|
36
|
-
.my-2.text-xs.tracking-wide.text-red-600 {{ state.passwErr }}
|
|
37
|
-
a.my-4.text-xs.text-gray-500.cursor-pointer.hover:underline(
|
|
38
|
-
@click="router.push({ name: 'ResetPasswordRequest' })"
|
|
39
|
-
) Я забыл свой пароль
|
|
40
|
-
|
|
41
|
-
.flex.items-center.justify-between.flex-col
|
|
42
|
-
button.px-6.py-2.mt-4.text-white.bg-blue-600.rounded-lg.w-full.cursor-pointer.hover:bg-blue-900(
|
|
43
|
-
@click="Login()"
|
|
44
|
-
) Войти
|
|
45
|
-
|
|
46
|
-
.pt-2.text-center
|
|
47
|
-
a.text-xs.text-gray-500.cursor-pointer.hover:underline(
|
|
48
|
-
@click="router.push({ name: 'Signup' })"
|
|
49
|
-
) Зарегистрироваться
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<script setup lang="ts">
|
|
53
|
-
import { onMounted, reactive, defineProps } from '@vue/runtime-core'; import { storeFile } from "@/store"; import { useRoute, useRouter } from 'vue-router'; import REST from "flamerest"
|
|
54
|
-
|
|
55
|
-
const store = storeFile();
|
|
56
|
-
const router = useRouter(),
|
|
57
|
-
route = useRoute();
|
|
58
|
-
|
|
59
|
-
const state = reactive({
|
|
60
|
-
login: "",
|
|
61
|
-
passw: "",
|
|
62
|
-
loginErr: "",
|
|
63
|
-
passwErr: "",
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
onMounted(() => { });
|
|
67
|
-
|
|
68
|
-
let Login = () => {
|
|
69
|
-
REST.auth(state.login, state.passw).then((res) => {
|
|
70
|
-
if (res.isAuthorized) {
|
|
71
|
-
store.authUser(res);
|
|
72
|
-
store.User.isLoaded = true;
|
|
73
|
-
router.push({ name: "Home" });
|
|
74
|
-
} else {
|
|
75
|
-
if (res.errors) {
|
|
76
|
-
state.loginErr = (
|
|
77
|
-
res.errors["email"] ??
|
|
78
|
-
res.errors["login"] ??
|
|
79
|
-
[]
|
|
80
|
-
).join(". ");
|
|
81
|
-
state.passwErr = (res.errors["password"] ?? []).join(". ");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
</script>
|
|
87
|
-
|
|
88
|
-
<style scoped lang="scss">
|
|
89
|
-
|
|
90
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template lang="pug">
|
|
2
|
-
.flex.justify-center.h-screen.items-center.flex-col
|
|
3
|
-
.px-8.py-6.mt-4.text-left.bg-white.shadow-lg.desktop:w-[725px]
|
|
4
|
-
| Not implemented
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
|
|
9
|
-
import { onMounted, reactive, defineProps } from '@vue/runtime-core'; import { storeFile } from "@/store"; import { useRoute, useRouter } from 'vue-router'; import REST from "flamerest"
|
|
10
|
-
const store = storeFile(); const router = useRouter(), route = useRoute();
|
|
11
|
-
|
|
12
|
-
// Состояние компонента
|
|
13
|
-
const state = reactive({
|
|
14
|
-
test: 5
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
onMounted(() => {
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style scoped lang="scss">
|
|
24
|
-
|
|
25
|
-
</style>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<template lang="pug">
|
|
2
|
-
.flex.justify-center.h-screen.items-center.flex-col
|
|
3
|
-
.px-8.py-6.mt-4.text-left.bg-white.shadow-lg.desktop:w-[725px]
|
|
4
|
-
| Not implemented
|
|
5
|
-
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup lang="ts">
|
|
9
|
-
|
|
10
|
-
import { onMounted, reactive, defineProps } from '@vue/runtime-core'; import { storeFile } from "@/store"; import { useRoute, useRouter } from 'vue-router'; import REST from "flamerest"
|
|
11
|
-
const store = storeFile(); const router = useRouter(), route = useRoute();
|
|
12
|
-
|
|
13
|
-
// Состояние компонента
|
|
14
|
-
const state = reactive({
|
|
15
|
-
test: 5
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
onMounted(() => {
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<style scoped lang="scss">
|
|
25
|
-
|
|
26
|
-
</style>
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<template lang="pug">
|
|
2
|
-
.flex.justify-center.h-screen.items-center.flex-col
|
|
3
|
-
|
|
4
|
-
.px-8.py-6.mt-4.text-left.bg-white.shadow-lg.desktop:w-feed
|
|
5
|
-
|
|
6
|
-
// Регистрация через соц-сети
|
|
7
|
-
.mt-0
|
|
8
|
-
.h-4.mb-3.text-gray-400 Быстрая регистрация через
|
|
9
|
-
.flex.text-sm.flex-col.desktop:flex-row
|
|
10
|
-
a.flex.flex-1.items-center(href="/auth/social?authclient=google")
|
|
11
|
-
img.max-h-8(src="/src/assets/icons/google.svg")
|
|
12
|
-
span.pl-6 Google
|
|
13
|
-
a.flex.flex-1.items-center(
|
|
14
|
-
href="/auth/social?authclient=facebook",
|
|
15
|
-
v-if="store.User.country !== 'RU'"
|
|
16
|
-
)
|
|
17
|
-
img.max-h-8(src="/src/assets/icons/facebook.svg")
|
|
18
|
-
span.pl-6 Facebook
|
|
19
|
-
|
|
20
|
-
.h-4.mb-3.text-gray-400.text-xs.mt-4.desktop:mt-6.desktop:text-sm Или введите почту и пароль
|
|
21
|
-
|
|
22
|
-
// Регистрация через логин и пароль
|
|
23
|
-
.mt-4
|
|
24
|
-
|
|
25
|
-
// Имя пользователя
|
|
26
|
-
label.block
|
|
27
|
-
input.w-full.px-4.py-2.mt-0.border.rounded-md.focus:outline-none.focus:ring-1.focus:ring-blue-600.placeholder:text-gray-500(
|
|
28
|
-
v-model="state.name",
|
|
29
|
-
name="name",
|
|
30
|
-
type="text",
|
|
31
|
-
placeholder="Ваше имя или никнейм, который увидят другие",
|
|
32
|
-
)
|
|
33
|
-
span.text-xs.tracking-wide.text-red-600 {{ state.errors['name']?.join(". ") }}
|
|
34
|
-
|
|
35
|
-
// Почта
|
|
36
|
-
label.block.mt-2
|
|
37
|
-
input.w-full.px-4.py-2.mt-0.border.rounded-md.focus:outline-none.focus:ring-1.focus:ring-blue-600.placeholder:text-gray-500(
|
|
38
|
-
v-model="state.email",
|
|
39
|
-
name="email",
|
|
40
|
-
type="text",
|
|
41
|
-
placeholder="Почта",
|
|
42
|
-
)
|
|
43
|
-
span.text-xs.tracking-wide.text-red-600 {{ state.errors['email']?.join(". ") }}
|
|
44
|
-
|
|
45
|
-
// Пароль
|
|
46
|
-
label.block.mt-2
|
|
47
|
-
input.w-full.px-4.py-2.mt-0.border.rounded-md.focus:outline-none.focus:ring-1.focus:ring-blue-600.placeholder:text-gray-500(
|
|
48
|
-
v-model="state.passw",
|
|
49
|
-
name="password",
|
|
50
|
-
type="password",
|
|
51
|
-
placeholder="Пароль",
|
|
52
|
-
)
|
|
53
|
-
span.my-4.text-xs.tracking-wide.text-red-600 {{ state.errors['password']?.join(". ") }}
|
|
54
|
-
|
|
55
|
-
// Кнопка реги
|
|
56
|
-
.flex.items-center.justify-between.flex-col
|
|
57
|
-
button.px-6.py-2.mt-4.text-white.bg-blue-600.rounded-lg.w-full.hover:bg-blue-900(
|
|
58
|
-
@click="Signup()"
|
|
59
|
-
) Регистрация
|
|
60
|
-
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script setup lang="ts">
|
|
64
|
-
import { onMounted, reactive, defineProps } from '@vue/runtime-core'; import { storeFile } from "@/store"; import { useRoute, useRouter } from 'vue-router'; import REST from "flamerest"
|
|
65
|
-
|
|
66
|
-
const store = storeFile();
|
|
67
|
-
const router = useRouter(),
|
|
68
|
-
route = useRoute();
|
|
69
|
-
|
|
70
|
-
const state = reactive({
|
|
71
|
-
email: "",
|
|
72
|
-
passw: "",
|
|
73
|
-
name: "",
|
|
74
|
-
errors: [] as { [key: string]: any }
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
onMounted(() => { });
|
|
78
|
-
|
|
79
|
-
let Signup = () => {
|
|
80
|
-
REST.signup(state.email, null, state.passw, state.name).then((res) => {
|
|
81
|
-
if (res.isAuthorized === true) {
|
|
82
|
-
store.authUser(res);
|
|
83
|
-
store.User.isLoaded = true;
|
|
84
|
-
router.push({ name: "Home" });
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (res.errors) {
|
|
88
|
-
state.errors = res.errors;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
</script>
|
|
93
|
-
|
|
94
|
-
<style scoped lang="scss">
|
|
95
|
-
|
|
96
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template lang="pug">
|
|
2
|
-
</template>
|
|
3
|
-
|
|
4
|
-
<script setup lang="ts">
|
|
5
|
-
import { onMounted, reactive, defineProps } from '@vue/runtime-core'; import { storeFile } from "@/store"; import { useRoute, useRouter } from 'vue-router'; import REST from "flamerest"
|
|
6
|
-
import { XCircleIcon } from '@icons/solid'
|
|
7
|
-
|
|
8
|
-
const store = storeFile(), router = useRouter(), route = useRoute();
|
|
9
|
-
|
|
10
|
-
// Иконки
|
|
11
|
-
|
|
12
|
-
// Состояние компонента
|
|
13
|
-
const state = reactive({
|
|
14
|
-
test: 5
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
onMounted(() => {
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style scoped lang="scss">
|
|
24
|
-
|
|
25
|
-
</style>
|