Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend-MECRED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MECRED
Frontend-MECRED
Commits
ddc2a922
Project 'c3sl/c3docs/devops' was moved to 'root/devops-docs'. Please update any links and bookmarks that may still have the old path.
Commit
ddc2a922
authored
10 months ago
by
Richard Fernando Heise Ferreira
Browse files
Options
Downloads
Patches
Plain Diff
testando code
parent
ff9b9a96
No related branches found
No related tags found
No related merge requests found
Pipeline
#38658
passed
10 months ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/govbr/page.js
+15
-3
15 additions, 3 deletions
src/app/govbr/page.js
with
15 additions
and
3 deletions
src/app/govbr/page.js
+
15
−
3
View file @
ddc2a922
...
...
@@ -16,24 +16,36 @@ export default function Govbr() {
}
useEffect
(()
=>
{
let
code
;
const
validateState
=
()
=>
{
if
(
!
localStorage
.
getItem
(
"
govbr_state
"
,
state
))
{
if
(
!
searchParams
.
get
(
"
govbr_code
"
))
{
console
.
error
(
"
local storage não possui code.
"
)
return
}
code
=
searchParams
.
getItem
(
"
govbr_code
"
);
console
.
log
(
code
)
if
(
!
localStorage
.
getItem
(
"
govbr_state
"
))
{
console
.
error
(
"
local storage não possui state anterior.
"
)
return
}
const
prev_state
=
localStorage
.
getItem
(
"
govbr_state
"
,
state
);
const
prev_state
=
localStorage
.
getItem
(
"
govbr_state
"
);
if
(
!
searchParams
.
get
(
"
state
"
))
{
console
.
error
(
"
Não existe state na URL.
"
)
return
}
const
state
=
searchParams
.
get
(
"
state
"
);
if
(
!
prev_state
||
!
state
)
{
console
.
error
(
"
State não encontrado!
\n
prev_state:
"
,
prev_state
,
"
\n
state:
"
,
state
);
return
}
if
(
prev_state
!==
state
)
{
console
.
error
(
"
States diferentes! Abortando.
\n
prev_state:
"
,
prev_state
,
"
\n
state:
"
,
state
);
return
}
console
.
log
(
"
State validado com sucesso!
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment