Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 38
21_22-J 38
Commits
2254ba58
Commit
2254ba58
authored
Apr 29, 2022
by
Lihinikaduwa D.N.R.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logout Done
parent
e920b62a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
8 deletions
+25
-8
API/app.py
API/app.py
+15
-2
API/model/__pycache__/userModel.cpython-39.pyc
API/model/__pycache__/userModel.cpython-39.pyc
+0
-0
API/model/userModel.py
API/model/userModel.py
+6
-2
frontend/src/screen/reading/advanced/ReadActivityBird.js
frontend/src/screen/reading/advanced/ReadActivityBird.js
+4
-4
No files found.
API/app.py
View file @
2254ba58
...
...
@@ -4,7 +4,7 @@ import random
import
os
from
API.model.colorModel
import
get_color_activities1
,
get_color_activities2
,
get_color_activity_result
from
API.model.readModel
import
get_reading_activities
,
save_activity_details
,
save_session_details
from
API.model.userModel
import
getUser
,
saveUserSession
from
API.model.userModel
import
getUser
,
saveUserSession
,
logoutUser
from
API.model.colorModel
import
get_color_activities1
,
get_color_activities2
,
get_color_activity_result
,
storeResult
from
API.model.readModel
import
get_reading_activities
from
API.routers.router
import
funtion_one
...
...
@@ -123,7 +123,7 @@ def store():
# Read Function Route (IT)
# Login
g
# Login
@
app
.
route
(
"/login"
,
methods
=
[
'POST'
])
def
login
():
req
=
request
.
get_json
()
...
...
@@ -151,6 +151,19 @@ def login():
return
make_response
(
body
)
@
app
.
route
(
"/logout"
,
methods
=
[
'POST'
])
def
logout
():
req
=
request
.
get_json
()
token
=
req
[
'token'
]
if
(
logoutUser
(
token
)
==
1
):
data
=
{
"message"
:
"Success"
,
"status"
:
200
}
body
=
jsonify
(
data
)
return
make_response
(
body
)
@
app
.
route
(
"/readingSession"
,
methods
=
[
'POST'
])
def
reading_session
():
req
=
request
.
get_json
()
...
...
API/model/__pycache__/userModel.cpython-39.pyc
View file @
2254ba58
No preview for this file type
API/model/userModel.py
View file @
2254ba58
from
API.db.dbConnection
import
get_data
from
API.db.dbConnection
import
insert
from
API.db.dbConnection
import
insert
,
update_data
,
get_data
from
API.util.util
import
getUUID
from
datetime
import
datetime
...
...
@@ -18,3 +17,8 @@ def saveUserSession(userId):
args
=
(
userId
,
token
,
loginTime
,
1
)
insert
(
qry
,
args
)
return
token
def
logoutUser
(
token
):
qry
=
'UPDATE userSession SET status = 0 WHERE token = "{}"'
.
format
(
token
)
return
update_data
(
qry
)
frontend/src/screen/reading/advanced/ReadActivityBird.js
View file @
2254ba58
...
...
@@ -26,10 +26,10 @@ export default function ReadActivityBird() {
const
[
readingData
,
setReadingData
]
=
useState
({
activity
:
''
});
const
readToken
=
AsyncStorage
.
getItem
(
'
readingSession
'
);
useEffect
(()
=>
{
if
(
Authorize
)
{
}
},
[]);
//
useEffect(() => {
//
if (Authorize) {
//
}
//
}, []);
useEffect
(()
=>
{
Voice
.
onSpeechStart
=
onSpeechStartHandler
;
...
...
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