Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
da2208af
Commit
da2208af
authored
Jan 04, 2023
by
TTS Kieu Tuan Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ident
parent
5b81708c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
80 deletions
+80
-80
NuxtLogo.vue
components/NuxtLogo.vue
+10
-10
index.vue
pages/index.vue
+33
-33
register.vue
pages/register.vue
+37
-37
No files found.
components/NuxtLogo.vue
View file @
da2208af
<
template
>
<svg
<svg
class=
"nuxt-logo"
viewBox=
"0 0 45 30"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
>
<path
d=
"M24.7203 29.704H41.1008C41.6211 29.7041 42.1322 29.5669 42.5828 29.3061C43.0334 29.0454 43.4075 28.6704 43.6675 28.2188C43.9275 27.7672 44.0643 27.2549 44.0641 26.7335C44.0639 26.2121 43.9266 25.6999 43.6662 25.2485L32.6655 6.15312C32.4055 5.70162 32.0315 5.32667 31.581 5.06598C31.1305 4.8053 30.6195 4.66805 30.0994 4.66805C29.5792 4.66805 29.0682 4.8053 28.6177 5.06598C28.1672 5.32667 27.7932 5.70162 27.5332 6.15312L24.7203 11.039L19.2208 1.48485C18.9606 1.03338 18.5864 0.658493 18.1358 0.397853C17.6852 0.137213 17.1741 0 16.6538 0C16.1336 0 15.6225 0.137213 15.1719 0.397853C14.7213 0.658493 14.3471 1.03338 14.0868 1.48485L0.397874 25.2485C0.137452 25.6999 0.000226653 26.2121 2.8053e-07 26.7335C-0.000226092 27.2549 0.136554 27.7672 0.396584 28.2188C0.656614 28.6704 1.03072 29.0454 1.48129 29.3061C1.93185 29.5669 2.44298 29.7041 2.96326 29.704H13.2456C17.3195 29.704 20.3239 27.9106 22.3912 24.4118L27.4102 15.7008L30.0986 11.039L38.1667 25.0422H27.4102L24.7203 29.704ZM13.0779 25.0374L5.9022 25.0358L16.6586 6.36589L22.0257 15.7008L18.4322 21.9401C17.0593 24.2103 15.4996 25.0374 13.0779 25.0374Z"
fill=
"#00DC82"
d=
"M24.7203 29.704H41.1008C41.6211 29.7041 42.1322 29.5669 42.5828 29.3061C43.0334 29.0454 43.4075 28.6704 43.6675 28.2188C43.9275 27.7672 44.0643 27.2549 44.0641 26.7335C44.0639 26.2121 43.9266 25.6999 43.6662 25.2485L32.6655 6.15312C32.4055 5.70162 32.0315 5.32667 31.581 5.06598C31.1305 4.8053 30.6195 4.66805 30.0994 4.66805C29.5792 4.66805 29.0682 4.8053 28.6177 5.06598C28.1672 5.32667 27.7932 5.70162 27.5332 6.15312L24.7203 11.039L19.2208 1.48485C18.9606 1.03338 18.5864 0.658493 18.1358 0.397853C17.6852 0.137213 17.1741 0 16.6538 0C16.1336 0 15.6225 0.137213 15.1719 0.397853C14.7213 0.658493 14.3471 1.03338 14.0868 1.48485L0.397874 25.2485C0.137452 25.6999 0.000226653 26.2121 2.8053e-07 26.7335C-0.000226092 27.2549 0.136554 27.7672 0.396584 28.2188C0.656614 28.6704 1.03072 29.0454 1.48129 29.3061C1.93185 29.5669 2.44298 29.7041 2.96326 29.704H13.2456C17.3195 29.704 20.3239 27.9106 22.3912 24.4118L27.4102 15.7008L30.0986 11.039L38.1667 25.0422H27.4102L24.7203 29.704ZM13.0779 25.0374L5.9022 25.0358L16.6586 6.36589L22.0257 15.7008L18.4322 21.9401C17.0593 24.2103 15.4996 25.0374 13.0779 25.0374Z"
fill=
"#00DC82"
/>
</svg>
</svg>
</
template
>
<
style
>
.nuxt-logo
{
height
:
20%
;
display
:
block
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-bottom
:
15px
;
height
:
20%
;
display
:
block
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-bottom
:
15px
;
}
</
style
>
pages/index.vue
View file @
da2208af
...
...
@@ -62,38 +62,38 @@ import Nav from "@/components/Nav";
import
notification
from
"
@/components/notification
"
;
export
default
{
components
:
{
Nav
},
components
:
{
Notification
},
components
:
{
NuxtLogo
},
components
:
{
Nav
},
components
:
{
Notification
},
components
:
{
NuxtLogo
},
};
</
script
>
<
script
>
import
{
reactive
}
from
"
vue
"
;
import
axios
from
"
axios
"
;
export
default
{
data
:
()
=>
{
return
{
email
:
""
,
password
:
""
,
status
:
null
,
error
:
null
,
data
:
()
=>
{
return
{
email
:
""
,
password
:
""
,
status
:
null
,
error
:
null
,
};
},
methods
:
{
async
login
()
{
try
{
const
resp
=
await
fetch
(
"
http://127.0.0.1:8000/api/login
"
,
{
method
:
"
POST
"
,
headers
:
{
method
:
"
POST
"
,
headers
:
{
"
Content-Type
"
:
"
application/json
"
,
"
Accept
"
:
"
application/json
"
,
Accept
:
"
application/json
"
,
},
body
:
JSON
.
stringify
({
body
:
JSON
.
stringify
({
email
:
this
.
email
,
password
:
this
.
password
,
}),
}).
then
((
response
)
=>
{
return
response
.
json
();
return
response
.
json
();
});
console
.
log
(
resp
.
status
);
localStorage
.
setItem
(
"
token
"
,
resp
.
data
.
bearer_token
);
...
...
@@ -101,7 +101,7 @@ export default {
this
.
$auth
.
$storage
.
setUniversal
(
"
userName
"
,
resp
.
data
.
name
);
this
.
$auth
.
$storage
.
setUniversal
(
"
loggedIn
"
,
"
true
"
);
if
(
resp
.
status
==
"
success
"
)
{
this
.
$router
.
push
(
"
home
"
);
this
.
$router
.
push
(
"
home
"
);
}
}
catch
(
e
)
{
this
.
error
=
"
Username or Password not valid
"
;
...
...
@@ -123,34 +123,34 @@ export default {
// }
},
checkForm
:
function
(
e
)
{
if
(
this
.
name
&&
this
.
age
)
{
return
true
;
if
(
this
.
name
&&
this
.
age
)
{
return
true
;
}
this
.
errors
=
[];
this
.
errors
=
[];
if
(
!
this
.
name
)
{
this
.
errors
.
push
(
"
Name required.
"
);
if
(
!
this
.
name
)
{
this
.
errors
.
push
(
"
Name required.
"
);
}
if
(
!
this
.
age
)
{
this
.
errors
.
push
(
"
Age required.
"
);
if
(
!
this
.
age
)
{
this
.
errors
.
push
(
"
Age required.
"
);
}
e
.
preventDefault
();
},
e
.
preventDefault
();
},
},
};
</
script
>
<
style
scoped
>
#form-login
{
height
:
50%
;
width
:
25%
;
padding
:
12px
;
padding-top
:
60px
;
display
:
flex
;
justify-content
:
center
;
background-color
:
white
;
border-radius
:
3%
;
font-weight
:
600
;
height
:
50%
;
width
:
25%
;
padding
:
12px
;
padding-top
:
60px
;
display
:
flex
;
justify-content
:
center
;
background-color
:
white
;
border-radius
:
3%
;
font-weight
:
600
;
}
</
style
>
pages/register.vue
View file @
da2208af
...
...
@@ -63,49 +63,49 @@
import
{
reactive
}
from
"
vue
"
;
export
default
{
data
:
()
=>
{
return
{
name
:
""
,
email
:
""
,
password
:
""
,
confirm_password
:
""
,
};
},
methods
:
{
signin
()
{
fetch
(
"
http://127.0.0.1:8000/api/register
"
,
{
method
:
"
POST
"
,
headers
:
{
"
Content-Type
"
:
"
application/json
"
,
},
body
:
JSON
.
stringify
({
name
:
this
.
name
,
email
:
this
.
email
,
password
:
this
.
password
,
confirm_password
:
this
.
confirm_password
,
}),
});
this
.
$router
.
push
(
"
/
"
);
data
:
()
=>
{
return
{
name
:
""
,
email
:
""
,
password
:
""
,
confirm_password
:
""
,
};
},
methods
:
{
signin
()
{
fetch
(
"
http://127.0.0.1:8000/api/register
"
,
{
method
:
"
POST
"
,
headers
:
{
"
Content-Type
"
:
"
application/json
"
,
},
body
:
JSON
.
stringify
({
name
:
this
.
name
,
email
:
this
.
email
,
password
:
this
.
password
,
confirm_password
:
this
.
confirm_password
,
}),
});
this
.
$router
.
push
(
"
/
"
);
},
};
},
};
</
script
>
<
style
scoped
>
#form-logout
{
height
:
60%
;
width
:
30%
;
/* border: 1px solid black; */
padding
:
12px
;
padding-top
:
30px
;
display
:
flex
;
justify-content
:
center
;
background-color
:
white
;
border-radius
:
3%
;
font-weight
:
600
;
height
:
60%
;
width
:
30%
;
/* border: 1px solid black; */
padding
:
12px
;
padding-top
:
30px
;
display
:
flex
;
justify-content
:
center
;
background-color
:
white
;
border-radius
:
3%
;
font-weight
:
600
;
}
.btn
{
align-items
:
center
;
justify-content
:
center
;
margin-left
:
50px
;
align-items
:
center
;
justify-content
:
center
;
margin-left
:
50px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment