Commit ad371491 authored by wty's avatar wty

修复问题

parent af5ef5fc
......@@ -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" />
......
......@@ -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')){
......
......@@ -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) => {
......
......@@ -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) => {
......
......@@ -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()
})
......
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