Commit ad371491 authored by wty's avatar wty

修复问题

parent af5ef5fc
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<excludeFolder url="file://$MODULE_DIR$/.idea/inspectionProfiles" /> <excludeFolder url="file://$MODULE_DIR$/.idea/inspectionProfiles" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" /> <excludeFolder url="file://$MODULE_DIR$/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/server/node_modules" /> <excludeFolder url="file://$MODULE_DIR$/server/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/server/staticFile/build" />
</content> </content>
<content url="file://$MODULE_DIR$/node_modules" /> <content url="file://$MODULE_DIR$/node_modules" />
<content url="file://$MODULE_DIR$/server/node_modules" /> <content url="file://$MODULE_DIR$/server/node_modules" />
......
...@@ -51,11 +51,7 @@ app.use((req, res, next) => { ...@@ -51,11 +51,7 @@ app.use((req, res, next) => {
const url = req.url const url = req.url
const header = { const header = {
// 'Access-Control-Allow-Credentials': true, 'Content-Type': ''
// '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'
} }
if (url.includes('static')){ if (url.includes('static')){
......
...@@ -52,7 +52,7 @@ getMysql.then(Mysql => { ...@@ -52,7 +52,7 @@ getMysql.then(Mysql => {
router.get('/publicPage', (req, res) => { 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 {page_id} = req.query
const SQL = 'SELECT * FROM page WHERE page_id = ?' const SQL = 'SELECT * FROM page WHERE page_id = ?'
Mysql.query(SQL, [page_id], (err, result) => { Mysql.query(SQL, [page_id], (err, result) => {
......
...@@ -46,6 +46,12 @@ getMysql.then(Mysql => { ...@@ -46,6 +46,12 @@ getMysql.then(Mysql => {
} }
if (isFollow) { if (isFollow) {
type_id = JSON.parse(type_id) type_id = JSON.parse(type_id)
if (!type_id?.length){
res.send({
success: true,
data: []
})
}
SQL = 'SELECT * FROM toolbox WHERE toolbox_id IN (?)' SQL = 'SELECT * FROM toolbox WHERE toolbox_id IN (?)'
} }
Mysql.query(SQL, [type_id], (err, result) => { Mysql.query(SQL, [type_id], (err, result) => {
......
...@@ -10,7 +10,7 @@ function Login(props) { ...@@ -10,7 +10,7 @@ function Login(props) {
const [needLogin,setNeedLogin] = useState(false) const [needLogin,setNeedLogin] = useState(false)
const [input, setInput] = useFormState() const [input, setInput] = useFormState()
const getUser = ()=>{ const getUser = ()=>{
fetchData('/users/getUser', {uid:'100001'}, 'userInfo') fetchData('/users/getUser', {}, 'userInfo')
.then(res => res.data.uid && (history.push('/'))) .then(res => res.data.uid && (history.push('/')))
.catch(res => .catch(res =>
res.code === 70001 && setNeedLogin(true) res.code === 70001 && setNeedLogin(true)
...@@ -18,7 +18,7 @@ function Login(props) { ...@@ -18,7 +18,7 @@ function Login(props) {
} }
const doLogin = () => { const doLogin = () => {
if (needLogin){ if (needLogin){
fetchData('/users/login',{uid: '100001'}) fetchData('/users/login',{uid: input})
.then(()=>{ .then(()=>{
getUser() getUser()
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment