Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Dui123
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
王天宇
Dui123
Commits
ad371491
Commit
ad371491
authored
Oct 27, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复问题
parent
af5ef5fc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
8 deletions
+11
-8
dui123.iml
.idea/dui123.iml
+1
-0
app.js
server/app.js
+1
-5
page.js
server/routes/page.js
+1
-1
query.js
server/routes/query.js
+6
-0
login.jsx
src/page/login/login.jsx
+2
-2
No files found.
.idea/dui123.iml
View file @
ad371491
...
...
@@ -10,6 +10,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/.idea/inspectionProfiles"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/node_modules"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/server/node_modules"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/server/staticFile/build"
/>
</content>
<content
url=
"file://$MODULE_DIR$/node_modules"
/>
<content
url=
"file://$MODULE_DIR$/server/node_modules"
/>
...
...
server/app.js
View file @
ad371491
...
...
@@ -51,11 +51,7 @@ app.use((req, res, next) => {
const
url
=
req
.
url
const
header
=
{
// 'Access-Control-Allow-Credentials': true,
// 'Access-Control-Allow-Origin': req.headers.origin || '*',
// 'Access-Control-Allow-Headers': 'X-Requested-With,Content-Type',
// 'Access-Control-Allow-Methods': 'PUT,POST,GET,DEconstE,OPTIONS',
'Content-Type'
:
'application/json; charset=utf-8'
'Content-Type'
:
''
}
if
(
url
.
includes
(
'static'
)){
...
...
server/routes/page.js
View file @
ad371491
...
...
@@ -52,7 +52,7 @@ getMysql.then(Mysql => {
router
.
get
(
'/publicPage'
,
(
req
,
res
)
=>
{
res
.
set
({
'Content-Type'
:
'
application/json
; charset=utf-8'
})
res
.
set
({
'Content-Type'
:
'
text/html
; charset=utf-8'
})
const
{
page_id
}
=
req
.
query
const
SQL
=
'SELECT * FROM page WHERE page_id = ?'
Mysql
.
query
(
SQL
,
[
page_id
],
(
err
,
result
)
=>
{
...
...
server/routes/query.js
View file @
ad371491
...
...
@@ -46,6 +46,12 @@ getMysql.then(Mysql => {
}
if
(
isFollow
)
{
type_id
=
JSON
.
parse
(
type_id
)
if
(
!
type_id
?.
length
){
res
.
send
({
success
:
true
,
data
:
[]
})
}
SQL
=
'SELECT * FROM toolbox WHERE toolbox_id IN (?)'
}
Mysql
.
query
(
SQL
,
[
type_id
],
(
err
,
result
)
=>
{
...
...
src/page/login/login.jsx
View file @
ad371491
...
...
@@ -10,7 +10,7 @@ function Login(props) {
const
[
needLogin
,
setNeedLogin
]
=
useState
(
false
)
const
[
input
,
setInput
]
=
useFormState
()
const
getUser
=
()
=>
{
fetchData
(
'/users/getUser'
,
{
uid
:
'100001'
},
'userInfo'
)
fetchData
(
'/users/getUser'
,
{},
'userInfo'
)
.
then
(
res
=>
res
.
data
.
uid
&&
(
history
.
push
(
'/'
)))
.
catch
(
res
=>
res
.
code
===
70001
&&
setNeedLogin
(
true
)
...
...
@@ -18,7 +18,7 @@ function Login(props) {
}
const
doLogin
=
()
=>
{
if
(
needLogin
){
fetchData
(
'/users/login'
,{
uid
:
'100001'
})
fetchData
(
'/users/login'
,{
uid
:
input
})
.
then
(()
=>
{
getUser
()
})
...
...
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