Commit 8922365d authored by wty's avatar wty

项目初步

parents
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/expressServer/node_modules/
/expressServer/.idea/
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/expressServer/.idea" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/dui123.iml" filepath="$PROJECT_DIR$/.idea/dui123.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
</project>
\ No newline at end of file
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `yarn build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const databaseRouter = require('./routes/dataBase/dataBase')
const app = express();
// app.all('', function (req, res, next) {
// res.header('Access-Control-Allow-Origin', 'http://127.0.0.1:3000');
// res.header('Access-Control-Allow-Headers', 'Content-Type');
// res.header('Access-Control-Allow-Methods', '*');
// res.header('Access-Control-Allow-Credentials','true')
// res.header('Content-Type', 'application/json;charset=utf-8');
// next();
// });
app.use((req, res, next) => {
//设置请求头
res.set({
'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'
})
req.method === 'OPTIONS' ? res.status(204).end() : next()
})
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/database', databaseRouter)
module.exports = app;
#!/usr/bin/env node
/**
* Module dependencies.
*/
let app = require('../app');
let debug = require('debug')('expressserver:server');
let http = require('http');
/**
* Get port from environment and store in Express.
*/
let port = normalizePort(process.env.PORT || '3001');
app.set('port', port);
/**
* Create HTTP server.
*/
let server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
let port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
let bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
let addr = server.address();
let bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
{
"name": "expressserver",
"version": "0.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"accepts": {
"version": "1.3.7",
"resolved": "http://npm.dui88.com:80/accepts/-/accepts-1.3.7.tgz",
"integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "http://npm.dui88.com:80/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"basic-auth": {
"version": "2.0.1",
"resolved": "http://npm.dui88.com:80/basic-auth/-/basic-auth-2.0.1.tgz",
"integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=",
"requires": {
"safe-buffer": "5.1.2"
}
},
"body-parser": {
"version": "1.18.3",
"resolved": "http://npm.dui88.com:80/body-parser/-/body-parser-1.18.3.tgz",
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "~1.6.3",
"iconv-lite": "0.4.23",
"on-finished": "~2.3.0",
"qs": "6.5.2",
"raw-body": "2.3.3",
"type-is": "~1.6.16"
}
},
"bytes": {
"version": "3.0.0",
"resolved": "http://npm.dui88.com:80/bytes/-/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"content-disposition": {
"version": "0.5.2",
"resolved": "http://npm.dui88.com:80/content-disposition/-/content-disposition-0.5.2.tgz",
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
},
"content-type": {
"version": "1.0.4",
"resolved": "http://npm.dui88.com:80/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js="
},
"cookie": {
"version": "0.4.0",
"resolved": "http://npm.dui88.com:80/cookie/-/cookie-0.4.0.tgz",
"integrity": "sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo="
},
"cookie-parser": {
"version": "1.4.5",
"resolved": "http://npm.dui88.com:80/cookie-parser/-/cookie-parser-1.4.5.tgz",
"integrity": "sha1-PlctS3wMgPnGHa9gTkM2gxtdHUk=",
"requires": {
"cookie": "0.4.0",
"cookie-signature": "1.0.6"
}
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "http://npm.dui88.com:80/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"debug": {
"version": "2.6.9",
"resolved": "http://npm.dui88.com:80/debug/-/debug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"resolved": "http://npm.dui88.com:80/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "http://npm.dui88.com:80/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"ee-first": {
"version": "1.1.1",
"resolved": "http://npm.dui88.com:80/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "http://npm.dui88.com:80/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"escape-html": {
"version": "1.0.3",
"resolved": "http://npm.dui88.com:80/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"etag": {
"version": "1.8.1",
"resolved": "http://npm.dui88.com:80/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.16.4",
"resolved": "http://npm.dui88.com:80/express/-/express-4.16.4.tgz",
"integrity": "sha1-/d72GSYQniTFFeqX/S8b2/Yt8S4=",
"requires": {
"accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.3",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.4",
"qs": "6.5.2",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.2",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"cookie": {
"version": "0.3.1",
"resolved": "http://npm.dui88.com:80/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
}
}
},
"finalhandler": {
"version": "1.1.1",
"resolved": "http://npm.dui88.com:80/finalhandler/-/finalhandler-1.1.1.tgz",
"integrity": "sha1-7r9O2EAHnIP0JJA4ydcDAIMBsQU=",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
}
},
"forwarded": {
"version": "0.2.0",
"resolved": "http://npm.dui88.com:80/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha1-ImmTZCiq1MFcfr6XeahL8LKoGBE="
},
"fresh": {
"version": "0.5.2",
"resolved": "http://npm.dui88.com:80/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"http-errors": {
"version": "1.6.3",
"resolved": "http://npm.dui88.com:80/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
}
},
"iconv-lite": {
"version": "0.4.23",
"resolved": "http://npm.dui88.com:80/iconv-lite/-/iconv-lite-0.4.23.tgz",
"integrity": "sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "http://npm.dui88.com:80/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "http://npm.dui88.com:80/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM="
},
"media-typer": {
"version": "0.3.0",
"resolved": "http://npm.dui88.com:80/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "http://npm.dui88.com:80/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "http://npm.dui88.com:80/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.4.1",
"resolved": "http://npm.dui88.com:80/mime/-/mime-1.4.1.tgz",
"integrity": "sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY="
},
"mime-db": {
"version": "1.49.0",
"resolved": "http://npm.dui88.com:80/mime-db/-/mime-db-1.49.0.tgz",
"integrity": "sha1-89/eYMmenPO8lwHWh3ePU3ABy+0="
},
"mime-types": {
"version": "2.1.32",
"resolved": "http://npm.dui88.com:80/mime-types/-/mime-types-2.1.32.tgz",
"integrity": "sha1-HQDonn3n/gIAjbYQAdngKFJnD9U=",
"requires": {
"mime-db": "1.49.0"
}
},
"morgan": {
"version": "1.9.1",
"resolved": "http://npm.dui88.com:80/morgan/-/morgan-1.9.1.tgz",
"integrity": "sha1-Co0Wc0odmvvIJLmd+H5zjlji2lk=",
"requires": {
"basic-auth": "~2.0.0",
"debug": "2.6.9",
"depd": "~1.1.2",
"on-finished": "~2.3.0",
"on-headers": "~1.0.1"
}
},
"ms": {
"version": "2.0.0",
"resolved": "http://npm.dui88.com:80/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.2",
"resolved": "http://npm.dui88.com:80/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs="
},
"on-finished": {
"version": "2.3.0",
"resolved": "http://npm.dui88.com:80/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"on-headers": {
"version": "1.0.2",
"resolved": "http://npm.dui88.com:80/on-headers/-/on-headers-1.0.2.tgz",
"integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8="
},
"parseurl": {
"version": "1.3.3",
"resolved": "http://npm.dui88.com:80/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "http://npm.dui88.com:80/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"proxy-addr": {
"version": "2.0.7",
"resolved": "http://npm.dui88.com:80/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=",
"requires": {
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
}
},
"qs": {
"version": "6.5.2",
"resolved": "http://npm.dui88.com:80/qs/-/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY="
},
"range-parser": {
"version": "1.2.1",
"resolved": "http://npm.dui88.com:80/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE="
},
"raw-body": {
"version": "2.3.3",
"resolved": "http://npm.dui88.com:80/raw-body/-/raw-body-2.3.3.tgz",
"integrity": "sha1-GzJOzmtXBuFThVvBFIxlu39uoMM=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.23",
"unpipe": "1.0.0"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "http://npm.dui88.com:80/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "http://npm.dui88.com:80/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
},
"send": {
"version": "0.16.2",
"resolved": "http://npm.dui88.com:80/send/-/send-0.16.2.tgz",
"integrity": "sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
}
},
"serve-static": {
"version": "1.13.2",
"resolved": "http://npm.dui88.com:80/serve-static/-/serve-static-1.13.2.tgz",
"integrity": "sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.2"
}
},
"setprototypeof": {
"version": "1.1.0",
"resolved": "http://npm.dui88.com:80/setprototypeof/-/setprototypeof-1.1.0.tgz",
"integrity": "sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY="
},
"statuses": {
"version": "1.4.0",
"resolved": "http://npm.dui88.com:80/statuses/-/statuses-1.4.0.tgz",
"integrity": "sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic="
},
"type-is": {
"version": "1.6.18",
"resolved": "http://npm.dui88.com:80/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "http://npm.dui88.com:80/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "http://npm.dui88.com:80/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"vary": {
"version": "1.1.2",
"resolved": "http://npm.dui88.com:80/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
}
}
}
{
"name": "expressserver",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "nodemon ./bin/www"
},
"dependencies": {
"@types/express": "^4.17.13",
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"morgan": "~1.9.1",
"nodemon": "^2.0.12"
}
}
<html>
<head>
<title>Express</title>
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<h1>Express</h1>
<p>Welcome to Express</p>
</body>
</html>
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
a {
color: #00B7FF;
}
const express = require('express')
const fs = require('fs')
const path = require('path')
const toolBox = path.join(__dirname, './toolBox.json')
const router = express.Router()
const add = (addData) => {
fs.readFile(toolBox, (err, data) => {
if (err) {
console.error(err)
return err
}
const _data = JSON.parse(data.toString())
_data.type.push(addData)
fs.writeFile(toolBox, JSON.stringify(_data), (err) => {
if (err) {
console.error(err)
return err
}
console.log('数据添加成功')
})
})
}
const test = () => {
const data = fs.readFileSync(toolBox, {encoding: 'utf-8'})
return JSON.parse(data)
}
router.get('/', (req, res) => {
const data = test().type
if (data){
res.send({
success: true,
message: 'ok',
data: data
})
}else {
res.send({
success: false,
message: '查询接口日志',
data: data
})
}
})
router.get('/addType', (req, res) => {
res.send({data: 'add'})
})
module.exports = router
{
"type": [
{
"id": 1,
"typeName": "我的"
}
]
}
let express = require('express');
let router = express.Router();
/* GET home page. */
router.get('/', function(req, res) {
res.send('cool~')
});
module.exports = router;
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send({
success: true,
data: 'good luck'
});
});
module.exports = router;
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@sindresorhus/is@^0.14.0":
version "0.14.0"
resolved "http://npm.dui88.com:80/@sindresorhus%2fis/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
integrity sha1-n7OjzzEyMoFR81PeRjLgHlIQK+o=
"@szmarczak/http-timer@^1.1.2":
version "1.1.2"
resolved "http://npm.dui88.com:80/@szmarczak%2fhttp-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
integrity sha1-sWZeLEYaLNkvTBu/UNVFTeDUtCE=
dependencies:
defer-to-connect "^1.0.1"
"@types/body-parser@*":
version "1.19.1"
resolved "http://npm.dui88.com:80/@types%2fbody-parser/-/body-parser-1.19.1.tgz#0c0174c42a7d017b818303d4b5d969cb0b75929c"
integrity sha1-DAF0xCp9AXuBgwPUtdlpywt1kpw=
dependencies:
"@types/connect" "*"
"@types/node" "*"
"@types/connect@*":
version "3.4.35"
resolved "http://npm.dui88.com:80/@types%2fconnect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1"
integrity sha1-X89q5EXkAh0fwiGaSHPMc6O7KtE=
dependencies:
"@types/node" "*"
"@types/express-serve-static-core@^4.17.18":
version "4.17.24"
resolved "http://npm.dui88.com:80/@types%2fexpress-serve-static-core/-/express-serve-static-core-4.17.24.tgz#ea41f93bf7e0d59cd5a76665068ed6aab6815c07"
integrity sha1-6kH5O/fg1ZzVp2ZlBo7WqraBXAc=
dependencies:
"@types/node" "*"
"@types/qs" "*"
"@types/range-parser" "*"
"@types/express@^4.17.13":
version "4.17.13"
resolved "http://npm.dui88.com:80/@types%2fexpress/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034"
integrity sha1-p24plXKJmbq1GjP6vOHXBaNwkDQ=
dependencies:
"@types/body-parser" "*"
"@types/express-serve-static-core" "^4.17.18"
"@types/qs" "*"
"@types/serve-static" "*"
"@types/mime@^1":
version "1.3.2"
resolved "http://npm.dui88.com:80/@types%2fmime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
integrity sha1-k+Jb+e51/g/YC1lLxP6w6GIRG1o=
"@types/node@*":
version "16.7.1"
resolved "http://npm.dui88.com:80/@types%2fnode/-/node-16.7.1.tgz#c6b9198178da504dfca1fd0be9b2e1002f1586f0"
integrity sha1-xrkZgXjaUE38of0L6bLhAC8VhvA=
"@types/qs@*":
version "6.9.7"
resolved "http://npm.dui88.com:80/@types%2fqs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
integrity sha1-Y7t9Bn2xB8weRXwwO8JdUR/r9ss=
"@types/range-parser@*":
version "1.2.4"
resolved "http://npm.dui88.com:80/@types%2frange-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc"
integrity sha1-zWZ7z90CUhOq+3ylkVqTJZCs3Nw=
"@types/serve-static@*":
version "1.13.10"
resolved "http://npm.dui88.com:80/@types%2fserve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9"
integrity sha1-9eDOh5fS18xevtpIpSyWxPpHqNk=
dependencies:
"@types/mime" "^1"
"@types/node" "*"
abbrev@1:
version "1.1.1"
resolved "http://npm.dui88.com:80/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
integrity sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=
accepts@~1.3.5:
version "1.3.7"
resolved "http://npm.dui88.com:80/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
integrity sha1-UxvHJlF6OytB+FACHGzBXqq1B80=
dependencies:
mime-types "~2.1.24"
negotiator "0.6.2"
ansi-align@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb"
integrity sha1-tTazcc9ofKrvI2wY0+If43l0Z8s=
dependencies:
string-width "^3.0.0"
ansi-regex@^4.1.0:
version "4.1.0"
resolved "http://npm.dui88.com:80/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
integrity sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=
ansi-regex@^5.0.0:
version "5.0.0"
resolved "http://npm.dui88.com:80/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
integrity sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=
ansi-styles@^4.1.0:
version "4.3.0"
resolved "http://npm.dui88.com:80/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha1-7dgDYornHATIWuegkG7a00tkiTc=
dependencies:
color-convert "^2.0.1"
anymatch@~3.1.2:
version "3.1.2"
resolved "http://npm.dui88.com:80/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
integrity sha1-wFV8CWrzLxBhmPT04qODU343hxY=
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"
array-flatten@1.1.1:
version "1.1.1"
resolved "http://npm.dui88.com:80/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
balanced-match@^1.0.0:
version "1.0.2"
resolved "http://npm.dui88.com:80/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha1-6D46fj8wCzTLnYf2FfoMvzV2kO4=
basic-auth@~2.0.0:
version "2.0.1"
resolved "http://npm.dui88.com:80/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a"
integrity sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=
dependencies:
safe-buffer "5.1.2"
binary-extensions@^2.0.0:
version "2.2.0"
resolved "http://npm.dui88.com:80/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha1-dfUC7q+f/eQvyYgpZFvk6na9ni0=
body-parser@1.18.3:
version "1.18.3"
resolved "http://npm.dui88.com:80/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4"
integrity sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=
dependencies:
bytes "3.0.0"
content-type "~1.0.4"
debug "2.6.9"
depd "~1.1.2"
http-errors "~1.6.3"
iconv-lite "0.4.23"
on-finished "~2.3.0"
qs "6.5.2"
raw-body "2.3.3"
type-is "~1.6.16"
boxen@^4.2.0:
version "4.2.0"
resolved "http://npm.dui88.com:80/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64"
integrity sha1-5BG2I1fW1tNlh8isPV2XTaoHDmQ=
dependencies:
ansi-align "^3.0.0"
camelcase "^5.3.1"
chalk "^3.0.0"
cli-boxes "^2.2.0"
string-width "^4.1.0"
term-size "^2.1.0"
type-fest "^0.8.1"
widest-line "^3.1.0"
brace-expansion@^1.1.7:
version "1.1.11"
resolved "http://npm.dui88.com:80/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
integrity sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
braces@~3.0.2:
version "3.0.2"
resolved "http://npm.dui88.com:80/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha1-NFThpGLujVmeI23zNs2epPiv4Qc=
dependencies:
fill-range "^7.0.1"
bytes@3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=
cacheable-request@^6.0.0:
version "6.1.0"
resolved "http://npm.dui88.com:80/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912"
integrity sha1-IP+4vRYrpL4R6VZ9gj22UQUsqRI=
dependencies:
clone-response "^1.0.2"
get-stream "^5.1.0"
http-cache-semantics "^4.0.0"
keyv "^3.0.0"
lowercase-keys "^2.0.0"
normalize-url "^4.1.0"
responselike "^1.0.2"
camelcase@^5.3.1:
version "5.3.1"
resolved "http://npm.dui88.com:80/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=
chalk@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
integrity sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chokidar@^3.2.2:
version "3.5.2"
resolved "http://npm.dui88.com:80/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
integrity sha1-26OXb8rbAW9m/TZQIdkWANAcHnU=
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"
ci-info@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
integrity sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=
cli-boxes@^2.2.0:
version "2.2.1"
resolved "http://npm.dui88.com:80/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f"
integrity sha1-3dUDXSUJT84iDpyrQKRYQKRAMY8=
clone-response@^1.0.2:
version "1.0.2"
resolved "http://npm.dui88.com:80/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=
dependencies:
mimic-response "^1.0.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "http://npm.dui88.com:80/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "http://npm.dui88.com:80/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=
concat-map@0.0.1:
version "0.0.1"
resolved "http://npm.dui88.com:80/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
configstore@^5.0.1:
version "5.0.1"
resolved "http://npm.dui88.com:80/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96"
integrity sha1-02UCG130uYzdGH1qOw4/anzF7ZY=
dependencies:
dot-prop "^5.2.0"
graceful-fs "^4.1.2"
make-dir "^3.0.0"
unique-string "^2.0.0"
write-file-atomic "^3.0.0"
xdg-basedir "^4.0.0"
content-disposition@0.5.2:
version "0.5.2"
resolved "http://npm.dui88.com:80/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ=
content-type@~1.0.4:
version "1.0.4"
resolved "http://npm.dui88.com:80/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
integrity sha1-4TjMdeBAxyexlm/l5fjJruJW/js=
cookie-parser@~1.4.4:
version "1.4.5"
resolved "http://npm.dui88.com:80/cookie-parser/-/cookie-parser-1.4.5.tgz#3e572d4b7c0c80f9c61daf604e4336831b5d1d49"
integrity sha1-PlctS3wMgPnGHa9gTkM2gxtdHUk=
dependencies:
cookie "0.4.0"
cookie-signature "1.0.6"
cookie-signature@1.0.6:
version "1.0.6"
resolved "http://npm.dui88.com:80/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw=
cookie@0.3.1:
version "0.3.1"
resolved "http://npm.dui88.com:80/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=
cookie@0.4.0:
version "0.4.0"
resolved "http://npm.dui88.com:80/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba"
integrity sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo=
crypto-random-string@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
integrity sha1-7yp6lm7BEIM4g2m6oC6+rSKbMNU=
debug@2.6.9, debug@^2.2.0, debug@~2.6.9:
version "2.6.9"
resolved "http://npm.dui88.com:80/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=
dependencies:
ms "2.0.0"
debug@^3.2.6:
version "3.2.7"
resolved "http://npm.dui88.com:80/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
integrity sha1-clgLfpFF+zm2Z2+cXl+xALk0F5o=
dependencies:
ms "^2.1.1"
decompress-response@^3.3.0:
version "3.3.0"
resolved "http://npm.dui88.com:80/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=
dependencies:
mimic-response "^1.0.0"
deep-extend@^0.6.0:
version "0.6.0"
resolved "http://npm.dui88.com:80/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
integrity sha1-xPp8lUBKF6nD6Mp+FTcxK3NjMKw=
defer-to-connect@^1.0.1:
version "1.1.3"
resolved "http://npm.dui88.com:80/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591"
integrity sha1-MxrgUMCNz3ifjIOnuB8O2U9KxZE=
depd@~1.1.2:
version "1.1.2"
resolved "http://npm.dui88.com:80/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
destroy@~1.0.4:
version "1.0.4"
resolved "http://npm.dui88.com:80/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
dot-prop@^5.2.0:
version "5.3.0"
resolved "http://npm.dui88.com:80/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88"
integrity sha1-kMzOcIzZzYLMTcjD3dmr3VWyDog=
dependencies:
is-obj "^2.0.0"
duplexer3@^0.1.4:
version "0.1.4"
resolved "http://npm.dui88.com:80/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
ee-first@1.1.1:
version "1.1.1"
resolved "http://npm.dui88.com:80/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
emoji-regex@^7.0.1:
version "7.0.3"
resolved "http://npm.dui88.com:80/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
integrity sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY=
emoji-regex@^8.0.0:
version "8.0.0"
resolved "http://npm.dui88.com:80/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=
encodeurl@~1.0.2:
version "1.0.2"
resolved "http://npm.dui88.com:80/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
end-of-stream@^1.1.0:
version "1.4.4"
resolved "http://npm.dui88.com:80/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
integrity sha1-WuZKX0UFe682JuwU2gyl5LJDHrA=
dependencies:
once "^1.4.0"
escape-goat@^2.0.0:
version "2.1.1"
resolved "http://npm.dui88.com:80/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675"
integrity sha1-Gy3HcANnbEV+x2Cy3GjttkgYhnU=
escape-html@~1.0.3:
version "1.0.3"
resolved "http://npm.dui88.com:80/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
etag@~1.8.1:
version "1.8.1"
resolved "http://npm.dui88.com:80/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
express@~4.16.1:
version "4.16.4"
resolved "http://npm.dui88.com:80/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e"
integrity sha1-/d72GSYQniTFFeqX/S8b2/Yt8S4=
dependencies:
accepts "~1.3.5"
array-flatten "1.1.1"
body-parser "1.18.3"
content-disposition "0.5.2"
content-type "~1.0.4"
cookie "0.3.1"
cookie-signature "1.0.6"
debug "2.6.9"
depd "~1.1.2"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
finalhandler "1.1.1"
fresh "0.5.2"
merge-descriptors "1.0.1"
methods "~1.1.2"
on-finished "~2.3.0"
parseurl "~1.3.2"
path-to-regexp "0.1.7"
proxy-addr "~2.0.4"
qs "6.5.2"
range-parser "~1.2.0"
safe-buffer "5.1.2"
send "0.16.2"
serve-static "1.13.2"
setprototypeof "1.1.0"
statuses "~1.4.0"
type-is "~1.6.16"
utils-merge "1.0.1"
vary "~1.1.2"
fill-range@^7.0.1:
version "7.0.1"
resolved "http://npm.dui88.com:80/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha1-GRmmp8df44ssfHflGYU12prN2kA=
dependencies:
to-regex-range "^5.0.1"
finalhandler@1.1.1:
version "1.1.1"
resolved "http://npm.dui88.com:80/finalhandler/-/finalhandler-1.1.1.tgz#eebf4ed840079c83f4249038c9d703008301b105"
integrity sha1-7r9O2EAHnIP0JJA4ydcDAIMBsQU=
dependencies:
debug "2.6.9"
encodeurl "~1.0.2"
escape-html "~1.0.3"
on-finished "~2.3.0"
parseurl "~1.3.2"
statuses "~1.4.0"
unpipe "~1.0.0"
forwarded@0.2.0:
version "0.2.0"
resolved "http://npm.dui88.com:80/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
integrity sha1-ImmTZCiq1MFcfr6XeahL8LKoGBE=
fresh@0.5.2:
version "0.5.2"
resolved "http://npm.dui88.com:80/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
fsevents@~2.3.2:
version "2.3.2"
resolved "http://npm.dui88.com:80/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=
get-stream@^4.1.0:
version "4.1.0"
resolved "http://npm.dui88.com:80/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
integrity sha1-wbJVV189wh1Zv8ec09K0axw6VLU=
dependencies:
pump "^3.0.0"
get-stream@^5.1.0:
version "5.2.0"
resolved "http://npm.dui88.com:80/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3"
integrity sha1-SWaheV7lrOZecGxLe+txJX1uItM=
dependencies:
pump "^3.0.0"
glob-parent@~5.1.2:
version "5.1.2"
resolved "http://npm.dui88.com:80/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=
dependencies:
is-glob "^4.0.1"
global-dirs@^2.0.1:
version "2.1.0"
resolved "http://npm.dui88.com:80/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d"
integrity sha1-6QRqScgG/wTWwYJeGWyPAJHo300=
dependencies:
ini "1.3.7"
got@^9.6.0:
version "9.6.0"
resolved "http://npm.dui88.com:80/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
integrity sha1-7fRefWf5lUVwXeH3u+7rEhdl7YU=
dependencies:
"@sindresorhus/is" "^0.14.0"
"@szmarczak/http-timer" "^1.1.2"
cacheable-request "^6.0.0"
decompress-response "^3.3.0"
duplexer3 "^0.1.4"
get-stream "^4.1.0"
lowercase-keys "^1.0.1"
mimic-response "^1.0.1"
p-cancelable "^1.0.0"
to-readable-stream "^1.0.0"
url-parse-lax "^3.0.0"
graceful-fs@^4.1.2:
version "4.2.8"
resolved "http://npm.dui88.com:80/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha1-5BK40z9eAGWTy9PO5t+fLOu+gCo=
has-flag@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
has-flag@^4.0.0:
version "4.0.0"
resolved "http://npm.dui88.com:80/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=
has-yarn@^2.1.0:
version "2.1.0"
resolved "http://npm.dui88.com:80/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77"
integrity sha1-E34RNUp7W/EapctknPDG8/8rLnc=
http-cache-semantics@^4.0.0:
version "4.1.0"
resolved "http://npm.dui88.com:80/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
integrity sha1-SekcXL82yblLz81xwj1SSex045A=
http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3:
version "1.6.3"
resolved "http://npm.dui88.com:80/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d"
integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=
dependencies:
depd "~1.1.2"
inherits "2.0.3"
setprototypeof "1.1.0"
statuses ">= 1.4.0 < 2"
iconv-lite@0.4.23:
version "0.4.23"
resolved "http://npm.dui88.com:80/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
integrity sha1-KXhx9jvlB63Pv8pxXQzQ7thOmmM=
dependencies:
safer-buffer ">= 2.1.2 < 3"
ignore-by-default@^1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk=
import-lazy@^2.1.0:
version "2.1.0"
resolved "http://npm.dui88.com:80/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=
imurmurhash@^0.1.4:
version "0.1.4"
resolved "http://npm.dui88.com:80/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
inherits@2.0.3:
version "2.0.3"
resolved "http://npm.dui88.com:80/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
ini@1.3.7:
version "1.3.7"
resolved "http://npm.dui88.com:80/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84"
integrity sha1-oJNj4ZEZcuoW16iFEAXYTPCamoQ=
ini@~1.3.0:
version "1.3.8"
resolved "http://npm.dui88.com:80/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
integrity sha1-op2kJbSIBvNHZ6Tvzjlyaa8oQyw=
ipaddr.js@1.9.1:
version "1.9.1"
resolved "http://npm.dui88.com:80/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
integrity sha1-v/OFQ+64mEglB5/zoqjmy9RngbM=
is-binary-path@~2.1.0:
version "2.1.0"
resolved "http://npm.dui88.com:80/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
integrity sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=
dependencies:
binary-extensions "^2.0.0"
is-ci@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
integrity sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=
dependencies:
ci-info "^2.0.0"
is-extglob@^2.1.1:
version "2.1.1"
resolved "http://npm.dui88.com:80/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=
is-glob@^4.0.1, is-glob@~4.0.1:
version "4.0.1"
resolved "http://npm.dui88.com:80/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
integrity sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=
dependencies:
is-extglob "^2.1.1"
is-installed-globally@^0.3.1:
version "0.3.2"
resolved "http://npm.dui88.com:80/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141"
integrity sha1-/T76ee5nDRGHIzGC1bCh3QAxMUE=
dependencies:
global-dirs "^2.0.1"
is-path-inside "^3.0.1"
is-npm@^4.0.0:
version "4.0.0"
resolved "http://npm.dui88.com:80/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d"
integrity sha1-yQ3YOAaW34enptgjwg0LErvjyE0=
is-number@^7.0.0:
version "7.0.0"
resolved "http://npm.dui88.com:80/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=
is-obj@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982"
integrity sha1-Rz+wXZc3BeP9liBUUBjKjiLvSYI=
is-path-inside@^3.0.1:
version "3.0.3"
resolved "http://npm.dui88.com:80/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
integrity sha1-0jE2LlOgf/Kw4Op/7QSRYf/RYoM=
is-typedarray@^1.0.0:
version "1.0.0"
resolved "http://npm.dui88.com:80/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
is-yarn-global@^0.3.0:
version "0.3.0"
resolved "http://npm.dui88.com:80/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232"
integrity sha1-1QLTOCWQ6jAEiTdGdUyJE5lz4jI=
json-buffer@3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
keyv@^3.0.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
integrity sha1-7MIoSG9pmR5J6UdkhaW+Ho/FxNk=
dependencies:
json-buffer "3.0.0"
latest-version@^5.0.0:
version "5.1.0"
resolved "http://npm.dui88.com:80/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face"
integrity sha1-EZ3+kI/jjRXfpD7NE/oS7Igy+s4=
dependencies:
package-json "^6.3.0"
lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
integrity sha1-b54wtHCE2XGnyCD/FabFFnt0wm8=
lowercase-keys@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
integrity sha1-JgPni3tLAAbLyi+8yKMgJVislHk=
make-dir@^3.0.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
integrity sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=
dependencies:
semver "^6.0.0"
media-typer@0.3.0:
version "0.3.0"
resolved "http://npm.dui88.com:80/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
merge-descriptors@1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=
methods@~1.1.2:
version "1.1.2"
resolved "http://npm.dui88.com:80/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
mime-db@1.49.0:
version "1.49.0"
resolved "http://npm.dui88.com:80/mime-db/-/mime-db-1.49.0.tgz#f3dfde60c99e9cf3bc9701d687778f537001cbed"
integrity sha1-89/eYMmenPO8lwHWh3ePU3ABy+0=
mime-types@~2.1.24:
version "2.1.32"
resolved "http://npm.dui88.com:80/mime-types/-/mime-types-2.1.32.tgz#1d00e89e7de7fe02008db61001d9e02852670fd5"
integrity sha1-HQDonn3n/gIAjbYQAdngKFJnD9U=
dependencies:
mime-db "1.49.0"
mime@1.4.1:
version "1.4.1"
resolved "http://npm.dui88.com:80/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
integrity sha1-Eh+evEnjdm8xGnbh+hyAA8SwOqY=
mimic-response@^1.0.0, mimic-response@^1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
integrity sha1-SSNTiHju9CBjy4o+OweYeBSHqxs=
minimatch@^3.0.4:
version "3.0.4"
resolved "http://npm.dui88.com:80/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=
dependencies:
brace-expansion "^1.1.7"
minimist@^1.2.0:
version "1.2.5"
resolved "http://npm.dui88.com:80/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=
morgan@~1.9.1:
version "1.9.1"
resolved "http://npm.dui88.com:80/morgan/-/morgan-1.9.1.tgz#0a8d16734a1d9afbc824b99df87e738e58e2da59"
integrity sha1-Co0Wc0odmvvIJLmd+H5zjlji2lk=
dependencies:
basic-auth "~2.0.0"
debug "2.6.9"
depd "~1.1.2"
on-finished "~2.3.0"
on-headers "~1.0.1"
ms@2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
ms@^2.1.1:
version "2.1.3"
resolved "http://npm.dui88.com:80/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha1-V0yBOM4dK1hh8LRFedut1gxmFbI=
negotiator@0.6.2:
version "0.6.2"
resolved "http://npm.dui88.com:80/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
integrity sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs=
nodemon@^2.0.12:
version "2.0.12"
resolved "http://npm.dui88.com:80/nodemon/-/nodemon-2.0.12.tgz#5dae4e162b617b91f1873b3bfea215dd71e144d5"
integrity sha1-Xa5OFithe5Hxhzs7/qIV3XHhRNU=
dependencies:
chokidar "^3.2.2"
debug "^3.2.6"
ignore-by-default "^1.0.1"
minimatch "^3.0.4"
pstree.remy "^1.1.7"
semver "^5.7.1"
supports-color "^5.5.0"
touch "^3.1.0"
undefsafe "^2.0.3"
update-notifier "^4.1.0"
nopt@~1.0.10:
version "1.0.10"
resolved "http://npm.dui88.com:80/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=
dependencies:
abbrev "1"
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=
normalize-url@^4.1.0:
version "4.5.1"
resolved "http://npm.dui88.com:80/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
integrity sha1-DdkM8SiO4dExO4cIHJpZMu5IUYo=
on-finished@~2.3.0:
version "2.3.0"
resolved "http://npm.dui88.com:80/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
dependencies:
ee-first "1.1.1"
on-headers@~1.0.1:
version "1.0.2"
resolved "http://npm.dui88.com:80/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f"
integrity sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8=
once@^1.3.1, once@^1.4.0:
version "1.4.0"
resolved "http://npm.dui88.com:80/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
p-cancelable@^1.0.0:
version "1.1.0"
resolved "http://npm.dui88.com:80/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc"
integrity sha1-0HjRWjr0CSIMiG8dmgyi5EGrJsw=
package-json@^6.3.0:
version "6.5.0"
resolved "http://npm.dui88.com:80/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0"
integrity sha1-b+7ayjXnVyWHbQsOZJdGl/7RRbA=
dependencies:
got "^9.6.0"
registry-auth-token "^4.0.0"
registry-url "^5.0.0"
semver "^6.2.0"
parseurl@~1.3.2:
version "1.3.3"
resolved "http://npm.dui88.com:80/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
integrity sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=
path-to-regexp@0.1.7:
version "0.1.7"
resolved "http://npm.dui88.com:80/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
picomatch@^2.0.4, picomatch@^2.2.1:
version "2.3.0"
resolved "http://npm.dui88.com:80/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
integrity sha1-8fBh3o9qS/AiiS4tEoI0+5gwKXI=
prepend-http@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
proxy-addr@~2.0.4:
version "2.0.7"
resolved "http://npm.dui88.com:80/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
integrity sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=
dependencies:
forwarded "0.2.0"
ipaddr.js "1.9.1"
pstree.remy@^1.1.7:
version "1.1.8"
resolved "http://npm.dui88.com:80/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a"
integrity sha1-wkIiT0pnwh9oaDm720rCgrg3PTo=
pump@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
integrity sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
pupa@^2.0.1:
version "2.1.1"
resolved "http://npm.dui88.com:80/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62"
integrity sha1-9ej9SvwsXZeCj6pSNUnth0SiDWI=
dependencies:
escape-goat "^2.0.0"
qs@6.5.2:
version "6.5.2"
resolved "http://npm.dui88.com:80/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=
range-parser@~1.2.0:
version "1.2.1"
resolved "http://npm.dui88.com:80/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=
raw-body@2.3.3:
version "2.3.3"
resolved "http://npm.dui88.com:80/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3"
integrity sha1-GzJOzmtXBuFThVvBFIxlu39uoMM=
dependencies:
bytes "3.0.0"
http-errors "1.6.3"
iconv-lite "0.4.23"
unpipe "1.0.0"
rc@^1.2.8:
version "1.2.8"
resolved "http://npm.dui88.com:80/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
integrity sha1-zZJL9SAKB1uDwYjNa54hG3/A0+0=
dependencies:
deep-extend "^0.6.0"
ini "~1.3.0"
minimist "^1.2.0"
strip-json-comments "~2.0.1"
readdirp@~3.6.0:
version "3.6.0"
resolved "http://npm.dui88.com:80/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
integrity sha1-dKNwvYVxFuJFspzJc0DNQxoCpsc=
dependencies:
picomatch "^2.2.1"
registry-auth-token@^4.0.0:
version "4.2.1"
resolved "http://npm.dui88.com:80/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250"
integrity sha1-bXtABkQZGJcszV/tzUHcMix5slA=
dependencies:
rc "^1.2.8"
registry-url@^5.0.0:
version "5.1.0"
resolved "http://npm.dui88.com:80/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009"
integrity sha1-6YM0tQ1UNLgRNrROxjjZwgCcUAk=
dependencies:
rc "^1.2.8"
responselike@^1.0.2:
version "1.0.2"
resolved "http://npm.dui88.com:80/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=
dependencies:
lowercase-keys "^1.0.0"
safe-buffer@5.1.2:
version "5.1.2"
resolved "http://npm.dui88.com:80/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha1-mR7GnSluAxN0fVm9/St0XDX4go0=
"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "http://npm.dui88.com:80/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=
semver-diff@^3.1.1:
version "3.1.1"
resolved "http://npm.dui88.com:80/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b"
integrity sha1-Bfd85Z8yXgDicGr9Z7tQbdscoys=
dependencies:
semver "^6.3.0"
semver@^5.7.1:
version "5.7.1"
resolved "http://npm.dui88.com:80/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=
semver@^6.0.0, semver@^6.2.0, semver@^6.3.0:
version "6.3.0"
resolved "http://npm.dui88.com:80/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=
send@0.16.2:
version "0.16.2"
resolved "http://npm.dui88.com:80/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
integrity sha1-bsyh4PjBVtFBWXVZhI32RzCmu8E=
dependencies:
debug "2.6.9"
depd "~1.1.2"
destroy "~1.0.4"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
fresh "0.5.2"
http-errors "~1.6.2"
mime "1.4.1"
ms "2.0.0"
on-finished "~2.3.0"
range-parser "~1.2.0"
statuses "~1.4.0"
serve-static@1.13.2:
version "1.13.2"
resolved "http://npm.dui88.com:80/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1"
integrity sha1-CV6Ecv1bRiN9tQzkhqQ/S4bGzsE=
dependencies:
encodeurl "~1.0.2"
escape-html "~1.0.3"
parseurl "~1.3.2"
send "0.16.2"
setprototypeof@1.1.0:
version "1.1.0"
resolved "http://npm.dui88.com:80/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656"
integrity sha1-0L2FU2iHtv58DYGMuWLZ2RxU5lY=
signal-exit@^3.0.2:
version "3.0.3"
resolved "http://npm.dui88.com:80/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
integrity sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=
"statuses@>= 1.4.0 < 2":
version "1.5.0"
resolved "http://npm.dui88.com:80/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
statuses@~1.4.0:
version "1.4.0"
resolved "http://npm.dui88.com:80/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087"
integrity sha1-u3PURtonlhBu/MG2AaJT1sRr0Ic=
string-width@^3.0.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
integrity sha1-InZ74htirxCBV0MG9prFG2IgOWE=
dependencies:
emoji-regex "^7.0.1"
is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0"
string-width@^4.0.0, string-width@^4.1.0:
version "4.2.2"
resolved "http://npm.dui88.com:80/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
integrity sha1-2v1PlVmnWFz7pSnGoKT3NIjr1MU=
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"
strip-ansi@^5.1.0:
version "5.2.0"
resolved "http://npm.dui88.com:80/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
integrity sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=
dependencies:
ansi-regex "^4.1.0"
strip-ansi@^6.0.0:
version "6.0.0"
resolved "http://npm.dui88.com:80/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=
dependencies:
ansi-regex "^5.0.0"
strip-json-comments@~2.0.1:
version "2.0.1"
resolved "http://npm.dui88.com:80/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
supports-color@^5.5.0:
version "5.5.0"
resolved "http://npm.dui88.com:80/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=
dependencies:
has-flag "^3.0.0"
supports-color@^7.1.0:
version "7.2.0"
resolved "http://npm.dui88.com:80/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=
dependencies:
has-flag "^4.0.0"
term-size@^2.1.0:
version "2.2.1"
resolved "http://npm.dui88.com:80/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54"
integrity sha1-KmpUhAQywvtjIP6g9BVTHpAYn1Q=
to-readable-stream@^1.0.0:
version "1.0.0"
resolved "http://npm.dui88.com:80/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"
integrity sha1-zgqgwvPfat+FLvtASng+d8BHV3E=
to-regex-range@^5.0.1:
version "5.0.1"
resolved "http://npm.dui88.com:80/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
integrity sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=
dependencies:
is-number "^7.0.0"
touch@^3.1.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"
integrity sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=
dependencies:
nopt "~1.0.10"
type-fest@^0.8.1:
version "0.8.1"
resolved "http://npm.dui88.com:80/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=
type-is@~1.6.16:
version "1.6.18"
resolved "http://npm.dui88.com:80/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
integrity sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=
dependencies:
media-typer "0.3.0"
mime-types "~2.1.24"
typedarray-to-buffer@^3.1.5:
version "3.1.5"
resolved "http://npm.dui88.com:80/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080"
integrity sha1-qX7nqf9CaRufeD/xvFES/j/KkIA=
dependencies:
is-typedarray "^1.0.0"
undefsafe@^2.0.3:
version "2.0.3"
resolved "http://npm.dui88.com:80/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae"
integrity sha1-axZucJStRjE7IgLafsws18xueq4=
dependencies:
debug "^2.2.0"
unique-string@^2.0.0:
version "2.0.0"
resolved "http://npm.dui88.com:80/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d"
integrity sha1-OcZFH4GvsnSd4rIz4/fF6IQ72J0=
dependencies:
crypto-random-string "^2.0.0"
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "http://npm.dui88.com:80/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
update-notifier@^4.1.0:
version "4.1.3"
resolved "http://npm.dui88.com:80/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3"
integrity sha1-vobuE+jOSPtQBD/3IFe1vVmOHqM=
dependencies:
boxen "^4.2.0"
chalk "^3.0.0"
configstore "^5.0.1"
has-yarn "^2.1.0"
import-lazy "^2.1.0"
is-ci "^2.0.0"
is-installed-globally "^0.3.1"
is-npm "^4.0.0"
is-yarn-global "^0.3.0"
latest-version "^5.0.0"
pupa "^2.0.1"
semver-diff "^3.1.1"
xdg-basedir "^4.0.0"
url-parse-lax@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=
dependencies:
prepend-http "^2.0.0"
utils-merge@1.0.1:
version "1.0.1"
resolved "http://npm.dui88.com:80/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
vary@~1.1.2:
version "1.1.2"
resolved "http://npm.dui88.com:80/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
widest-line@^3.1.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca"
integrity sha1-gpIzO79my0X/DeFgOxNreuFJbso=
dependencies:
string-width "^4.0.0"
wrappy@1:
version "1.0.2"
resolved "http://npm.dui88.com:80/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
write-file-atomic@^3.0.0:
version "3.0.3"
resolved "http://npm.dui88.com:80/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8"
integrity sha1-Vr1cWlxwSBzRnFcb05q5ZaXeVug=
dependencies:
imurmurhash "^0.1.4"
is-typedarray "^1.0.0"
signal-exit "^3.0.2"
typedarray-to-buffer "^3.1.5"
xdg-basedir@^4.0.0:
version "4.0.0"
resolved "http://npm.dui88.com:80/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
integrity sha1-S8jZmEQDaWIl74OhVzy7y0552xM=
{
"name": "dui123",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/react": "^17.0.19",
"node-sass": "4.14",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<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"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
body, html{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
body {
background: #F9E0C5;
}
import './App.css';
import DataCenter from "./dataCenter/Root";
import Index from "./page";
function App() {
return (
<DataCenter>
<Index/>
</DataCenter>
);
}
export default App;
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
$topBarBg: #363636;
$backgroundColor : #fff;
$tabBackgroundColor: #DBDCE0;
$tabSelectedBg: #FEFEFE;
$fontColor:#000000;
$itemBg: #FEFEFE;
@mixin textOverflow(){
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
import './Content.scss'
import ContentItem from "./ContentItem";
import data from "../../data";
import {useContext} from "react";
import {Root} from "../../dataCenter/Root";
function Content(props) {
const {dataCenter} = useContext(Root)
return (
<div className="content">
{
dataCenter.index.content.map(v => {
return (
<ContentItem key={v.id} value={v}/>
)
})
}
</div>
)
}
export default Content
@import "../../common/common";
.content{
width: 100%;
min-width: 612px;
background: $backgroundColor;
border-radius: 0 0 3px 3px;
box-sizing: border-box;
padding: 20px;
display: grid;
grid-template-columns: repeat(auto-fill,278px);
grid-template-rows: repeat(auto-fill, 157px);
justify-content: space-between;
row-gap: 20px;
}
import './ContentItem.scss'
import defaultIcon from '../../static/defaultIcon.png'
import notFollow from '../../static/notFollow.png'
import followed from '../../static/followed.png'
function ContentItem(props) {
const {icon, name, desc, url, follow} = props.value
const jumpUrl = url => {
window.location.href = url
}
return (
<div className="content-item">
<div className="item-icon" onClick={() => jumpUrl(url)}>
<img src={icon ? icon : defaultIcon} alt={name}/>
</div>
<div className="item-name" onClick={() => jumpUrl(url)}>{name}</div>
<div className="item-desc">{desc}</div>
<a className='item-url' href={url}>{url}</a>
<div className="follow">
<img className='icon-follow' src={follow ? followed : notFollow} alt=""/>
收藏
</div>
</div>
)
}
export default ContentItem
@import "../../common/common";
@mixin test {
border: 1px solid #000;
box-sizing: border-box;
}
.content-item{
width: 278px;
height: 157px;
border: 1px solid #B995A1;
border-radius: 5px;
padding: 10px;
box-sizing: border-box;
background: $itemBg;
position: relative;
.item-icon{
width: 65px;
height: 65px;
position: relative;
cursor: pointer;
img{
width: 100%;
height: 100%;
}
}
.item-name{
position: absolute;
height: 30px;
width: 190px;
font-size: 17px;
font-weight: bold;
line-height: 30px;
left: 74px;
top: 10px;
cursor: pointer;
@include textOverflow();
//@include test();
}
.item-desc{
width: 100%;
height: 46px;
font-size: 12px;
border-top: 2px solid #344857;
padding-top: 3px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; /* 将对象作为弹性伸缩盒子模型显示 */
-webkit-line-clamp: 3; /* 控制最多显示几行 */
-webkit-box-orient: vertical; /* 设置或检索伸缩盒对象的子元素的排列方式 */
//@include test();
}
.item-url{
@include textOverflow();
width: 245px;
font-size: 12px;
color: #5F2150;
//@include test();
}
.follow{
width: 48px;
height: 25px;
position: absolute;
top: 40px;
left: 74px;
line-height: 25px;
font-weight: bold;
font-size: 14px;
cursor: pointer;
.icon-follow {
width: 18px;
height: 16px;
vertical-align: sub;
cursor: pointer;
}
}
}
import data from "../../data";
import './ToolType.scss'
import {useContext, useState} from "react";
import {Root} from "../../dataCenter/Root";
function ToolType (props) {
const {dataCenter} = useContext(Root)
const [typeId, setTypeId] = useState(1)
return (
<div className="tab-tool-type">
{
dataCenter?.type?.length && dataCenter.type.map(v => {
const classNameArr = ['item-tool-type ']
if (v.id === typeId) classNameArr.push('item-tool-type-selected')
return (
<div key={v.id} className={classNameArr.join('')} onClick={()=>setTypeId(v.id)}>{v.type}</div>
)
})
}
</div>
)
}
export default ToolType
@import "../../common/common";
.tab-tool-type {
width: 100%;
min-width: 612px;
height: 35px;
margin-top: 20px;
background: $tabBackgroundColor;
display: flex;
border-radius: 3px 3px;
.item-tool-type {
width: 80px;
line-height: 35px;
text-align: center;
cursor: pointer;
border-bottom: 2px solid #cccccc;
}
.item-tool-type-selected {
border: 1px solid #ccc;
border-bottom: none;
background: $tabSelectedBg;
border-radius: 3px 3px 0 0;
}
}
const apiConfig = {
domain: 'http://127.0.0.1:3001',
}
export default apiConfig
const data = {
index: {
toolType: [{
id: 1,
type: '我的'
}, {
id: 2,
type: '工具'
}, {
id: 3,
type: '文档'
},],
content: Array.from({length: 20}, (v, i) => {
return {
id: i+1,
name: '你TM找茬是不是',
icon: null,
desc: '你看看现在哪有瓜啊,都是大棚的瓜,你嫌贵我还嫌贵呢!',
url: 'https://www.bilibili.com',
follow: true
}
})
}
}
export default data
import React, {createContext, useReducer} from "react";
import {dataReducer, initDataCenter} from "./reducer";
import apiConfig from "../config/apiConfig";
import {UPDATE_DATA} from "./action";
const Root = createContext({})
function DataCenter(props) {
const [dataCenter, dispatch] = useReducer(dataReducer, initDataCenter, () => {
return initDataCenter
})
const domain = apiConfig.domain
const generateUrl = (path) => {
return domain + path
}
/**
*
* @param path
* @param dataName
* @param requestData
* @returns {Promise<T>}
*/
const fetchData = (path,dataName,requestData) =>
fetch(generateUrl(path), {credentials: 'include'})
.then(res => res.json())
.then(res => {
if (res.success){
dispatch(UPDATE_DATA({[dataName]: res.data}))
}else {
throw res
}
return res
})
.catch(e => {
console.error(e)
return e
})
return (
<Root.Provider value={{dataCenter, dispatch, fetchData}}>
{
props.children
}
</Root.Provider>
)
}
export {
Root
}
export default DataCenter
const UPDATE_DATA = data => ({type: 'UPDATE_DATA', data: {...data}})
export {
UPDATE_DATA,
}
import data from "../data";
const initDataCenter = {
...data
}
/**
* deepFreeze()
* @param obj
* @returns {unknown[]}
*/
function deepFreeze(obj) {
// 取回定义在obj上的属性名
let propNames = Object.getOwnPropertyNames(obj);
// 在冻结自身之前冻结属性
propNames.forEach(function (name) {
let prop = obj[name];
// 如果prop是个对象,冻结它
if (typeof prop == 'object' && prop !== null)
deepFreeze(prop);
});
// 冻结自身(no-op if already frozen)
return Object.freeze(obj);
}
//任何修改原始对象的操作都是禁止的!
deepFreeze(initDataCenter)
const dataReducer = (state, action) => {
console.log(action)
switch (action.type) {
case 'UPDATE_DATA':
return Object.assign({}, state, {
...action.data
})
default:
return state
}
}
export {
initDataCenter,
dataReducer,
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
#root{
width: 100%;
height: 100%;
}
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
\ No newline at end of file
import './index.scss'
import ToolType from "../component/ToolType/ToolType";
import Content from "../component/Content/Content";
import {useContext, useEffect} from "react";
import {Root} from "../dataCenter/Root";
function Index() {
const {fetchData} = useContext(Root)
const getIndex = () => fetchData('/database','type')
useEffect(()=>{
getIndex()
},[])
return (
<div className="index">
<div className="nav">
<div className="nav-title">Dui123</div>
</div>
<div className="tool-nav">
<ToolType/>
</div>
<div className="container">
<Content/>
</div>
</div>
)
}
export default Index
@import "../common/common";
body {
background: $backgroundColor;
}
.index {
width: 100%;
height: 100%;
color: $fontColor;
.nav {
width: 100%;
height: 40px;
background: $topBarBg;
color: #fff;
.nav-title {
width: 150px;
height: 40px;
font-size: 32px;
line-height: 40px;
font-weight: bold;;
text-align: center;
}
}
.tool-nav {
width: 100%;
min-width: 612px;
box-sizing: border-box;
padding: 0 180px;
}
}
.container {
width: 100%;
min-width: 612px;
padding: 20px 180px;
box-sizing: border-box;
}
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
const gotoLogin = () => {
const redirectUrl = 'http://127.0.0.1'
window.location.href = `http://sso.duiba.com.cn/login/?redirect=${encodeURIComponent(redirectUrl)}&systemId=363`;
console.log('重定向:',window.location.href)
}
export default gotoLogin
This source diff could not be displayed because it is too large. You can view the blob instead.
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