Commit ab684289 authored by wty's avatar wty

上线test7

parent 26f35cf4
{
"files": {
"main.css": "/static/css/main.75503a0b.chunk.css",
"main.js": "/static/js/main.00574c75.chunk.js",
"main.js.map": "/static/js/main.00574c75.chunk.js.map",
"main.js": "/static/js/main.0b902ee5.chunk.js",
"main.js.map": "/static/js/main.0b902ee5.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.4628cb4f.js",
"runtime-main.js.map": "/static/js/runtime-main.4628cb4f.js.map",
"static/css/2.1f1ea42e.chunk.css": "/static/css/2.1f1ea42e.chunk.css",
......@@ -24,6 +24,6 @@
"static/css/2.1f1ea42e.chunk.css",
"static/js/2.7ec9913b.chunk.js",
"static/css/main.75503a0b.chunk.css",
"static/js/main.00574c75.chunk.js"
"static/js/main.0b902ee5.chunk.js"
]
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" type="image/x-icon" href="https://yun.duiba.com.cn/logo.png"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Dui123工具箱-你的第一个工具箱何必是一个工具箱</title><link href="/static/css/2.1f1ea42e.chunk.css" rel="stylesheet"><link href="/static/css/main.75503a0b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"4971491c"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpdui123=this.webpackJsonpdui123||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.7ec9913b.chunk.js"></script><script src="/static/js/main.00574c75.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" type="image/x-icon" href="https://yun.duiba.com.cn/logo.png"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Dui123工具箱-你的第一个工具箱何必是一个工具箱</title><link href="/static/css/2.1f1ea42e.chunk.css" rel="stylesheet"><link href="/static/css/main.75503a0b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"4971491c"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpdui123=this.webpackJsonpdui123||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.7ec9913b.chunk.js"></script><script src="/static/js/main.0b902ee5.chunk.js"></script></body></html>
\ No newline at end of file
const getMySql = require('../SQLPool')
const query = (SQL,params) => new Promise(async (resolve, reject) => {
const Mysql = await getMySql
Mysql.query(SQL, params, (err, result) => {
if (err) {
reject(err)
}
resolve(result)
})
})
module.exports = query
......@@ -2,48 +2,53 @@ const express = require('express')
const request = require("request");
const getMysql = require('../SQLPool')
const router = express.Router()
const query = require('../lib/query')
getMysql.then(Mysql => {
router.get('/addToolBox', (req, res) => {
const {toolbox_name, toolbox_icon, toolbox_desc, toolbox_url, type_id, child_type_id} = req.query
const SQL = 'INSERT INTO toolbox (toolbox_name, toolbox_icon, toolbox_desc, toolbox_url,sort_id) VALUES (?,?,?,?,?)'
Mysql.query(SQL, [toolbox_name, toolbox_desc, toolbox_icon, toolbox_url, 0], (err, result) => {
if (err) {
res.send({
success: false,
err
})
return
}
request(domain + '/query/queryToolBox', {}, (error, response, body) => {
if (error) {
console.error(error)
res.send({success: false,err : error})
return
}
console.log(domain + '/query/queryToolBox')
console.log('body:', body)
const data = JSON.parse(body).data
const lastToolBoxId = data[data.length - 1].toolbox_id
const SQL = 'INSERT INTO type_childtype_toolbox (toolbox_id,type_id,child_type_id) VALUES (?,?,?)'
const params = [lastToolBoxId, type_id]
if (typeof child_type_id !== 'number') params.push(null)
else params.push(child_type_id)
Mysql.query(SQL, params, (err, result) => {
if (err) {
res.send({
success: false,
err
})
return
}
res.send({
success: true
})
})
})
})
})
// router.get('/addToolBox', async (req, res) => {
// const {toolbox_name, toolbox_icon, toolbox_desc, toolbox_url, type_id, child_type_id} = req.query
// const SQL1 = 'INSERT INTO toolbox (toolbox_name, toolbox_icon, toolbox_desc, toolbox_url,sort_id) VALUES (?,?,?,?,?)'
// const SQL2 = 'INSERT INTO type_childtype_toolbox (toolbox_id,type_id,child_type_id) VALUES (?,?,?)'
// const SQL3 = 'SELECT * FROM toolbox'
// const addToolBox = await query(SQL1, [toolbox_name, toolbox_desc, toolbox_icon, toolbox_url, 0])
// const queryToolBox = await query(SQL3)
// const addRelation = await query(SQL2, [])
// Mysql.query(SQL, , (err, result) => {
// if (err) {
// res.send({
// success: false,
// err
// })
// return
// }
// request(domain + '/query/queryToolBox', {}, (error, response, body) => {
// if (error) {
// console.error(error)
// res.send({success: false,err : error})
// return
// }
// console.log(domain + '/query/queryToolBox')
// console.log('body:', body)
// const data = JSON.parse(body).data
// const lastToolBoxId = data[data.length - 1].toolbox_id
//
// const params = [lastToolBoxId, type_id]
// if (typeof child_type_id !== 'number') params.push(null)
// else params.push(child_type_id)
// Mysql.query(SQL, params, (err, result) => {
// if (err) {
// res.send({
// success: false,
// err
// })
// return
// }
// res.send({
// success: true
// })
// })
// })
// })
// })
router.get('/addType', (req, res) => {
const {type_name, child_type_name, type_id} = req.query
......
const express = require('express')
const request = require("request");
const query = require('../lib/query')
const getMysql = require('../SQLPool')
const router = express.Router()
getMysql.then(Mysql => {
......@@ -40,22 +41,8 @@ getMysql.then(Mysql => {
router.get('/queryTypeForManage', async (req, res) => {
const SQL1 = 'SELECT * FROM type'
const SQL2 = 'SELECT * FROM child_type'
const query = (SQL) => new Promise((resolve, reject) => {
Mysql.query(SQL, [], (err, result) => {
if (err) {
res.send({
success: false,
err: err
})
reject(err)
}
resolve(result)
})
})
const queryType = query(SQL1)
const queryChildType = query(SQL2)
const typeArr = await queryType
const childTypeArr = await queryChildType
const typeArr = await query(SQL1)
const childTypeArr = await query(SQL2)
const data = typeArr.map(v =>({...v, children: childTypeArr.filter(_v => _v.type_id === v.type_id)}))
res.send({
success: true,
......
{
"files": {
"main.css": "/static/css/main.75503a0b.chunk.css",
"main.js": "/static/js/main.00574c75.chunk.js",
"main.js.map": "/static/js/main.00574c75.chunk.js.map",
"main.js": "/static/js/main.0b902ee5.chunk.js",
"main.js.map": "/static/js/main.0b902ee5.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.4628cb4f.js",
"runtime-main.js.map": "/static/js/runtime-main.4628cb4f.js.map",
"static/css/2.1f1ea42e.chunk.css": "/static/css/2.1f1ea42e.chunk.css",
......@@ -24,6 +24,6 @@
"static/css/2.1f1ea42e.chunk.css",
"static/js/2.7ec9913b.chunk.js",
"static/css/main.75503a0b.chunk.css",
"static/js/main.00574c75.chunk.js"
"static/js/main.0b902ee5.chunk.js"
]
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" type="image/x-icon" href="https://yun.duiba.com.cn/logo.png"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Dui123工具箱-你的第一个工具箱何必是一个工具箱</title><link href="/static/css/2.1f1ea42e.chunk.css" rel="stylesheet"><link href="/static/css/main.75503a0b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"4971491c"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpdui123=this.webpackJsonpdui123||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.7ec9913b.chunk.js"></script><script src="/static/js/main.00574c75.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" type="image/x-icon" href="https://yun.duiba.com.cn/logo.png"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><title>Dui123工具箱-你的第一个工具箱何必是一个工具箱</title><link href="/static/css/2.1f1ea42e.chunk.css" rel="stylesheet"><link href="/static/css/main.75503a0b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"4971491c"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpdui123=this.webpackJsonpdui123||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="/static/js/2.7ec9913b.chunk.js"></script><script src="/static/js/main.0b902ee5.chunk.js"></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -29,8 +29,8 @@ function DataCenter(props) {
const fetchData = (path, requestData, dataName) =>
fetch(generateUrl(path, requestData), {credentials: 'include'})
// .then(res => res.json())
.then(res => res.text())
.then(res => res.json())
// .then(res => res.text())
.then(res => {
console.log('res:',res);
if (res.success) {
......
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