diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cf70988 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +**/node_modules diff --git a/frontend/.editorconfig b/.editorconfig similarity index 100% rename from frontend/.editorconfig rename to .editorconfig diff --git a/frontend/.eslintignore b/.eslintignore similarity index 100% rename from frontend/.eslintignore rename to .eslintignore diff --git a/frontend/.eslintrc.js b/.eslintrc.js similarity index 100% rename from frontend/.eslintrc.js rename to .eslintrc.js diff --git a/.gitignore b/.gitignore index 0541861..859c800 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ logs/ .idea/ tmp/ yarn.lock +.DS_Store +package-lock.json diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0ac92e1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +.idea +.DS_Store +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f416341 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM tikazyq/crawlab:latest + +ENV NVM_DIR /usr/local/nvm +ENV NODE_VERSION 8.12.0 + +RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.24.0/install.sh | bash \ + && . $NVM_DIR/nvm.sh \ + && nvm install v$NODE_VERSION \ + && nvm use v$NODE_VERSION \ + && nvm alias default v$NODE_VERSION +ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules +ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH + +# frontend port +EXPOSE 8080 + +# backend port +EXPOSE 8000 + +# start backend +CMD ["/bin/sh", "/app/docker_init.sh"] diff --git a/backend/.editorconfig b/backend/.editorconfig deleted file mode 100644 index 803737f..0000000 --- a/backend/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 diff --git a/backend/.gitignore b/backend/.gitignore deleted file mode 100644 index 5b04c74..0000000 --- a/backend/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -node_modules/ diff --git a/backend/package-lock.json b/backend/package-lock.json deleted file mode 100644 index ecb6ef9..0000000 --- a/backend/package-lock.json +++ /dev/null @@ -1,1416 +0,0 @@ -{ - "name": "backend", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz", - "integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=", - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npm.taobao.org/agent-base/download/agent-base-4.3.0.tgz", - "integrity": "sha1-gWXwHENgCbzK0LHRIvBe13Dvxu4=", - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/aproba/download/aproba-1.2.0.tgz", - "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=" - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "async": { - "version": "2.6.2", - "resolved": "https://registry.npm.taobao.org/async/download/async-2.6.2.tgz?cache=0&sync_timestamp=1563385399810&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fasync%2Fdownload%2Fasync-2.6.2.tgz", - "integrity": "sha1-GDMOp+bjE4h/XS8qkEusb+TdU4E=", - "requires": { - "lodash": "^4.17.11" - } - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/async-limiter/download/async-limiter-1.0.1.tgz", - "integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=" - }, - "async-lock": { - "version": "1.2.2", - "resolved": "https://registry.npm.taobao.org/async-lock/download/async-lock-1.2.2.tgz", - "integrity": "sha1-SAvVHkt//U3rvUlzdjcY7JrLmp4=" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/basic-auth/download/basic-auth-2.0.1.tgz", - "integrity": "sha1-uZgnm/R844NEtPPPkW1Gebv1Hjo=", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.5.1.tgz", - "integrity": "sha1-2VUfnemPH82h5oPRfukaBgLuLrk=" - }, - "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.19.0.tgz", - "integrity": "sha1-lrJwnlfJxOCab9Zqj9l5hE9p8Io=", - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "bson": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/bson/download/bson-1.1.1.tgz", - "integrity": "sha1-QzD16ZEExOdR5zUYWeLUCCefLxM=" - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz", - "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=" - }, - "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbytes%2Fdownload%2Fbytes-3.1.0.tgz", - "integrity": "sha1-9s95M6Ng4FiPqf3oVlHNx/gF0fY=" - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-4.1.0.tgz", - "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npm.taobao.org/concat-stream/download/concat-stream-1.6.2.tgz", - "integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.3.tgz", - "integrity": "sha1-4TDK9+cnkIfFYWwgB9BIVpiYT70=", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz", - "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=" - }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.4.0.tgz", - "integrity": "sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npm.taobao.org/cors/download/cors-2.8.5.tgz", - "integrity": "sha1-6sEdpRWS3Ya58G9uesKTs9+HXSk=", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "cron": { - "version": "1.7.1", - "resolved": "https://registry.npm.taobao.org/cron/download/cron-1.7.1.tgz", - "integrity": "sha1-6F7p33lNG8ZXmJbuOCBTw84zd48=", - "requires": { - "moment-timezone": "^0.5.x" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz?cache=0&sync_timestamp=1567511270254&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "date-format": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/date-format/download/date-format-2.1.0.tgz", - "integrity": "sha1-MdW16iEc9f12TNOLr50DPffhJc8=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdecamelize%2Fdownload%2Fdecamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npm.taobao.org/es6-promise/download/es6-promise-4.2.8.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fes6-promise%2Fdownload%2Fes6-promise-4.2.8.tgz", - "integrity": "sha1-TrIVlMlyvEBVPSduUQU5FD21Pgo=" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npm.taobao.org/es6-promisify/download/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npm.taobao.org/execa/download/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npm.taobao.org/express/download/express-4.17.1.tgz", - "integrity": "sha1-RJH8OGBc9R+GKdOcK10Cb5ikwTQ=", - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "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.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - } - }, - "extract-zip": { - "version": "1.6.7", - "resolved": "https://registry.npm.taobao.org/extract-zip/download/extract-zip-1.6.7.tgz", - "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", - "requires": { - "concat-stream": "1.6.2", - "debug": "2.6.9", - "mkdirp": "0.5.1", - "yauzl": "2.4.1" - } - }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/fd-slicer/download/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "requires": { - "pend": "~1.2.0" - } - }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.2.tgz", - "integrity": "sha1-t+fQAP/RGTjQ/bBTUG9uur6fWH0=", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "requires": { - "locate-path": "^2.0.0" - } - }, - "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/flatted/download/flatted-2.0.1.tgz?cache=0&sync_timestamp=1561466276595&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fflatted%2Fdownload%2Fflatted-2.0.1.tgz", - "integrity": "sha1-aeV8qo8OrLwoHS4stFjUb9tEngg=" - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npm.taobao.org/forwarded/download/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffs-extra%2Fdownload%2Ffs-extra-8.1.0.tgz", - "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npm.taobao.org/gauge/download/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-1.0.3.tgz", - "integrity": "sha1-+Xj6TJDR3+f/LWvtoqUV5xO9z0o=" - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/get-stream/download/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npm.taobao.org/glob/download/glob-7.1.4.tgz", - "integrity": "sha1-qmCKL2xXetNX4a5aXCbZqNGWklU=", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.2.tgz", - "integrity": "sha1-bwlSYF0BQMHP2xOO0AV3W5LWewI=" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/has-unicode/download/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, - "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.7.2.tgz", - "integrity": "sha1-T1ApzxMjnzEDblsuVSkrz7zIXI8=", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - } - }, - "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npm.taobao.org/https-proxy-agent/download/https-proxy-agent-2.2.2.tgz", - "integrity": "sha1-Jx6o6Q+DasnxGdrM05wZ/337B5M=", - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.2.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.2.6.tgz", - "integrity": "sha1-6D0X3hbYp++3cX7b5fsQE17uYps=", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" - } - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz", - "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz?cache=0&sync_timestamp=1560975547815&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finherits%2Fdownload%2Finherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/invert-kv/download/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npm.taobao.org/ipaddr.js/download/ipaddr.js-1.9.0.tgz", - "integrity": "sha1-N9905DCg5HVQ/lSi3v4w2KzZX2U=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/is-stream/download/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "kareem": { - "version": "2.3.1", - "resolved": "https://registry.npm.taobao.org/kareem/download/kareem-2.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fkareem%2Fdownload%2Fkareem-2.3.1.tgz", - "integrity": "sha1-3vEtnJQQF/q/sA+HOvlenJnhvoc=" - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/lcid/download/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz", - "integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=" - }, - "log4js": { - "version": "5.1.0", - "resolved": "https://registry.npm.taobao.org/log4js/download/log4js-5.1.0.tgz?cache=0&sync_timestamp=1566928079221&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flog4js%2Fdownload%2Flog4js-5.1.0.tgz", - "integrity": "sha1-P6U3IFWkwmEauS2ASWv/wQCEFQg=", - "requires": { - "date-format": "^2.1.0", - "debug": "^4.1.1", - "flatted": "^2.0.1", - "rfdc": "^1.1.4", - "streamroller": "^2.1.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", - "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" - } - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-4.1.5.tgz", - "integrity": "sha1-i75Q6oW+1ZvJ4z3KuCNe6bz0Q80=", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/mem/download/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "memory-pager": { - "version": "1.5.0", - "resolved": "https://registry.npm.taobao.org/memory-pager/download/memory-pager-1.5.0.tgz", - "integrity": "sha1-2HUWVdItOEaCdByXLyw9bfo+ZrU=", - "optional": true - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz?cache=0&sync_timestamp=1560034758817&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime%2Fdownload%2Fmime-1.6.0.tgz", - "integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=" - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.40.0.tgz", - "integrity": "sha1-plBX6ZjbCQ9zKmj2wnbTh9QSbDI=" - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.24.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.24.tgz", - "integrity": "sha1-tvjQs+lR77d97eyhlM/20W9nb4E=", - "requires": { - "mime-db": "1.40.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-1.2.0.tgz", - "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - } - }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npm.taobao.org/moment/download/moment-2.24.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmoment%2Fdownload%2Fmoment-2.24.0.tgz", - "integrity": "sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s=" - }, - "moment-timezone": { - "version": "0.5.26", - "resolved": "https://registry.npm.taobao.org/moment-timezone/download/moment-timezone-0.5.26.tgz", - "integrity": "sha1-wCZ8oJroRjGqPcM/Zb7b5ujg13I=", - "requires": { - "moment": ">= 2.9.0" - } - }, - "mongodb": { - "version": "3.2.7", - "resolved": "https://registry.npm.taobao.org/mongodb/download/mongodb-3.2.7.tgz", - "integrity": "sha1-i6FJ5L5wglfK0N6nKuuyu7MRp6w=", - "requires": { - "mongodb-core": "3.2.7", - "safe-buffer": "^5.1.2" - } - }, - "mongodb-core": { - "version": "3.2.7", - "resolved": "https://registry.npm.taobao.org/mongodb-core/download/mongodb-core-3.2.7.tgz", - "integrity": "sha1-qO8f52Shksl5JS2svGANyI134o8=", - "requires": { - "bson": "^1.1.1", - "require_optional": "^1.0.1", - "safe-buffer": "^5.1.2", - "saslprep": "^1.0.0" - } - }, - "mongoose": { - "version": "5.6.12", - "resolved": "https://registry.npm.taobao.org/mongoose/download/mongoose-5.6.12.tgz", - "integrity": "sha1-xAq+j/3sXLacSTuP2rJ9Hrrqfi0=", - "requires": { - "async": "2.6.2", - "bson": "~1.1.1", - "kareem": "2.3.1", - "mongodb": "3.2.7", - "mongodb-core": "3.2.7", - "mongoose-legacy-pluralize": "1.0.2", - "mpath": "0.6.0", - "mquery": "3.2.1", - "ms": "2.1.2", - "regexp-clone": "1.0.0", - "safe-buffer": "5.1.2", - "sift": "7.0.1", - "sliced": "1.0.1" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" - } - } - }, - "mongoose-legacy-pluralize": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/mongoose-legacy-pluralize/download/mongoose-legacy-pluralize-1.0.2.tgz", - "integrity": "sha1-O6n5H6UHtRhtOZ+0CFS/8Y+1Y+Q=" - }, - "morgan": { - "version": "1.9.1", - "resolved": "https://registry.npm.taobao.org/morgan/download/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" - } - }, - "mpath": { - "version": "0.6.0", - "resolved": "https://registry.npm.taobao.org/mpath/download/mpath-0.6.0.tgz", - "integrity": "sha1-qpIgKfyk8PZB82DnTFwbakxHB44=" - }, - "mquery": { - "version": "3.2.1", - "resolved": "https://registry.npm.taobao.org/mquery/download/mquery-3.2.1.tgz", - "integrity": "sha1-iwWaSc2uCoqegEKE72TC9Y06wF0=", - "requires": { - "bluebird": "3.5.1", - "debug": "3.1.0", - "regexp-clone": "^1.0.0", - "safe-buffer": "5.1.2", - "sliced": "1.0.1" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.2.tgz", - "integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs=" - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/number-is-nan/download/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.2.tgz", - "integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8=" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/os-locale/download/os-locale-2.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fos-locale%2Fdownload%2Fos-locale-2.1.0.tgz", - "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-1.3.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-1.3.0.tgz", - "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz", - "integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=" - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/pend/download/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprocess-nextick-args%2Fdownload%2Fprocess-nextick-args-2.0.1.tgz", - "integrity": "sha1-eCDZsWEgzFXKmud5JoCufbptf+I=" - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz", - "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=" - }, - "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npm.taobao.org/proxy-addr/download/proxy-addr-2.0.5.tgz", - "integrity": "sha1-NMvWSi2B9LH9IedvnwbIpFKZ7jQ=", - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" - } - }, - "proxy-from-env": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/proxy-from-env/download/proxy-from-env-1.0.0.tgz", - "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/pseudomap/download/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "puppeteer-chromium-resolver": { - "version": "2.0.1", - "resolved": "https://registry.npm.taobao.org/puppeteer-chromium-resolver/download/puppeteer-chromium-resolver-2.0.1.tgz", - "integrity": "sha1-HfCl9SLIXlv0J8q7HJs+a701IBo=", - "requires": { - "gauge": "^2.7.4", - "puppeteer-core": "^1.19.0" - } - }, - "puppeteer-core": { - "version": "1.19.0", - "resolved": "https://registry.npm.taobao.org/puppeteer-core/download/puppeteer-core-1.19.0.tgz", - "integrity": "sha1-PD+Y7bWGJYPjqcGcvA2lfMxjulw=", - "requires": { - "debug": "^4.1.0", - "extract-zip": "^1.6.6", - "https-proxy-agent": "^2.2.1", - "mime": "^2.0.3", - "progress": "^2.0.1", - "proxy-from-env": "^1.0.0", - "rimraf": "^2.6.1", - "ws": "^6.1.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", - "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", - "requires": { - "ms": "^2.1.1" - } - }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npm.taobao.org/mime/download/mime-2.4.4.tgz?cache=0&sync_timestamp=1560034758817&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime%2Fdownload%2Fmime-2.4.4.tgz", - "integrity": "sha1-vXuRE1/GsBzePpuuM9ZZtj2IV+U=" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" - } - } - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz", - "integrity": "sha1-QdwaAV49WB8WIXdr4xr7KHapsbw=" - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz", - "integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=" - }, - "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.4.0.tgz", - "integrity": "sha1-oc5vucm8NWylLoklarWQWeE9AzI=", - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freadable-stream%2Fdownload%2Freadable-stream-2.3.6.tgz", - "integrity": "sha1-sRwn2IuP8fvgcGQ8+UsMea4bCq8=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "regexp-clone": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/regexp-clone/download/regexp-clone-1.0.0.tgz", - "integrity": "sha1-Ii25Z2IydwViYLmSYmNUoEzpv2M=" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frequire-directory%2Fdownload%2Frequire-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" - }, - "require_optional": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/require_optional/download/require_optional-1.0.1.tgz", - "integrity": "sha1-TPNaQkf2TKPfjC7yCMxJSxyo/C4=", - "requires": { - "resolve-from": "^2.0.0", - "semver": "^5.1.0" - } - }, - "resolve-from": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" - }, - "rfdc": { - "version": "1.1.4", - "resolved": "https://registry.npm.taobao.org/rfdc/download/rfdc-1.1.4.tgz", - "integrity": "sha1-unLME2egzNnPgahws7WL060H+MI=" - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-2.7.1.tgz", - "integrity": "sha1-NXl/E6f9rcVmFCwp1PB8ytSD4+w=", - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", - "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafer-buffer%2Fdownload%2Fsafer-buffer-2.1.2.tgz", - "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" - }, - "saslprep": { - "version": "1.0.3", - "resolved": "https://registry.npm.taobao.org/saslprep/download/saslprep-1.0.3.tgz", - "integrity": "sha1-TAL5RrVs9UKX40e6EJPnrKxM8iY=", - "optional": true, - "requires": { - "sparse-bitfield": "^3.0.3" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz", - "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=" - }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npm.taobao.org/send/download/send-0.17.1.tgz", - "integrity": "sha1-wdiwWfeQD3Rm3Uk4vcROEd2zdsg=", - "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.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.1.tgz", - "integrity": "sha1-MKWGTrPrsKZvLr5tcnrwagnYbgo=" - } - } - }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.14.1.tgz", - "integrity": "sha1-Zm5jbcTwEPfvKZcKiKZ0MgiYsvk=", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.1.tgz", - "integrity": "sha1-fpWsskqpL1iF4KvvW6ExMw1K5oM=" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "showdown": { - "version": "1.9.0", - "resolved": "https://registry.npm.taobao.org/showdown/download/showdown-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fshowdown%2Fdownload%2Fshowdown-1.9.0.tgz", - "integrity": "sha1-1J0qC22yG3wulu+FX3s7KijvRvQ=", - "requires": { - "yargs": "^10.0.3" - } - }, - "sift": { - "version": "7.0.1", - "resolved": "https://registry.npm.taobao.org/sift/download/sift-7.0.1.tgz", - "integrity": "sha1-R9YsULFZ0xbxNy+LU/nBDNIaSwg=" - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "sliced": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/sliced/download/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" - }, - "sparse-bitfield": { - "version": "3.0.3", - "resolved": "https://registry.npm.taobao.org/sparse-bitfield/download/sparse-bitfield-3.0.3.tgz", - "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", - "optional": true, - "requires": { - "memory-pager": "^1.0.2" - } - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" - }, - "streamroller": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/streamroller/download/streamroller-2.1.0.tgz?cache=0&sync_timestamp=1566280630598&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstreamroller%2Fdownload%2Fstreamroller-2.1.0.tgz", - "integrity": "sha1-cC3k27pCjILtP/yHp1ohphAn5GE=", - "requires": { - "date-format": "^2.1.0", - "debug": "^4.1.1", - "fs-extra": "^8.1.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", - "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" - } - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.1.1.tgz?cache=0&sync_timestamp=1565170823020&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring_decoder%2Fdownload%2Fstring_decoder-1.1.1.tgz", - "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/strip-eof/download/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/toidentifier/download/toidentifier-1.0.0.tgz", - "integrity": "sha1-fhvjRw8ed5SLxD2Uo8j013UrpVM=" - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.18.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-is%2Fdownload%2Ftype-is-1.6.18.tgz", - "integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npm.taobao.org/typedarray/download/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz", - "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=" - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz", - "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz", - "integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=", - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "ws": { - "version": "6.2.1", - "resolved": "https://registry.npm.taobao.org/ws/download/ws-6.2.1.tgz", - "integrity": "sha1-RC/fCkftZPWbal2P8TD0dI7VJPs=", - "requires": { - "async-limiter": "~1.0.0" - } - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "10.1.2", - "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-10.1.2.tgz?cache=0&sync_timestamp=1567812322754&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-10.1.2.tgz", - "integrity": "sha1-RU0HTCsWpRpD4vt4B+T53mnMtcU=", - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^8.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "yargs-parser": { - "version": "8.1.0", - "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-8.1.0.tgz?cache=0&sync_timestamp=1567798682591&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-8.1.0.tgz", - "integrity": "sha1-8TdqM7Ziml0GN4KUTacyYx6WaVA=", - "requires": { - "camelcase": "^4.1.0" - } - }, - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npm.taobao.org/yauzl/download/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "requires": { - "fd-slicer": "~1.0.1" - } - } - } -} diff --git a/backend/package.json b/backend/package.json index a927667..5dec7c5 100644 --- a/backend/package.json +++ b/backend/package.json @@ -11,6 +11,7 @@ "dependencies": { "async-lock": "^1.2.2", "body-parser": "^1.19.0", + "clipboardy": "^2.1.0", "cors": "^2.8.5", "cron": "^1.7.1", "express": "^4.17.1", diff --git a/backend/test/api.http b/backend/test/api.http deleted file mode 100644 index 4f73954..0000000 --- a/backend/test/api.http +++ /dev/null @@ -1,58 +0,0 @@ -# For a quick start check out our HTTP Requests collection (Tools|HTTP Client|Open HTTP Requests Collection). -# -# Following HTTP Request Live Templates are available: -# * 'gtrp' and 'gtr' create a GET request with or without query parameters; -# * 'ptr' and 'ptrp' create a POST request with a simple or parameter-like body; -# * 'mptr' and 'fptr' create a POST request to submit a form with a text or file field (multipart/form-data); -PUT http://localhost:3000/articles -Content-Type: application/json - -{ - "title": "it works", - "content": "it works" -} - -### - -POST http://localhost:3000/articles/5d563c54736d44efad4cbf60 -Content-Type: application/json - -{ - "title": "爬虫平台Crawlab核心原理--分布式架构", - "content": "some content" -} - -### - -DELETE http://localhost:3000/articles/5d563c69cb5204efc829a4e1 -Content-Type: application/json - -{} - -### - -POST http://localhost:3000/articles/5d62706c5ba687447f429bdc/publish -Content-Type: application/json - -{ - "platforms": "juejin,segmentfault" -} - -### - -POST http://192.168.99.100:8000/login -Content-Type: application/json - -{ - "username": "admin", - "password": "admin" -} - -### - -GET http://localhost:3000/platforms/5d71bfb2eebe31547cdd936d/articles -Content-Type: application/json - -{} - -### diff --git a/cli.js b/cli.js new file mode 100644 index 0000000..66ddf80 --- /dev/null +++ b/cli.js @@ -0,0 +1,19 @@ +const os = require('os') +const exec = require('child_process').exec +const path = require('path') +const program = require('commander') + +program + .command('start') + .action(async () => { + const umiCmd = path.join( + __dirname, + 'node_modules', + '.bin', + os.platform().match(/^win/) ? 'umi' : 'umi.cmd' + ) + exec(umiCmd, ['dev']) + require('./server') + }) + +program.parse(process.argv) diff --git a/backend/config.js b/config.js similarity index 81% rename from backend/config.js rename to config.js index d4797ac..365365a 100644 --- a/backend/config.js +++ b/config.js @@ -6,4 +6,7 @@ module.exports = { MONGO_DB: 'artipub', MONGO_USERNAME: '', MONGO_PASSWORD: '', + + // HEADLESS: true + HEADLESS: false } diff --git a/frontend/config/config.ts b/config/config.ts similarity index 96% rename from frontend/config/config.ts rename to config/config.ts index bf37c98..5209d58 100644 --- a/frontend/config/config.ts +++ b/config/config.ts @@ -123,17 +123,15 @@ export default { Routes: ['src/pages/Authorized'], authority: ['admin', 'user'], routes: [ + // { + // path: '/', + // name: 'welcome', + // icon: 'smile', + // component: './Welcome', + // }, { path: '/', - name: 'welcome', - icon: 'smile', - component: './Welcome', - }, - { - path: '/articles', - name: 'articles', - icon: 'read', - component: './ArticleList/ArticleList', + redirect: '/platforms', }, { path: '/platforms', @@ -141,6 +139,12 @@ export default { icon: 'cloud', component: './PlatformList/PlatformList', }, + { + path: '/articles', + name: 'articles', + icon: 'read', + component: './ArticleList/ArticleList', + }, { component: './404', }, diff --git a/frontend/config/defaultSettings.ts b/config/defaultSettings.ts similarity index 100% rename from frontend/config/defaultSettings.ts rename to config/defaultSettings.ts diff --git a/frontend/config/plugin.config.ts b/config/plugin.config.ts similarity index 100% rename from frontend/config/plugin.config.ts rename to config/plugin.config.ts diff --git a/backend/constants.js b/constants.js similarity index 90% rename from backend/constants.js rename to constants.js index df0db22..60d9c5c 100644 --- a/backend/constants.js +++ b/constants.js @@ -3,7 +3,8 @@ module.exports = { JUEJIN: 'juejin', SEGMENTFAULT: 'segmentfault', JIANSHU: 'jianshu', - CSDN: 'csdn' + CSDN: 'csdn', + ZHIHU: 'zhihu' }, status: { NOT_STARTED: 'not-started', diff --git a/backend/credentials.example.json b/credentials.example.json similarity index 100% rename from backend/credentials.example.json rename to credentials.example.json diff --git a/backend/credentials.json b/credentials.json similarity index 100% rename from backend/credentials.json rename to credentials.json diff --git a/backend/data.js b/data.js similarity index 72% rename from backend/data.js rename to data.js index 736088b..5755be2 100644 --- a/backend/data.js +++ b/data.js @@ -32,6 +32,14 @@ module.exports = { url: 'https://jianshu.com', description: '简书是一个优质的创作社区,在这里,你可以任性地创作,一篇短文、一张照片、一首诗、一幅画……我们相信,每个人都是生活中的艺术家,有着无穷的创造力。', enableImport: false, + }, + { + name: constants.platform.ZHIHU, + label: '知乎', + editorType: constants.editorType.MARKDOWN, + url: 'https://zhihu.com', + description: '有问题,上知乎。知乎,可信赖的问答社区,以让每个人高效获得可信赖的解答为使命。知乎凭借认真、专业和友善的社区氛围,结构化、易获得的优质内容,基于问答的内容生产方式和独特的社区机制,吸引、聚集了各行各业中大量的亲历者、内行人、领域专家、领域爱好者,将高质量的内容透过人的节点来成规模地生产和分享。用户通过问答等交流方式建立信任和连接,打造和提升个人影响力,并发现、获得新机会。', + enableImport: false, } ] } diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..a942bf9 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,15 @@ +version: '3.3' +services: + master: + image: "tikazyq/artipub:latest" + environment: + CRAWLAB_API_ADDRESS: "192.168.99.100:8000" + CRAWLAB_SERVER_MASTER: "Y" + CRAWLAB_MONGO_HOST: "192.168.99.1" + CRAWLAB_REDIS_ADDRESS: "192.168.99.1" + CRAWLAB_LOG_PATH: "/var/logs/crawlab" + ports: + - "8080:8080" # frontend + - "8000:8000" # backend + volumes: + - "/Users/yeqing/projects/artipub/spiders:/app/spiders" diff --git a/backend/exec.js b/exec.js similarity index 100% rename from backend/exec.js rename to exec.js diff --git a/extensions/dist.crx b/extensions/dist.crx deleted file mode 100644 index cc07e52..0000000 Binary files a/extensions/dist.crx and /dev/null differ diff --git a/extensions/package.json b/extensions/package.json index d85831a..7db07f5 100755 --- a/extensions/package.json +++ b/extensions/package.json @@ -23,6 +23,7 @@ "tslint-config-airbnb": "^5.11.1", "tslint-react": "^3.6.0", "typescript": "^3.5.3", + "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^4.1.1", "webpack-cli": "^3.1.1", "webpack-merge": "^4.1.4" diff --git a/extensions/src/popup/Popup.tsx b/extensions/src/popup/Popup.tsx index ff831a5..9299d71 100644 --- a/extensions/src/popup/Popup.tsx +++ b/extensions/src/popup/Popup.tsx @@ -29,6 +29,7 @@ export default class Popup extends React.Component { 'segmentfault', 'jianshu', 'csdn', + 'zhihu', ], configVisible: false, url: 'http://localhost:3000', diff --git a/extensions/webpack.common.js b/extensions/webpack.common.js index 7331267..a73b609 100644 --- a/extensions/webpack.common.js +++ b/extensions/webpack.common.js @@ -1,6 +1,7 @@ const path = require("path") const HtmlWebpackPlugin = require('html-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { entry: { @@ -37,6 +38,14 @@ module.exports = { resolve: { extensions: [".ts", ".tsx", ".js"] }, + optimization: { + minimizer: [new UglifyJsPlugin({ + include: [ + 'src', + 'node_modules', + ], + })] + }, plugins: [ new HtmlWebpackPlugin({ filename: "popup.html", diff --git a/frontend/.dockerignore b/frontend/.dockerignore deleted file mode 100644 index 8e90ca6..0000000 --- a/frontend/.dockerignore +++ /dev/null @@ -1,35 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -**/node_modules -/src/utils/request-temp.js - -# production -/.vscode - -# misc -.DS_Store -npm-debug.log* -yarn-error.log - -/coverage -.idea -yarn.lock -package-lock.json -*bak -.vscode - -# visual studio code -.history -*.log - -functions/mock -.temp/** - -# umi -.umi -.umi-production - -# screenshot -screenshot -.firebase \ No newline at end of file diff --git a/frontend/.gitignore b/frontend/.gitignore deleted file mode 100644 index 7fd9f58..0000000 --- a/frontend/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -**/node_modules -# roadhog-api-doc ignore -/src/utils/request-temp.js -_roadhog-api-doc - -# production -/dist -/.vscode - -# misc -.DS_Store -npm-debug.log* -yarn-error.log - -/coverage -.idea -yarn.lock -package-lock.json -*bak -.vscode - -# visual studio code -.history -*.log -functions/* -.temp/** - -# umi -.umi -.umi-production - -# screenshot -screenshot -.firebase -.eslintcache - -build diff --git a/frontend/.gitpod.yml b/frontend/.gitpod.yml deleted file mode 100644 index 32d8e64..0000000 --- a/frontend/.gitpod.yml +++ /dev/null @@ -1,6 +0,0 @@ -ports: - - port: 8000 - onOpen: open-preview -tasks: - - init: npm install - command: npm start diff --git a/frontend/.prettierignore b/frontend/.prettierignore deleted file mode 100644 index a1842db..0000000 --- a/frontend/.prettierignore +++ /dev/null @@ -1,19 +0,0 @@ -**/*.svg -package.json -.umi -.umi-production -/dist -.dockerignore -.DS_Store -.eslintignore -*.png -*.toml -docker -.editorconfig -Dockerfile* -.gitignore -.prettierignore -LICENSE -.eslintcache -*.lock -yarn-error.log \ No newline at end of file diff --git a/frontend/.prettierrc.js b/frontend/.prettierrc.js deleted file mode 100644 index 7b597d7..0000000 --- a/frontend/.prettierrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const fabric = require('@umijs/fabric'); - -module.exports = { - ...fabric.prettier, -}; diff --git a/frontend/.stylelintrc.js b/frontend/.stylelintrc.js deleted file mode 100644 index c203078..0000000 --- a/frontend/.stylelintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const fabric = require('@umijs/fabric'); - -module.exports = { - ...fabric.stylelint, -}; diff --git a/frontend/CNAME b/frontend/CNAME deleted file mode 100644 index 30c2d4d..0000000 --- a/frontend/CNAME +++ /dev/null @@ -1 +0,0 @@ -preview.pro.ant.design \ No newline at end of file diff --git a/frontend/CODE_OF_CONDUCT.md b/frontend/CODE_OF_CONDUCT.md deleted file mode 100644 index 2b4571c..0000000 --- a/frontend/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -- The use of sexualized language or imagery and unwelcome sexual attention or advances -- Trolling, insulting/derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or electronic address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at afc163@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/frontend/Dockerfile b/frontend/Dockerfile deleted file mode 100644 index 7cbc5c3..0000000 --- a/frontend/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM circleci/node:latest-browsers - -WORKDIR /usr/src/app/ -USER root -COPY package.json ./ -RUN yarn - -COPY ./ ./ - -RUN npm run test:all - -CMD ["npm", "run", "build"] diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev deleted file mode 100644 index 96fddc2..0000000 --- a/frontend/Dockerfile.dev +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:latest - -WORKDIR /usr/src/app/ - -COPY package.json ./ -RUN npm install --silent --no-cache --registry=https://registry.npm.taobao.org - -COPY ./ ./ - - -CMD ["npm", "run", "start"] diff --git a/frontend/Dockerfile.hub b/frontend/Dockerfile.hub deleted file mode 100644 index 43d8981..0000000 --- a/frontend/Dockerfile.hub +++ /dev/null @@ -1,25 +0,0 @@ -FROM circleci/node:latest-browsers as builder - -WORKDIR /usr/src/app/ -USER root -COPY package.json ./ -RUN yarn - -COPY ./ ./ - -RUN npm run test:all - -RUN npm run build - - -FROM nginx - -WORKDIR /usr/share/nginx/html/ - -COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf - -COPY --from=builder /usr/src/app/dist /usr/share/nginx/html/ - -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/frontend/LICENSE b/frontend/LICENSE deleted file mode 100644 index c17ba2f..0000000 --- a/frontend/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Alipay.inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/frontend/README.fr-FR.md b/frontend/README.fr-FR.md deleted file mode 100644 index 5e2e744..0000000 --- a/frontend/README.fr-FR.md +++ /dev/null @@ -1,124 +0,0 @@ -[English](./README.md) | [简体中文](./README.zh-CN.md) | [Русский](./README.ru-RU.md) | [Türkçe](./README.tr-TR.md) | [日本語](./README.ja-JP.md) | Français - -

Ant Design Pro

- -
- -Une solution UI prête à l'emploi pour des applications d'entreprise en tant que modèle React. - -[![Construit avec Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Status de la construction](https://dev.azure.com/ant-design/ant-design-pro/_apis/build/status/ant-design.ant-design-pro?branchName=master)](https://dev.azure.com/ant-design/ant-design-pro/_build/latest?definitionId=1?branchName=master) [![Dépendences](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) [![Dépendences de développement](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) [![Gitter](https://img.shields.io/gitter/room/ant-design/pro-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/pro-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Rejoignez la discussion dans https://gitter.im/ant-design/ant-design-pro](https://img.shields.io/gitter/room/ant-design/ant-design-pro.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Netlify Status](https://api.netlify.com/api/v1/badges/f2fd24cf-5fa1-4a80-be3a-0dbe72b44c90/deploy-status)](https://app.netlify.com/sites/ant-design-pro/deploys) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) - -![](https://user-images.githubusercontent.com/8186664/44953195-581e3d80-aec4-11e8-8dcb-54b9db38ec11.png) - -
- -- Aperçu: http://preview.pro.ant.design -- Page d'accueil: http://pro.ant.design -- Documentation: http://pro.ant.design/docs/getting-started -- ChangeLog: http://pro.ant.design/docs/changelog -- FAQ: http://pro.ant.design/docs/faq -- Site mirroir en Chine: http://ant-design-pro.gitee.io - -## 2.0 Sorti maintenant! 🎉🎉🎉 - -[Annoncement de Ant Design Pro 2.0.0](https://medium.com/ant-design/beautiful-and-powerful-ant-design-pro-2-0-release-51358da5af95) - -## Recrutement pour la traduction :loudspeaker: - -Nous avons besoin de votre aide: https://github.com/ant-design/ant-design-pro/issues/120 - -## Fonctionnalités - -- :gem: **Design soigné**: Suit [la spécification Ant Design](http://ant.design/) -- :triangular_ruler: **Modèles communs**: Modèles typiques d'application d'entreprise -- :rocket: **Développement dernier cri**: Infrastructure de développement de React/umi/dva/antd la plus récente -- :iphone: **Design adapté**: Conçu pour des tailles d'écran variables -- :art: **Thématisation**: Thème personnalisable avec configuration simple -- :globe_with_meridians: **International**: Solution i18n intégrée -- :gear: **Meilleures pratiques**: Flux de travail solide pour rendre votre code sain -- :1234: **Développement simulé**: Solution de développement simulée facile à utiliser -- :white_check_mark: **Tests UI**: Volez en toute sécurité avec les tests unitaires et e2e - -## Modèles - -``` -- Tableau de bord - - Analytique - - Moniteur - - Espace de travail -- Formulaire - - Formulaire de base - - Formulaire par étape - - Formulaire avancé -- Liste - - Tableau standard - - Liste standard - - Liste de cartes - - Liste de recherche (Projet/Applications/Article) -- Profil - - Profil simple - - Profil avancé -- Compte - - Centre du compte - - Paramètres du compte -- Résultat - - Succès - - Échec -- Exception - - 403 - - 404 - - 500 -- Utilisateur - - Connexion - - S'inscrire - - Résultat de l'inscription -``` - -## Utilisation - -### Utiliser bash - -```bash -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ npm install -$ npm start # visit http://localhost:8000 -``` - -### Utilisation de Gitpod - -Ouvrez le projet avec Gitpod (environnement de développement gratuit pour GitHub) et commencez à coder immédiatement. - -[![Ouvrir dans Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design-pro) - -Plus d'instructions dans la [documentation](http://pro.ant.design/docs/getting-started). - -## Support des navigateurs - -Navigateurs modernes et IE11. - -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | -| --- | --- | --- | --- | --- | -| IE11, Edge | deux dernières versions | deux dernières versions | deux dernières versions | deux dernières versions | - -## Contribution - -Toute forme de contribution est la bienvenue, voici quelques exemples de façons dont vous pouvez contribuer à ce projet: - -- Utiliser Ant Design Pro dans votre travail quotidien. -- Soumettre des [issues](http://github.com/ant-design/ant-design-pro/issues) pour reporter les bugs ou poser des questions. -- Proposer des [pull requests](http://github.com/ant-design/ant-design-pro/pulls) pour améliorer notre code. - -
- - - -
diff --git a/frontend/README.ja-JP.md b/frontend/README.ja-JP.md deleted file mode 100644 index 995692d..0000000 --- a/frontend/README.ja-JP.md +++ /dev/null @@ -1,126 +0,0 @@ -[English](./README.md) | [简体中文](./README.zh-CN.md) | [Русский](./README.ru-RU.md) | [Türkçe](./README.tr-TR.md) | 日本語 | [Français](./README.fr-FR.md) - -

Ant Design Pro

- -
- -独創的な業務システムの UI を解決するための React ボイラープレート。 - -[![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Build Status](https://dev.azure.com/ant-design/ant-design-pro/_apis/build/status/ant-design.ant-design-pro?branchName=master)](https://dev.azure.com/ant-design/ant-design-pro/_build/latest?definitionId=1?branchName=master) [![Dependencies](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) [![Gitter](https://img.shields.io/gitter/room/ant-design/pro-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/pro-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design-pro](https://img.shields.io/gitter/room/ant-design/ant-design-pro.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Netlify Status](https://api.netlify.com/api/v1/badges/f2fd24cf-5fa1-4a80-be3a-0dbe72b44c90/deploy-status)](https://app.netlify.com/sites/ant-design-pro/deploys) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) - -![](https://user-images.githubusercontent.com/8186664/44953195-581e3d80-aec4-11e8-8dcb-54b9db38ec11.png) - -
- -- プレビュー: http://preview.pro.ant.design -- ホームページ: http://pro.ant.design -- ドキュメント: http://pro.ant.design/docs/getting-started -- 変更ログ: http://pro.ant.design/docs/changelog -- FAQ: http://pro.ant.design/docs/faq -- 中国のミラーサイト: http://ant-design-pro.gitee.io - -## 2.0 がリリースされました 🎉🎉🎉 - -[Announcing Ant Design Pro 2.0.0](https://medium.com/ant-design/beautiful-and-powerful-ant-design-pro-2-0-release-51358da5af95) - -## 翻訳の募集 :loudspeaker: - -私たちはあなたの助けを必要としています。: https://github.com/ant-design/ant-design-pro/issues/120 - -## 特徴 - -- :gem: **きちんとしたデザイン**: [Ant Design specification](http://ant.design/) に従ってくださ い。 -- :triangular_ruler: **共通のテンプレート**: 業務システム用のテンプレート -- :rocket: **現状のアート開発**: `React/umi/dva/antd` の最新開発スタック -- :iphone: **レスポンシブ**: さまざまな画面サイズ用の設計 -- :art: **テーマ**: シンプルな設定でカスタマイズ可能なテーマ -- :globe_with_meridians: **国際化**: 国際化の解決策を内蔵 -- :gear: **ベストプラクティス**: コードを美しくするための正しいワークフロー -- :1234: **モック開発**: 使いやすいモック開発 -- :white_check_mark: **UI テスト**: ユニットテストと e2e テスト - -## テンプレート - -``` -- ダッシュボード - - アナリティクス - - モニター -  - ワークスペース -- 形 -  - 基本フォーム -  - ステップフォーム -  - 高度なフォーム - - リスト -  - スタンダードテーブル -  - スタンダードリスト -  - カードリスト -  - 検索リスト(プロジェクト/アプリケーション/記事) - - プロフィール -  - 簡単なプロフィール -  - 高度なプロファイル - - アカウント -  - アカウントセンター -  - アカウント設定 - - 結果 -  - 成功 -  - 失敗 - - 例外 -  - 403 -  - 404 -  - 500 - - ユーザー -  - ログイン -  - 登録 -  - 登録結果 -``` - -## 使用法 - -### bash を使う方法 - -```bash -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ npm install -$ npm start # http://localhost:8000 を開く -``` - -### Gitpod を使う方法 - -Gitpod(GitHub 用の無料オンライン開発環境)でプロジェクトを開き、すぐにコーディングを開始できます。 - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design-pro) - -その他の指示は [ドキュメント](http://pro.ant.design/docs/getting-started) を確認してください。 - -## サポートするブラウザー - -モダンなブラウザと IE11。 - -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | -| --- | --- | --- | --- | --- | -| IE11, Edge | 最新版から 2 バージョン | 最新版から 2 バージョン | 最新版から 2 バージョン | 最新版から 2 バージョン | - -## 貢献する - -どんな種類の貢献でも大歓迎です。あなたがこのプロジェクトに貢献できる方法のいくつかの例はここにあります。: - -- 毎日の仕事に Ant Design Pro を使用すること。 -- 報告すること。 [issues](http://github.com/ant-design/ant-design-pro/issues) にバグ報告や質問をしてください。 -- 更新すること。 改善を、[pull requests](http://github.com/ant-design/ant-design-pro/pulls) で送ってください。 - -[![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) - -
- - - -
diff --git a/frontend/README.md b/frontend/README.md deleted file mode 100644 index 395030b..0000000 --- a/frontend/README.md +++ /dev/null @@ -1,126 +0,0 @@ -English | [简体中文](./README.zh-CN.md) | [Русский](./README.ru-RU.md) | [Türkçe](./README.tr-TR.md) | [日本語](./README.ja-JP.md) | [Français](./README.fr-FR.md) - -

Ant Design Pro

- -
- -An out-of-box UI solution for enterprise applications as a React boilerplate. - -[![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Build Status](https://dev.azure.com/ant-design/ant-design-pro/_apis/build/status/ant-design.ant-design-pro?branchName=master)](https://dev.azure.com/ant-design/ant-design-pro/_build/latest?definitionId=1?branchName=master) [![Dependencies](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) [![Gitter](https://img.shields.io/gitter/room/ant-design/pro-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/pro-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design-pro](https://img.shields.io/gitter/room/ant-design/ant-design-pro.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Netlify Status](https://api.netlify.com/api/v1/badges/f2fd24cf-5fa1-4a80-be3a-0dbe72b44c90/deploy-status)](https://app.netlify.com/sites/ant-design-pro/deploys) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) - -![](https://user-images.githubusercontent.com/8186664/44953195-581e3d80-aec4-11e8-8dcb-54b9db38ec11.png) - -
- -- Preview: http://preview.pro.ant.design -- Home Page: http://pro.ant.design -- Documentation: http://pro.ant.design/docs/getting-started -- ChangeLog: http://pro.ant.design/docs/changelog -- FAQ: http://pro.ant.design/docs/faq -- Mirror Site in China: http://ant-design-pro.gitee.io - -## 4.0 Released Now! 🎉🎉🎉 - -[Announcing Ant Design Pro 4.0.0](https://medium.com/ant-design/ant-design-pro-v4-is-here-6f23098ae9d9) - -## Translation Recruitment :loudspeaker: - -We need your help: https://github.com/ant-design/ant-design-pro/issues/120 - -## Features - -- :bulb: **TypeScript**: A language for application-scale JavaScript -- :scroll: **Blocks**: Build page with block template -- :gem: **Neat Design**: Follow [Ant Design specification](http://ant.design/) -- :triangular_ruler: **Common Templates**: Typical templates for enterprise applications -- :rocket: **State of The Art Development**: Newest development stack of React/umi/dva/antd -- :iphone: **Responsive**: Designed for variable screen sizes -- :art: **Theming**: Customizable theme with simple config -- :globe_with_meridians: **International**: Built-in i18n solution -- :gear: **Best Practices**: Solid workflow to make your code healthy -- :1234: **Mock development**: Easy to use mock development solution -- :white_check_mark: **UI Test**: Fly safely with unit and e2e tests - -## Templates - -``` -- Dashboard - - Analytic - - Monitor - - Workspace -- Form - - Basic Form - - Step Form - - Advanced From -- List - - Standard Table - - Standard List - - Card List - - Search List (Project/Applications/Article) -- Profile - - Simple Profile - - Advanced Profile -- Account - - Account Center - - Account Settings -- Result - - Success - - Failed -- Exception - - 403 - - 404 - - 500 -- User - - Login - - Register - - Register Result -``` - -## Usage - -### Use bash - -```bash -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ npm install -$ npm start # visit http://localhost:8000 -``` - -### Use Gitpod - -Open the project in Gitpod (free online dev environment for GitHub) and start coding immediately. - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design-pro) - -More instructions at [documentation](http://pro.ant.design/docs/getting-started). - -## Browsers support - -Modern browsers and IE11. - -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | -| --- | --- | --- | --- | --- | -| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | - -## Contributing - -Any type of contribution is welcome, here are some examples of how you may contribute to this project: - -- Use Ant Design Pro in your daily work. -- Submit [issues](http://github.com/ant-design/ant-design-pro/issues) to report bugs or ask questions. -- Propose [pull requests](http://github.com/ant-design/ant-design-pro/pulls) to improve our code. - -
- - - -
diff --git a/frontend/README.ru-RU.md b/frontend/README.ru-RU.md deleted file mode 100644 index 359fc29..0000000 --- a/frontend/README.ru-RU.md +++ /dev/null @@ -1,112 +0,0 @@ -[English](./README.md) | [简体中文](./README.zh-CN.md) | Русский | [Türkçe](./README.tr-TR.md) | [日本語](./README.ja-JP.md) | [Français](./README.fr-FR.md) - -

Ant Design Pro

- -
- -UI-решение "из коробки" для корпоративных приложений как React boilerplate - -[![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Build Status](https://dev.azure.com/ant-design/ant-design-pro/_apis/build/status/ant-design.ant-design-pro?branchName=master)](https://dev.azure.com/ant-design/ant-design-pro/_build/latest?definitionId=1?branchName=master) [![Dependencies](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) [![Gitter](https://img.shields.io/gitter/room/ant-design/pro-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/pro-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design-pro](https://img.shields.io/gitter/room/ant-design/ant-design-pro.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Netlify Status](https://api.netlify.com/api/v1/badges/f2fd24cf-5fa1-4a80-be3a-0dbe72b44c90/deploy-status)](https://app.netlify.com/sites/ant-design-pro/deploys) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) - -![](https://user-images.githubusercontent.com/8186664/44953195-581e3d80-aec4-11e8-8dcb-54b9db38ec11.png) - -
- -- Демо: http://preview.pro.ant.design -- Домашняя страница: http://pro.ant.design -- Документация: http://pro.ant.design/docs/getting-started -- История изменений: http://pro.ant.design/docs/changelog -- FAQ: http://pro.ant.design/docs/faq -- Китайское зеркало сайта: http://ant-design-pro.gitee.io - -## Поиск переводчиков :loudspeaker: - -Нам нужна ваша помощь: https://github.com/ant-design/ant-design-pro/issues/120 - -## Возможности - -- :gem: **Аккуратный дизайн**: Посмотрите [спецификацию Ant Design](http://ant.design/) -- :triangular_ruler: **Общие шаблоны**: Стандартные шаблоны для корпоративных приложений -- :rocket: **Разработка, как искусство**: Новейший стек технологий React/umi/dva/antd -- :iphone: **Отзывчивая верстка**: Создан для экранов разных размеров -- :art: **Темизация**: Возможность изменения темы с помощью конфигурации -- :globe_with_meridians: **Мультиязычность**: Встроенное i18n решение -- :gear: **Лучшие практики**: Надежные процессы для хорошего кода -- :1234: **Разработка по шаблону**: Простое в использовании решение для разработки -- :white_check_mark: **UI тесты**: Разрабатывайте безопасно с юнит и e2e тестами - -## Шаблоны - -``` -- Dashboard - - Analytic - - Monitor - - Workspace -- Form - - Basic Form - - Step Form - - Advanced From -- List - - Standard Table - - Standard List - - Card List - - Search List (Project/Applications/Article) -- Profile - - Simple Profile - - Advanced Profile -- Account - - Account Center - - Account Settings -- Result - - Success - - Failed -- Exception - - 403 - - 404 - - 500 -- User - - Login - - Register - - Register Result -``` - -## Использование - -```bash -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ npm install -$ npm start # visit http://localhost:8000 -``` - -Больше информации в [документации](http://pro.ant.design/docs/getting-started). - -## Совместимость - -Современные браузеры и IE11. - -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | -| --- | --- | --- | --- | --- | -| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | - -## Распространение - -Любые варианты распространения приветствуются! Вот несколько примеров того, как вы можете помочь распространению проекта: - -- Использовать Ant Design Pro в ежедневной работе. -- Создавать [задачи](http://github.com/ant-design/ant-design-pro/issues) заводить баги или отвечать на вопросы. -- Делать [pull-реквесты](http://github.com/ant-design/ant-design-pro/pulls) для совершенствования нашего кода. - -
- - - -
diff --git a/frontend/README.tr-TR.md b/frontend/README.tr-TR.md deleted file mode 100644 index f071b9e..0000000 --- a/frontend/README.tr-TR.md +++ /dev/null @@ -1,116 +0,0 @@ -[English](./README.md) | [简体中文](./README.zh-CN.md) | [Русский](./README.ru-RU.md) | Türkçe | [日本語](./README.ja-JP.md) | [Français](./README.fr-FR.md) - -

Ant Design Pro

- -
- -React ile kurumsal uygulamalar için taslak olarak geliştirilmiş kullanıma hazır bir UI çözümü. - -[![CircleCI Status](https://circleci.com/gh/ant-design/ant-design-pro.svg?style=svg)](https://circleci.com/gh/ant-design/ant-design-pro/) [![Build status](https://ci.appveyor.com/api/projects/status/67fxu2by3ibvqtat/branch/master?svg=true)](https://ci.appveyor.com/project/afc163/ant-design-pro/branch/master) [![Dependencies](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) [![Gitter](https://img.shields.io/gitter/room/ant-design/pro-english.svg)](https://gitter.im/ant-design/pro-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)(🇺🇸) [![Gitter](https://img.shields.io/gitter/room/ant-design/ant-design-pro.svg?style=flat-square)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)(🇨🇳) [![Netlify Status](https://api.netlify.com/api/v1/badges/f2fd24cf-5fa1-4a80-be3a-0dbe72b44c90/deploy-status)](https://app.netlify.com/sites/ant-design-pro/deploys) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) - -![](https://user-images.githubusercontent.com/8186664/44953195-581e3d80-aec4-11e8-8dcb-54b9db38ec11.png) - -
- -- Önizleme: http://preview.pro.ant.design -- Anasayfa: http://pro.ant.design -- Dokümantasyon: http://pro.ant.design/docs/getting-started -- ChangeLog: http://pro.ant.design/docs/changelog -- SSS: http://pro.ant.design/docs/faq -- Çinde barındırılan site: http://ant-design-pro.gitee.io - -## 2.0 Versiyonu Şimdi Yayında! 🎉🎉🎉 - -[Announcing Ant Design Pro 2.0.0](https://medium.com/ant-design/beautiful-and-powerful-ant-design-pro-2-0-release-51358da5af95) - -## Çeviri Desteği :loudspeaker: - -Çeviriler için yardımınıza ihtiyacımız var: https://github.com/ant-design/ant-design-pro/issues/120 - -## Özellikler - -- :gem: **Zarif Tasarım**: Buradan [Ant Design özellikleri](http://ant.design/) -- :triangular_ruler: **Ortak Şablonlar**: Kurumsal uygulamalar için şablonlar -- :rocket: **Sanatsal gelişim durumu**: Newest development stack of React/umi/dva/antd -- :iphone: **Responsive**: Değişken ekran boyutları için tasarlanmıştır -- :art: **Tema Kullanımı**: Basit ayarlar ile özelleştirilebilir tema -- :globe_with_meridians: **Uluslararası**: Built-in i18n solution -- :gear: **Best Practices**: İyi kod için sağlam iş akışı -- :1234: **Mock Geliştirme**: Model(Mock) geliştirmeler için kolay çözüm -- :white_check_mark: **UI Testi**: Unit ve e2e testleri ile güvenli sürdürülebilirlik - -## Şablonlar - -``` -- Dashboard - - Analitik - - Monitör - - Çalışma alanı -- Form - - Basit Form - - Step Form - - Gelişmiş Form -- List - - Standard Tablo - - Standard Liste - - Kart Liste - - Arama Listesi (Project/Applications/Article) -- Profil - - Basit Profil - - Gelişmiş Profil -- Hesap - - Hesap Yönetimi - - Hesap Ayarları -- Sonuç - - Başarılı - - Hatalı -- Hatalar - - 403 - - 404 - - 500 -- Kullanıcı - - Giriş - - Kayıt - - Kayıt Sonucu -``` - -## Kullanım - -```bash -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ npm install -$ npm start # visit http://localhost:8000 -``` - -Daha fazla talimat için [dokümantasyon](http://pro.ant.design/docs/getting-started) sayfasına göz atın. - -## Tarayıcı desteği - -Modern internet tarayıcıları ve IE11. - -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | -| --- | --- | --- | --- | --- | -| IE11, Edge | son 2 versiyon | son 2 versiyon | son 2 versiyon | son 2 versiyon | - -## Destek - -Her türlü desteğinize açığız, bu projeye nasıl katkıda bulunabileceğinize dair bazı örnekler: - -- Günlük işinizde Ant Design Pro kullanın. -- Hataları bildirmek veya soru sormak için [issues](http://github.com/ant-design/ant-design-pro/issues) gönderin. -- kodumuzu geliştirmek için [pull requests](http://github.com/ant-design/ant-design-pro/pulls) gönderin. - -
- - - -
diff --git a/frontend/README.zh-CN.md b/frontend/README.zh-CN.md deleted file mode 100644 index 4fcd27c..0000000 --- a/frontend/README.zh-CN.md +++ /dev/null @@ -1,114 +0,0 @@ -[English](./README.md) | 简体中文 | [Русский](./README.ru-RU.md) | [Türkçe](./README.tr-TR.md) | [日本語](./README.ja-JP.md) | [Français](./README.fr-FR.md) - -

Ant Design Pro

- -
- -开箱即用的中台前端/设计解决方案。 - -[![Build With Umi](https://img.shields.io/badge/build%20with-umi-028fe4.svg?style=flat-square)](http://umijs.org/) [![Build Status](https://dev.azure.com/ant-design/ant-design-pro/_apis/build/status/ant-design.ant-design-pro?branchName=master)](https://dev.azure.com/ant-design/ant-design-pro/_build/latest?definitionId=1?branchName=master) [![Dependencies](https://img.shields.io/david/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design-pro.svg)](https://david-dm.org/ant-design/ant-design-pro?type=dev) [![Join the chat at https://gitter.im/ant-design/ant-design-pro](https://img.shields.io/gitter/room/ant-design/ant-design-pro.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design-pro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Netlify Status](https://api.netlify.com/api/v1/badges/f2fd24cf-5fa1-4a80-be3a-0dbe72b44c90/deploy-status)](https://app.netlify.com/sites/ant-design-pro/deploys) ![](https://badgen.net/badge/icon/Ant%20Design?icon=https://gw.alipayobjects.com/zos/antfincdn/Pp4WPgVDB3/KDpgvguMpGfqaHPjicRK.svg&label) - -![](https://user-images.githubusercontent.com/8186664/44953195-581e3d80-aec4-11e8-8dcb-54b9db38ec11.png) - -
- -- 预览:http://preview.pro.ant.design -- 首页:http://pro.ant.design/index-cn -- 使用文档:http://pro.ant.design/docs/getting-started-cn -- 更新日志: http://pro.ant.design/docs/changelog-cn -- 常见问题:http://pro.ant.design/docs/faq-cn -- 国内镜像:http://ant-design-pro.gitee.io - -## 现在我们发布了 4.0! 🎉🎉🎉 - -[Announcing Ant Design Pro 4.0.0](https://zhuanlan.zhihu.com/p/67498559) - -## 特性 - -- :bulb: **TypeScript**: 应用程序级 JavaScript 的语言 -- :scroll: **区块**: 通过区块模板快速构建页面 -- :gem: **优雅美观**:基于 Ant Design 体系精心设计 -- :triangular_ruler: **常见设计模式**:提炼自中后台应用的典型页面和场景 -- :rocket: **最新技术栈**:使用 React/umi/dva/antd 等前端前沿技术开发 -- :iphone: **响应式**:针对不同屏幕大小设计 -- :art: **主题**:可配置的主题满足多样化的品牌诉求 -- :globe_with_meridians: **国际化**:内建业界通用的国际化方案 -- :gear: **最佳实践**:良好的工程实践助您持续产出高质量代码 -- :1234: **Mock 数据**:实用的本地数据调试方案 -- :white_check_mark: **UI 测试**:自动化测试保障前端产品质量 - -## 模板 - -``` -- Dashboard - - 分析页 - - 监控页 - - 工作台 -- 表单页 - - 基础表单页 - - 分步表单页 - - 高级表单页 -- 列表页 - - 查询表格 - - 标准列表 - - 卡片列表 - - 搜索列表(项目/应用/文章) -- 详情页 - - 基础详情页 - - 高级详情页 -- 用户 - - 用户中心页 - - 用户设置页 -- 结果 - - 成功页 - - 失败页 -- 异常 - - 403 无权限 - - 404 找不到 - - 500 服务器出错 -- 帐户 - - 登录 - - 注册 - - 注册成功 -``` - -## 使用 - -```bash -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ npm install -$ npm start # visit http://localhost:8000 -``` - -更多信息请参考 [使用文档](http://pro.ant.design/docs/getting-started)。 - -## 支持环境 - -现代浏览器及 IE11。 - -| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | -| --- | --- | --- | --- | --- | -| IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | - -## 参与贡献 - -我们非常欢迎你的贡献,你可以通过以下方式和我们一起共建 :smiley:: - -- 在你的公司或个人项目中使用 Ant Design Pro。 -- 通过 [Issue](http://github.com/ant-design/ant-design-pro/issues) 报告 bug 或进行咨询。 -- 提交 [Pull Request](http://github.com/ant-design/ant-design-pro/pulls) 改进 Pro 的代码。 - -
- - - -
diff --git a/frontend/azure-pipelines.yml b/frontend/azure-pipelines.yml deleted file mode 100644 index 2df685a..0000000 --- a/frontend/azure-pipelines.yml +++ /dev/null @@ -1,78 +0,0 @@ -# Node.js -# Build a general Node.js project with npm. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript -name: ant design pro - -trigger: - - master - -jobs: - - job: lintAndBuild - - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - checkout: self - clean: false - - script: yarn install - displayName: install - - script: npm run lint - displayName: lint - - script: npm run build - env: - PROGRESS: none - displayName: build - - - job: test - pool: - vmImage: 'Ubuntu-16.04' - - container: - image: circleci/node:latest-browsers - options: '-u root' - - steps: - - script: yarn install - displayName: install - - script: npm run test:all - env: - PROGRESS: none - displayName: test - - - job: Windows - pool: - vmImage: 'vs2017-win2016' - steps: - - task: NodeTool@0 - inputs: - versionSpec: '11.x' - - script: yarn install - displayName: install - - script: npm run lint - displayName: lint - - script: npm run test:all - env: - PROGRESS: none - displayName: test - - script: npm run build - env: - PROGRESS: none - displayName: build - - - job: MacOS - pool: - vmImage: 'macOS-10.13' - steps: - - task: NodeTool@0 - inputs: - versionSpec: '11.x' - - script: yarn install - displayName: install - - script: npm run lint - displayName: lint - - script: npm run - env: - PROGRESS: none - displayName: build diff --git a/frontend/docker/docker-compose.dev.yml b/frontend/docker/docker-compose.dev.yml deleted file mode 100644 index 38ab39b..0000000 --- a/frontend/docker/docker-compose.dev.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: '3.5' - -services: - ant-design-pro_dev: - ports: - - 8000:8000 - build: - context: ../ - dockerfile: Dockerfile.dev - container_name: 'ant-design-pro_dev' - volumes: - - ../src:/usr/src/app/src - - ../config:/usr/src/app/config - - ../mock:/usr/src/app/mock diff --git a/frontend/docker/docker-compose.yml b/frontend/docker/docker-compose.yml deleted file mode 100644 index 13e12db..0000000 --- a/frontend/docker/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: '3.5' - -services: - ant-design-pro_build: - build: ../ - container_name: 'ant-design-pro_build' - volumes: - - dist:/usr/src/app/dist - - ant-design-pro_web: - image: nginx - ports: - - 80:80 - container_name: 'ant-design-pro_web' - restart: unless-stopped - volumes: - - dist:/usr/share/nginx/html:ro - - ./nginx.conf:/etc/nginx/conf.d/default.conf - -volumes: - dist: diff --git a/frontend/docker/nginx.conf b/frontend/docker/nginx.conf deleted file mode 100644 index 9d0418c..0000000 --- a/frontend/docker/nginx.conf +++ /dev/null @@ -1,21 +0,0 @@ -server { - listen 80; - # gzip config - gzip on; - gzip_min_length 1k; - gzip_comp_level 9; - gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; - gzip_vary on; - gzip_disable "MSIE [1-6]\."; - - root /usr/share/nginx/html; - - location / { - try_files $uri $uri/ /index.html; - } - location /api { - proxy_pass https://ant-design-pro.netlify.com; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Real-IP $remote_addr; - } -} diff --git a/frontend/jest-puppeteer.config.js b/frontend/jest-puppeteer.config.js deleted file mode 100644 index 21b41e4..0000000 --- a/frontend/jest-puppeteer.config.js +++ /dev/null @@ -1,12 +0,0 @@ -// ps https://github.com/GoogleChrome/puppeteer/issues/3120 -module.exports = { - launch: { - args: [ - '--disable-gpu', - '--disable-dev-shm-usage', - '--no-first-run', - '--no-zygote', - '--no-sandbox', - ], - }, -}; diff --git a/frontend/jest.config.js b/frontend/jest.config.js deleted file mode 100644 index 502fe33..0000000 --- a/frontend/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - testURL: 'http://localhost:8000', - preset: 'jest-puppeteer', - globals: { - ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false, - }, -}; diff --git a/frontend/lambda/api.js b/frontend/lambda/api.js deleted file mode 100644 index 105f0b0..0000000 --- a/frontend/lambda/api.js +++ /dev/null @@ -1,26 +0,0 @@ -// [START functions import] -const express = require('express'); -const serverLess = require('serverless-http'); - -const matchMock = require('./mock/matchMock'); - -const app = express(); - -app.all('*', (req, res, next) => { - res.header('Access-Control-Allow-Origin', '*'); - res.header( - 'Access-Control-Allow-Headers', - 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild', - ); - res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS'); - - if (req.method == 'OPTIONS') { - res.send(200); - } else { - next(); - } -}); - -app.use(matchMock); - -exports.handler = serverLess(app); diff --git a/frontend/lambda/mock/index.js b/frontend/lambda/mock/index.js deleted file mode 100644 index f412ec3..0000000 --- a/frontend/lambda/mock/index.js +++ /dev/null @@ -1,4322 +0,0 @@ -(function(global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - ? (module.exports = factory(require('mockjs'), require('moment'))) - : typeof define === 'function' && define.amd - ? define(['mockjs', 'moment'], factory) - : ((global = global || self), (global.mock = factory(global.mockjs, global.moment))); -})(this, function(mockjs, moment) { - 'use strict'; - - mockjs = mockjs && mockjs.hasOwnProperty('default') ? mockjs['default'] : mockjs; - moment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment; - - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true, - }); - } else { - obj[key] = value; - } - - return obj; - } - - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat( - Object.getOwnPropertySymbols(source).filter(function(sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - }), - ); - } - - ownKeys.forEach(function(key) { - _defineProperty(target, key, source[key]); - }); - } - - return target; - } - - const titles = [ - 'Alipay', - 'Angular', - 'Ant Design', - 'Ant Design Pro', - 'Bootstrap', - 'React', - 'Vue', - 'Webpack', - ]; - const avatars = [ - 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', // Alipay - 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', // Angular - 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', // Ant Design - 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', // Ant Design Pro - 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', // Bootstrap - 'https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png', // React - 'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue - 'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png', - ]; - const avatars2 = [ - 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', - 'https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png', - 'https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png', - 'https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png', - 'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png', - 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png', - 'https://gw.alipayobjects.com/zos/rmsportal/psOgztMplJMGpVEqfcgF.png', - 'https://gw.alipayobjects.com/zos/rmsportal/ZpBqSxLxVEXfcUNoPKrz.png', - 'https://gw.alipayobjects.com/zos/rmsportal/laiEnJdGHVOhJrUShBaJ.png', - 'https://gw.alipayobjects.com/zos/rmsportal/UrQsqscbKEpNuJcvBZBu.png', - ]; - const covers = [ - 'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png', - 'https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png', - 'https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png', - 'https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png', - ]; - const desc = [ - '那是一种内在的东西, 他们到达不了,也无法触及的', - '希望是一个好东西,也许是最好的,好东西是不会消亡的', - '生命就像一盒巧克力,结果往往出人意料', - '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆', - '那时候我只会想自己想要什么,从不想自己拥有什么', - ]; - const user = [ - '付小小', - '曲丽丽', - '林东东', - '周星星', - '吴加好', - '朱偏右', - '鱼酱', - '乐哥', - '谭小仪', - '仲尼', - ]; - - function fakeList(count) { - const list = []; - - for (let i = 0; i < count; i += 1) { - list.push({ - id: `fake-list-${i}`, - owner: user[i % 10], - title: titles[i % 8], - avatar: avatars[i % 8], - cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)], - status: ['active', 'exception', 'normal'][i % 3], - percent: Math.ceil(Math.random() * 50) + 50, - logo: avatars[i % 8], - href: 'https://ant.design', - updatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 2 * i), - createdAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 2 * i), - subDescription: desc[i % 5], - description: - '在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。', - activeUser: Math.ceil(Math.random() * 100000) + 100000, - newUser: Math.ceil(Math.random() * 1000) + 1000, - star: Math.ceil(Math.random() * 100) + 100, - like: Math.ceil(Math.random() * 100) + 100, - message: Math.ceil(Math.random() * 10) + 10, - content: - '段落示意:蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。', - members: [ - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png', - name: '曲丽丽', - id: 'member1', - }, - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png', - name: '王昭君', - id: 'member2', - }, - { - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png', - name: '董娜娜', - id: 'member3', - }, - ], - }); - } - - return list; - } - - let sourceData; - - function getFakeList(req, res) { - const params = req.query; - const count = params.count * 1 || 20; - const result = fakeList(count); - sourceData = result; - return res.json(result); - } - - function postFakeList(req, res) { - const { - /* url = '', */ - body, - } = req; // const params = getUrlParams(url); - - const { method, id } = body; // const count = (params.count * 1) || 20; - - let result = sourceData; - - switch (method) { - case 'delete': - result = result.filter(item => item.id !== id); - break; - - case 'update': - result.forEach((item, i) => { - if (item.id === id) { - result[i] = Object.assign(item, body); - } - }); - break; - - case 'post': - result.unshift({ - body, - id: `fake-list-${result.length}`, - createdAt: new Date().getTime(), - }); - break; - - default: - break; - } - - return res.json(result); - } - - const getNotice = [ - { - id: 'xxx1', - title: titles[0], - logo: avatars[0], - description: '那是一种内在的东西,他们到达不了,也无法触及的', - updatedAt: new Date(), - member: '科学搬砖组', - href: '', - memberLink: '', - }, - { - id: 'xxx2', - title: titles[1], - logo: avatars[1], - description: '希望是一个好东西,也许是最好的,好东西是不会消亡的', - updatedAt: new Date('2017-07-24'), - member: '全组都是吴彦祖', - href: '', - memberLink: '', - }, - { - id: 'xxx3', - title: titles[2], - logo: avatars[2], - description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆', - updatedAt: new Date(), - member: '中二少女团', - href: '', - memberLink: '', - }, - { - id: 'xxx4', - title: titles[3], - logo: avatars[3], - description: '那时候我只会想自己想要什么,从不想自己拥有什么', - updatedAt: new Date('2017-07-23'), - member: '程序员日常', - href: '', - memberLink: '', - }, - { - id: 'xxx5', - title: titles[4], - logo: avatars[4], - description: '凛冬将至', - updatedAt: new Date('2017-07-23'), - member: '高逼格设计天团', - href: '', - memberLink: '', - }, - { - id: 'xxx6', - title: titles[5], - logo: avatars[5], - description: '生命就像一盒巧克力,结果往往出人意料', - updatedAt: new Date('2017-07-23'), - member: '骗你来学计算机', - href: '', - memberLink: '', - }, - ]; - const getActivities = [ - { - id: 'trend-1', - updatedAt: new Date(), - user: { - name: '曲丽丽', - avatar: avatars2[0], - }, - group: { - name: '高逼格设计天团', - link: 'http://github.com/', - }, - project: { - name: '六月迭代', - link: 'http://github.com/', - }, - template: '在 @{group} 新建项目 @{project}', - }, - { - id: 'trend-2', - updatedAt: new Date(), - user: { - name: '付小小', - avatar: avatars2[1], - }, - group: { - name: '高逼格设计天团', - link: 'http://github.com/', - }, - project: { - name: '六月迭代', - link: 'http://github.com/', - }, - template: '在 @{group} 新建项目 @{project}', - }, - { - id: 'trend-3', - updatedAt: new Date(), - user: { - name: '林东东', - avatar: avatars2[2], - }, - group: { - name: '中二少女团', - link: 'http://github.com/', - }, - project: { - name: '六月迭代', - link: 'http://github.com/', - }, - template: '在 @{group} 新建项目 @{project}', - }, - { - id: 'trend-4', - updatedAt: new Date(), - user: { - name: '周星星', - avatar: avatars2[4], - }, - project: { - name: '5 月日常迭代', - link: 'http://github.com/', - }, - template: '将 @{project} 更新至已发布状态', - }, - { - id: 'trend-5', - updatedAt: new Date(), - user: { - name: '朱偏右', - avatar: avatars2[3], - }, - project: { - name: '工程效能', - link: 'http://github.com/', - }, - comment: { - name: '留言', - link: 'http://github.com/', - }, - template: '在 @{project} 发布了 @{comment}', - }, - { - id: 'trend-6', - updatedAt: new Date(), - user: { - name: '乐哥', - avatar: avatars2[5], - }, - group: { - name: '程序员日常', - link: 'http://github.com/', - }, - project: { - name: '品牌迭代', - link: 'http://github.com/', - }, - template: '在 @{group} 新建项目 @{project}', - }, - ]; - - function getFakeCaptcha(req, res) { - return res.json('captcha-xxx'); - } - - var api = { - 'GET /api/project/notice': getNotice, - 'GET /api/activities': getActivities, - 'POST /api/forms': (req, res) => { - res.send({ - message: 'Ok', - }); - }, - 'GET /api/tags': mockjs.mock({ - 'list|100': [ - { - name: '@city', - 'value|1-100': 150, - 'type|0-2': 1, - }, - ], - }), - 'GET /api/fake_list': getFakeList, - 'POST /api/fake_list': postFakeList, - 'GET /api/captcha': getFakeCaptcha, - }; - - const visitData = []; - const beginDay = new Date().getTime(); - const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]; - - for (let i = 0; i < fakeY.length; i += 1) { - visitData.push({ - x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), - y: fakeY[i], - }); - } - - const visitData2 = []; - const fakeY2 = [1, 6, 4, 8, 3, 7, 2]; - - for (let i = 0; i < fakeY2.length; i += 1) { - visitData2.push({ - x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), - y: fakeY2[i], - }); - } - - const salesData = []; - - for (let i = 0; i < 12; i += 1) { - salesData.push({ - x: `${i + 1}月`, - y: Math.floor(Math.random() * 1000) + 200, - }); - } - - const searchData = []; - - for (let i = 0; i < 50; i += 1) { - searchData.push({ - index: i + 1, - keyword: `搜索关键词-${i}`, - count: Math.floor(Math.random() * 1000), - range: Math.floor(Math.random() * 100), - status: Math.floor((Math.random() * 10) % 2), - }); - } - - const salesTypeData = [ - { - x: '家用电器', - y: 4544, - }, - { - x: '食用酒水', - y: 3321, - }, - { - x: '个护健康', - y: 3113, - }, - { - x: '服饰箱包', - y: 2341, - }, - { - x: '母婴产品', - y: 1231, - }, - { - x: '其他', - y: 1231, - }, - ]; - const salesTypeDataOnline = [ - { - x: '家用电器', - y: 244, - }, - { - x: '食用酒水', - y: 321, - }, - { - x: '个护健康', - y: 311, - }, - { - x: '服饰箱包', - y: 41, - }, - { - x: '母婴产品', - y: 121, - }, - { - x: '其他', - y: 111, - }, - ]; - const salesTypeDataOffline = [ - { - x: '家用电器', - y: 99, - }, - { - x: '食用酒水', - y: 188, - }, - { - x: '个护健康', - y: 344, - }, - { - x: '服饰箱包', - y: 255, - }, - { - x: '其他', - y: 65, - }, - ]; - const offlineData = []; - - for (let i = 0; i < 10; i += 1) { - offlineData.push({ - name: `Stores ${i}`, - cvr: Math.ceil(Math.random() * 9) / 10, - }); - } - - const offlineChartData = []; - - for (let i = 0; i < 20; i += 1) { - offlineChartData.push({ - x: new Date().getTime() + 1000 * 60 * 30 * i, - y1: Math.floor(Math.random() * 100) + 10, - y2: Math.floor(Math.random() * 100) + 10, - }); - } - - const radarOriginData = [ - { - name: '个人', - ref: 10, - koubei: 8, - output: 4, - contribute: 5, - hot: 7, - }, - { - name: '团队', - ref: 3, - koubei: 9, - output: 6, - contribute: 3, - hot: 1, - }, - { - name: '部门', - ref: 4, - koubei: 1, - output: 6, - contribute: 5, - hot: 7, - }, - ]; - const radarData = []; - const radarTitleMap = { - ref: '引用', - koubei: '口碑', - output: '产量', - contribute: '贡献', - hot: '热度', - }; - radarOriginData.forEach(item => { - Object.keys(item).forEach(key => { - if (key !== 'name') { - radarData.push({ - name: item.name, - label: radarTitleMap[key], - value: item[key], - }); - } - }); - }); - const getFakeChartData = { - visitData, - visitData2, - salesData, - searchData, - offlineData, - offlineChartData, - salesTypeData, - salesTypeDataOnline, - salesTypeDataOffline, - radarData, - }; - var chart = { - 'GET /api/fake_chart_data': getFakeChartData, - }; - - var city = { - '110000': [ - { - province: '北京市', - name: '市辖区', - id: '110100', - }, - ], - '120000': [ - { - province: '天津市', - name: '市辖区', - id: '120100', - }, - ], - '130000': [ - { - province: '河北省', - name: '石家庄市', - id: '130100', - }, - { - province: '河北省', - name: '唐山市', - id: '130200', - }, - { - province: '河北省', - name: '秦皇岛市', - id: '130300', - }, - { - province: '河北省', - name: '邯郸市', - id: '130400', - }, - { - province: '河北省', - name: '邢台市', - id: '130500', - }, - { - province: '河北省', - name: '保定市', - id: '130600', - }, - { - province: '河北省', - name: '张家口市', - id: '130700', - }, - { - province: '河北省', - name: '承德市', - id: '130800', - }, - { - province: '河北省', - name: '沧州市', - id: '130900', - }, - { - province: '河北省', - name: '廊坊市', - id: '131000', - }, - { - province: '河北省', - name: '衡水市', - id: '131100', - }, - { - province: '河北省', - name: '省直辖县级行政区划', - id: '139000', - }, - ], - '140000': [ - { - province: '山西省', - name: '太原市', - id: '140100', - }, - { - province: '山西省', - name: '大同市', - id: '140200', - }, - { - province: '山西省', - name: '阳泉市', - id: '140300', - }, - { - province: '山西省', - name: '长治市', - id: '140400', - }, - { - province: '山西省', - name: '晋城市', - id: '140500', - }, - { - province: '山西省', - name: '朔州市', - id: '140600', - }, - { - province: '山西省', - name: '晋中市', - id: '140700', - }, - { - province: '山西省', - name: '运城市', - id: '140800', - }, - { - province: '山西省', - name: '忻州市', - id: '140900', - }, - { - province: '山西省', - name: '临汾市', - id: '141000', - }, - { - province: '山西省', - name: '吕梁市', - id: '141100', - }, - ], - '150000': [ - { - province: '内蒙古自治区', - name: '呼和浩特市', - id: '150100', - }, - { - province: '内蒙古自治区', - name: '包头市', - id: '150200', - }, - { - province: '内蒙古自治区', - name: '乌海市', - id: '150300', - }, - { - province: '内蒙古自治区', - name: '赤峰市', - id: '150400', - }, - { - province: '内蒙古自治区', - name: '通辽市', - id: '150500', - }, - { - province: '内蒙古自治区', - name: '鄂尔多斯市', - id: '150600', - }, - { - province: '内蒙古自治区', - name: '呼伦贝尔市', - id: '150700', - }, - { - province: '内蒙古自治区', - name: '巴彦淖尔市', - id: '150800', - }, - { - province: '内蒙古自治区', - name: '乌兰察布市', - id: '150900', - }, - { - province: '内蒙古自治区', - name: '兴安盟', - id: '152200', - }, - { - province: '内蒙古自治区', - name: '锡林郭勒盟', - id: '152500', - }, - { - province: '内蒙古自治区', - name: '阿拉善盟', - id: '152900', - }, - ], - '210000': [ - { - province: '辽宁省', - name: '沈阳市', - id: '210100', - }, - { - province: '辽宁省', - name: '大连市', - id: '210200', - }, - { - province: '辽宁省', - name: '鞍山市', - id: '210300', - }, - { - province: '辽宁省', - name: '抚顺市', - id: '210400', - }, - { - province: '辽宁省', - name: '本溪市', - id: '210500', - }, - { - province: '辽宁省', - name: '丹东市', - id: '210600', - }, - { - province: '辽宁省', - name: '锦州市', - id: '210700', - }, - { - province: '辽宁省', - name: '营口市', - id: '210800', - }, - { - province: '辽宁省', - name: '阜新市', - id: '210900', - }, - { - province: '辽宁省', - name: '辽阳市', - id: '211000', - }, - { - province: '辽宁省', - name: '盘锦市', - id: '211100', - }, - { - province: '辽宁省', - name: '铁岭市', - id: '211200', - }, - { - province: '辽宁省', - name: '朝阳市', - id: '211300', - }, - { - province: '辽宁省', - name: '葫芦岛市', - id: '211400', - }, - ], - '220000': [ - { - province: '吉林省', - name: '长春市', - id: '220100', - }, - { - province: '吉林省', - name: '吉林市', - id: '220200', - }, - { - province: '吉林省', - name: '四平市', - id: '220300', - }, - { - province: '吉林省', - name: '辽源市', - id: '220400', - }, - { - province: '吉林省', - name: '通化市', - id: '220500', - }, - { - province: '吉林省', - name: '白山市', - id: '220600', - }, - { - province: '吉林省', - name: '松原市', - id: '220700', - }, - { - province: '吉林省', - name: '白城市', - id: '220800', - }, - { - province: '吉林省', - name: '延边朝鲜族自治州', - id: '222400', - }, - ], - '230000': [ - { - province: '黑龙江省', - name: '哈尔滨市', - id: '230100', - }, - { - province: '黑龙江省', - name: '齐齐哈尔市', - id: '230200', - }, - { - province: '黑龙江省', - name: '鸡西市', - id: '230300', - }, - { - province: '黑龙江省', - name: '鹤岗市', - id: '230400', - }, - { - province: '黑龙江省', - name: '双鸭山市', - id: '230500', - }, - { - province: '黑龙江省', - name: '大庆市', - id: '230600', - }, - { - province: '黑龙江省', - name: '伊春市', - id: '230700', - }, - { - province: '黑龙江省', - name: '佳木斯市', - id: '230800', - }, - { - province: '黑龙江省', - name: '七台河市', - id: '230900', - }, - { - province: '黑龙江省', - name: '牡丹江市', - id: '231000', - }, - { - province: '黑龙江省', - name: '黑河市', - id: '231100', - }, - { - province: '黑龙江省', - name: '绥化市', - id: '231200', - }, - { - province: '黑龙江省', - name: '大兴安岭地区', - id: '232700', - }, - ], - '310000': [ - { - province: '上海市', - name: '市辖区', - id: '310100', - }, - ], - '320000': [ - { - province: '江苏省', - name: '南京市', - id: '320100', - }, - { - province: '江苏省', - name: '无锡市', - id: '320200', - }, - { - province: '江苏省', - name: '徐州市', - id: '320300', - }, - { - province: '江苏省', - name: '常州市', - id: '320400', - }, - { - province: '江苏省', - name: '苏州市', - id: '320500', - }, - { - province: '江苏省', - name: '南通市', - id: '320600', - }, - { - province: '江苏省', - name: '连云港市', - id: '320700', - }, - { - province: '江苏省', - name: '淮安市', - id: '320800', - }, - { - province: '江苏省', - name: '盐城市', - id: '320900', - }, - { - province: '江苏省', - name: '扬州市', - id: '321000', - }, - { - province: '江苏省', - name: '镇江市', - id: '321100', - }, - { - province: '江苏省', - name: '泰州市', - id: '321200', - }, - { - province: '江苏省', - name: '宿迁市', - id: '321300', - }, - ], - '330000': [ - { - province: '浙江省', - name: '杭州市', - id: '330100', - }, - { - province: '浙江省', - name: '宁波市', - id: '330200', - }, - { - province: '浙江省', - name: '温州市', - id: '330300', - }, - { - province: '浙江省', - name: '嘉兴市', - id: '330400', - }, - { - province: '浙江省', - name: '湖州市', - id: '330500', - }, - { - province: '浙江省', - name: '绍兴市', - id: '330600', - }, - { - province: '浙江省', - name: '金华市', - id: '330700', - }, - { - province: '浙江省', - name: '衢州市', - id: '330800', - }, - { - province: '浙江省', - name: '舟山市', - id: '330900', - }, - { - province: '浙江省', - name: '台州市', - id: '331000', - }, - { - province: '浙江省', - name: '丽水市', - id: '331100', - }, - ], - '340000': [ - { - province: '安徽省', - name: '合肥市', - id: '340100', - }, - { - province: '安徽省', - name: '芜湖市', - id: '340200', - }, - { - province: '安徽省', - name: '蚌埠市', - id: '340300', - }, - { - province: '安徽省', - name: '淮南市', - id: '340400', - }, - { - province: '安徽省', - name: '马鞍山市', - id: '340500', - }, - { - province: '安徽省', - name: '淮北市', - id: '340600', - }, - { - province: '安徽省', - name: '铜陵市', - id: '340700', - }, - { - province: '安徽省', - name: '安庆市', - id: '340800', - }, - { - province: '安徽省', - name: '黄山市', - id: '341000', - }, - { - province: '安徽省', - name: '滁州市', - id: '341100', - }, - { - province: '安徽省', - name: '阜阳市', - id: '341200', - }, - { - province: '安徽省', - name: '宿州市', - id: '341300', - }, - { - province: '安徽省', - name: '六安市', - id: '341500', - }, - { - province: '安徽省', - name: '亳州市', - id: '341600', - }, - { - province: '安徽省', - name: '池州市', - id: '341700', - }, - { - province: '安徽省', - name: '宣城市', - id: '341800', - }, - ], - '350000': [ - { - province: '福建省', - name: '福州市', - id: '350100', - }, - { - province: '福建省', - name: '厦门市', - id: '350200', - }, - { - province: '福建省', - name: '莆田市', - id: '350300', - }, - { - province: '福建省', - name: '三明市', - id: '350400', - }, - { - province: '福建省', - name: '泉州市', - id: '350500', - }, - { - province: '福建省', - name: '漳州市', - id: '350600', - }, - { - province: '福建省', - name: '南平市', - id: '350700', - }, - { - province: '福建省', - name: '龙岩市', - id: '350800', - }, - { - province: '福建省', - name: '宁德市', - id: '350900', - }, - ], - '360000': [ - { - province: '江西省', - name: '南昌市', - id: '360100', - }, - { - province: '江西省', - name: '景德镇市', - id: '360200', - }, - { - province: '江西省', - name: '萍乡市', - id: '360300', - }, - { - province: '江西省', - name: '九江市', - id: '360400', - }, - { - province: '江西省', - name: '新余市', - id: '360500', - }, - { - province: '江西省', - name: '鹰潭市', - id: '360600', - }, - { - province: '江西省', - name: '赣州市', - id: '360700', - }, - { - province: '江西省', - name: '吉安市', - id: '360800', - }, - { - province: '江西省', - name: '宜春市', - id: '360900', - }, - { - province: '江西省', - name: '抚州市', - id: '361000', - }, - { - province: '江西省', - name: '上饶市', - id: '361100', - }, - ], - '370000': [ - { - province: '山东省', - name: '济南市', - id: '370100', - }, - { - province: '山东省', - name: '青岛市', - id: '370200', - }, - { - province: '山东省', - name: '淄博市', - id: '370300', - }, - { - province: '山东省', - name: '枣庄市', - id: '370400', - }, - { - province: '山东省', - name: '东营市', - id: '370500', - }, - { - province: '山东省', - name: '烟台市', - id: '370600', - }, - { - province: '山东省', - name: '潍坊市', - id: '370700', - }, - { - province: '山东省', - name: '济宁市', - id: '370800', - }, - { - province: '山东省', - name: '泰安市', - id: '370900', - }, - { - province: '山东省', - name: '威海市', - id: '371000', - }, - { - province: '山东省', - name: '日照市', - id: '371100', - }, - { - province: '山东省', - name: '莱芜市', - id: '371200', - }, - { - province: '山东省', - name: '临沂市', - id: '371300', - }, - { - province: '山东省', - name: '德州市', - id: '371400', - }, - { - province: '山东省', - name: '聊城市', - id: '371500', - }, - { - province: '山东省', - name: '滨州市', - id: '371600', - }, - { - province: '山东省', - name: '菏泽市', - id: '371700', - }, - ], - '410000': [ - { - province: '河南省', - name: '郑州市', - id: '410100', - }, - { - province: '河南省', - name: '开封市', - id: '410200', - }, - { - province: '河南省', - name: '洛阳市', - id: '410300', - }, - { - province: '河南省', - name: '平顶山市', - id: '410400', - }, - { - province: '河南省', - name: '安阳市', - id: '410500', - }, - { - province: '河南省', - name: '鹤壁市', - id: '410600', - }, - { - province: '河南省', - name: '新乡市', - id: '410700', - }, - { - province: '河南省', - name: '焦作市', - id: '410800', - }, - { - province: '河南省', - name: '濮阳市', - id: '410900', - }, - { - province: '河南省', - name: '许昌市', - id: '411000', - }, - { - province: '河南省', - name: '漯河市', - id: '411100', - }, - { - province: '河南省', - name: '三门峡市', - id: '411200', - }, - { - province: '河南省', - name: '南阳市', - id: '411300', - }, - { - province: '河南省', - name: '商丘市', - id: '411400', - }, - { - province: '河南省', - name: '信阳市', - id: '411500', - }, - { - province: '河南省', - name: '周口市', - id: '411600', - }, - { - province: '河南省', - name: '驻马店市', - id: '411700', - }, - { - province: '河南省', - name: '省直辖县级行政区划', - id: '419000', - }, - ], - '420000': [ - { - province: '湖北省', - name: '武汉市', - id: '420100', - }, - { - province: '湖北省', - name: '黄石市', - id: '420200', - }, - { - province: '湖北省', - name: '十堰市', - id: '420300', - }, - { - province: '湖北省', - name: '宜昌市', - id: '420500', - }, - { - province: '湖北省', - name: '襄阳市', - id: '420600', - }, - { - province: '湖北省', - name: '鄂州市', - id: '420700', - }, - { - province: '湖北省', - name: '荆门市', - id: '420800', - }, - { - province: '湖北省', - name: '孝感市', - id: '420900', - }, - { - province: '湖北省', - name: '荆州市', - id: '421000', - }, - { - province: '湖北省', - name: '黄冈市', - id: '421100', - }, - { - province: '湖北省', - name: '咸宁市', - id: '421200', - }, - { - province: '湖北省', - name: '随州市', - id: '421300', - }, - { - province: '湖北省', - name: '恩施土家族苗族自治州', - id: '422800', - }, - { - province: '湖北省', - name: '省直辖县级行政区划', - id: '429000', - }, - ], - '430000': [ - { - province: '湖南省', - name: '长沙市', - id: '430100', - }, - { - province: '湖南省', - name: '株洲市', - id: '430200', - }, - { - province: '湖南省', - name: '湘潭市', - id: '430300', - }, - { - province: '湖南省', - name: '衡阳市', - id: '430400', - }, - { - province: '湖南省', - name: '邵阳市', - id: '430500', - }, - { - province: '湖南省', - name: '岳阳市', - id: '430600', - }, - { - province: '湖南省', - name: '常德市', - id: '430700', - }, - { - province: '湖南省', - name: '张家界市', - id: '430800', - }, - { - province: '湖南省', - name: '益阳市', - id: '430900', - }, - { - province: '湖南省', - name: '郴州市', - id: '431000', - }, - { - province: '湖南省', - name: '永州市', - id: '431100', - }, - { - province: '湖南省', - name: '怀化市', - id: '431200', - }, - { - province: '湖南省', - name: '娄底市', - id: '431300', - }, - { - province: '湖南省', - name: '湘西土家族苗族自治州', - id: '433100', - }, - ], - '440000': [ - { - province: '广东省', - name: '广州市', - id: '440100', - }, - { - province: '广东省', - name: '韶关市', - id: '440200', - }, - { - province: '广东省', - name: '深圳市', - id: '440300', - }, - { - province: '广东省', - name: '珠海市', - id: '440400', - }, - { - province: '广东省', - name: '汕头市', - id: '440500', - }, - { - province: '广东省', - name: '佛山市', - id: '440600', - }, - { - province: '广东省', - name: '江门市', - id: '440700', - }, - { - province: '广东省', - name: '湛江市', - id: '440800', - }, - { - province: '广东省', - name: '茂名市', - id: '440900', - }, - { - province: '广东省', - name: '肇庆市', - id: '441200', - }, - { - province: '广东省', - name: '惠州市', - id: '441300', - }, - { - province: '广东省', - name: '梅州市', - id: '441400', - }, - { - province: '广东省', - name: '汕尾市', - id: '441500', - }, - { - province: '广东省', - name: '河源市', - id: '441600', - }, - { - province: '广东省', - name: '阳江市', - id: '441700', - }, - { - province: '广东省', - name: '清远市', - id: '441800', - }, - { - province: '广东省', - name: '东莞市', - id: '441900', - }, - { - province: '广东省', - name: '中山市', - id: '442000', - }, - { - province: '广东省', - name: '潮州市', - id: '445100', - }, - { - province: '广东省', - name: '揭阳市', - id: '445200', - }, - { - province: '广东省', - name: '云浮市', - id: '445300', - }, - ], - '450000': [ - { - province: '广西壮族自治区', - name: '南宁市', - id: '450100', - }, - { - province: '广西壮族自治区', - name: '柳州市', - id: '450200', - }, - { - province: '广西壮族自治区', - name: '桂林市', - id: '450300', - }, - { - province: '广西壮族自治区', - name: '梧州市', - id: '450400', - }, - { - province: '广西壮族自治区', - name: '北海市', - id: '450500', - }, - { - province: '广西壮族自治区', - name: '防城港市', - id: '450600', - }, - { - province: '广西壮族自治区', - name: '钦州市', - id: '450700', - }, - { - province: '广西壮族自治区', - name: '贵港市', - id: '450800', - }, - { - province: '广西壮族自治区', - name: '玉林市', - id: '450900', - }, - { - province: '广西壮族自治区', - name: '百色市', - id: '451000', - }, - { - province: '广西壮族自治区', - name: '贺州市', - id: '451100', - }, - { - province: '广西壮族自治区', - name: '河池市', - id: '451200', - }, - { - province: '广西壮族自治区', - name: '来宾市', - id: '451300', - }, - { - province: '广西壮族自治区', - name: '崇左市', - id: '451400', - }, - ], - '460000': [ - { - province: '海南省', - name: '海口市', - id: '460100', - }, - { - province: '海南省', - name: '三亚市', - id: '460200', - }, - { - province: '海南省', - name: '三沙市', - id: '460300', - }, - { - province: '海南省', - name: '儋州市', - id: '460400', - }, - { - province: '海南省', - name: '省直辖县级行政区划', - id: '469000', - }, - ], - '500000': [ - { - province: '重庆市', - name: '市辖区', - id: '500100', - }, - { - province: '重庆市', - name: '县', - id: '500200', - }, - ], - '510000': [ - { - province: '四川省', - name: '成都市', - id: '510100', - }, - { - province: '四川省', - name: '自贡市', - id: '510300', - }, - { - province: '四川省', - name: '攀枝花市', - id: '510400', - }, - { - province: '四川省', - name: '泸州市', - id: '510500', - }, - { - province: '四川省', - name: '德阳市', - id: '510600', - }, - { - province: '四川省', - name: '绵阳市', - id: '510700', - }, - { - province: '四川省', - name: '广元市', - id: '510800', - }, - { - province: '四川省', - name: '遂宁市', - id: '510900', - }, - { - province: '四川省', - name: '内江市', - id: '511000', - }, - { - province: '四川省', - name: '乐山市', - id: '511100', - }, - { - province: '四川省', - name: '南充市', - id: '511300', - }, - { - province: '四川省', - name: '眉山市', - id: '511400', - }, - { - province: '四川省', - name: '宜宾市', - id: '511500', - }, - { - province: '四川省', - name: '广安市', - id: '511600', - }, - { - province: '四川省', - name: '达州市', - id: '511700', - }, - { - province: '四川省', - name: '雅安市', - id: '511800', - }, - { - province: '四川省', - name: '巴中市', - id: '511900', - }, - { - province: '四川省', - name: '资阳市', - id: '512000', - }, - { - province: '四川省', - name: '阿坝藏族羌族自治州', - id: '513200', - }, - { - province: '四川省', - name: '甘孜藏族自治州', - id: '513300', - }, - { - province: '四川省', - name: '凉山彝族自治州', - id: '513400', - }, - ], - '520000': [ - { - province: '贵州省', - name: '贵阳市', - id: '520100', - }, - { - province: '贵州省', - name: '六盘水市', - id: '520200', - }, - { - province: '贵州省', - name: '遵义市', - id: '520300', - }, - { - province: '贵州省', - name: '安顺市', - id: '520400', - }, - { - province: '贵州省', - name: '毕节市', - id: '520500', - }, - { - province: '贵州省', - name: '铜仁市', - id: '520600', - }, - { - province: '贵州省', - name: '黔西南布依族苗族自治州', - id: '522300', - }, - { - province: '贵州省', - name: '黔东南苗族侗族自治州', - id: '522600', - }, - { - province: '贵州省', - name: '黔南布依族苗族自治州', - id: '522700', - }, - ], - '530000': [ - { - province: '云南省', - name: '昆明市', - id: '530100', - }, - { - province: '云南省', - name: '曲靖市', - id: '530300', - }, - { - province: '云南省', - name: '玉溪市', - id: '530400', - }, - { - province: '云南省', - name: '保山市', - id: '530500', - }, - { - province: '云南省', - name: '昭通市', - id: '530600', - }, - { - province: '云南省', - name: '丽江市', - id: '530700', - }, - { - province: '云南省', - name: '普洱市', - id: '530800', - }, - { - province: '云南省', - name: '临沧市', - id: '530900', - }, - { - province: '云南省', - name: '楚雄彝族自治州', - id: '532300', - }, - { - province: '云南省', - name: '红河哈尼族彝族自治州', - id: '532500', - }, - { - province: '云南省', - name: '文山壮族苗族自治州', - id: '532600', - }, - { - province: '云南省', - name: '西双版纳傣族自治州', - id: '532800', - }, - { - province: '云南省', - name: '大理白族自治州', - id: '532900', - }, - { - province: '云南省', - name: '德宏傣族景颇族自治州', - id: '533100', - }, - { - province: '云南省', - name: '怒江傈僳族自治州', - id: '533300', - }, - { - province: '云南省', - name: '迪庆藏族自治州', - id: '533400', - }, - ], - '540000': [ - { - province: '西藏自治区', - name: '拉萨市', - id: '540100', - }, - { - province: '西藏自治区', - name: '日喀则市', - id: '540200', - }, - { - province: '西藏自治区', - name: '昌都市', - id: '540300', - }, - { - province: '西藏自治区', - name: '林芝市', - id: '540400', - }, - { - province: '西藏自治区', - name: '山南市', - id: '540500', - }, - { - province: '西藏自治区', - name: '那曲地区', - id: '542400', - }, - { - province: '西藏自治区', - name: '阿里地区', - id: '542500', - }, - ], - '610000': [ - { - province: '陕西省', - name: '西安市', - id: '610100', - }, - { - province: '陕西省', - name: '铜川市', - id: '610200', - }, - { - province: '陕西省', - name: '宝鸡市', - id: '610300', - }, - { - province: '陕西省', - name: '咸阳市', - id: '610400', - }, - { - province: '陕西省', - name: '渭南市', - id: '610500', - }, - { - province: '陕西省', - name: '延安市', - id: '610600', - }, - { - province: '陕西省', - name: '汉中市', - id: '610700', - }, - { - province: '陕西省', - name: '榆林市', - id: '610800', - }, - { - province: '陕西省', - name: '安康市', - id: '610900', - }, - { - province: '陕西省', - name: '商洛市', - id: '611000', - }, - ], - '620000': [ - { - province: '甘肃省', - name: '兰州市', - id: '620100', - }, - { - province: '甘肃省', - name: '嘉峪关市', - id: '620200', - }, - { - province: '甘肃省', - name: '金昌市', - id: '620300', - }, - { - province: '甘肃省', - name: '白银市', - id: '620400', - }, - { - province: '甘肃省', - name: '天水市', - id: '620500', - }, - { - province: '甘肃省', - name: '武威市', - id: '620600', - }, - { - province: '甘肃省', - name: '张掖市', - id: '620700', - }, - { - province: '甘肃省', - name: '平凉市', - id: '620800', - }, - { - province: '甘肃省', - name: '酒泉市', - id: '620900', - }, - { - province: '甘肃省', - name: '庆阳市', - id: '621000', - }, - { - province: '甘肃省', - name: '定西市', - id: '621100', - }, - { - province: '甘肃省', - name: '陇南市', - id: '621200', - }, - { - province: '甘肃省', - name: '临夏回族自治州', - id: '622900', - }, - { - province: '甘肃省', - name: '甘南藏族自治州', - id: '623000', - }, - ], - '630000': [ - { - province: '青海省', - name: '西宁市', - id: '630100', - }, - { - province: '青海省', - name: '海东市', - id: '630200', - }, - { - province: '青海省', - name: '海北藏族自治州', - id: '632200', - }, - { - province: '青海省', - name: '黄南藏族自治州', - id: '632300', - }, - { - province: '青海省', - name: '海南藏族自治州', - id: '632500', - }, - { - province: '青海省', - name: '果洛藏族自治州', - id: '632600', - }, - { - province: '青海省', - name: '玉树藏族自治州', - id: '632700', - }, - { - province: '青海省', - name: '海西蒙古族藏族自治州', - id: '632800', - }, - ], - '640000': [ - { - province: '宁夏回族自治区', - name: '银川市', - id: '640100', - }, - { - province: '宁夏回族自治区', - name: '石嘴山市', - id: '640200', - }, - { - province: '宁夏回族自治区', - name: '吴忠市', - id: '640300', - }, - { - province: '宁夏回族自治区', - name: '固原市', - id: '640400', - }, - { - province: '宁夏回族自治区', - name: '中卫市', - id: '640500', - }, - ], - '650000': [ - { - province: '新疆维吾尔自治区', - name: '乌鲁木齐市', - id: '650100', - }, - { - province: '新疆维吾尔自治区', - name: '克拉玛依市', - id: '650200', - }, - { - province: '新疆维吾尔自治区', - name: '吐鲁番市', - id: '650400', - }, - { - province: '新疆维吾尔自治区', - name: '哈密市', - id: '650500', - }, - { - province: '新疆维吾尔自治区', - name: '昌吉回族自治州', - id: '652300', - }, - { - province: '新疆维吾尔自治区', - name: '博尔塔拉蒙古自治州', - id: '652700', - }, - { - province: '新疆维吾尔自治区', - name: '巴音郭楞蒙古自治州', - id: '652800', - }, - { - province: '新疆维吾尔自治区', - name: '阿克苏地区', - id: '652900', - }, - { - province: '新疆维吾尔自治区', - name: '克孜勒苏柯尔克孜自治州', - id: '653000', - }, - { - province: '新疆维吾尔自治区', - name: '喀什地区', - id: '653100', - }, - { - province: '新疆维吾尔自治区', - name: '和田地区', - id: '653200', - }, - { - province: '新疆维吾尔自治区', - name: '伊犁哈萨克自治州', - id: '654000', - }, - { - province: '新疆维吾尔自治区', - name: '塔城地区', - id: '654200', - }, - { - province: '新疆维吾尔自治区', - name: '阿勒泰地区', - id: '654300', - }, - { - province: '新疆维吾尔自治区', - name: '自治区直辖县级行政区划', - id: '659000', - }, - ], - }; - - var province = [ - { - name: '北京市', - id: '110000', - }, - { - name: '天津市', - id: '120000', - }, - { - name: '河北省', - id: '130000', - }, - { - name: '山西省', - id: '140000', - }, - { - name: '内蒙古自治区', - id: '150000', - }, - { - name: '辽宁省', - id: '210000', - }, - { - name: '吉林省', - id: '220000', - }, - { - name: '黑龙江省', - id: '230000', - }, - { - name: '上海市', - id: '310000', - }, - { - name: '江苏省', - id: '320000', - }, - { - name: '浙江省', - id: '330000', - }, - { - name: '安徽省', - id: '340000', - }, - { - name: '福建省', - id: '350000', - }, - { - name: '江西省', - id: '360000', - }, - { - name: '山东省', - id: '370000', - }, - { - name: '河南省', - id: '410000', - }, - { - name: '湖北省', - id: '420000', - }, - { - name: '湖南省', - id: '430000', - }, - { - name: '广东省', - id: '440000', - }, - { - name: '广西壮族自治区', - id: '450000', - }, - { - name: '海南省', - id: '460000', - }, - { - name: '重庆市', - id: '500000', - }, - { - name: '四川省', - id: '510000', - }, - { - name: '贵州省', - id: '520000', - }, - { - name: '云南省', - id: '530000', - }, - { - name: '西藏自治区', - id: '540000', - }, - { - name: '陕西省', - id: '610000', - }, - { - name: '甘肃省', - id: '620000', - }, - { - name: '青海省', - id: '630000', - }, - { - name: '宁夏回族自治区', - id: '640000', - }, - { - name: '新疆维吾尔自治区', - id: '650000', - }, - { - name: '台湾省', - id: '710000', - }, - { - name: '香港特别行政区', - id: '810000', - }, - { - name: '澳门特别行政区', - id: '820000', - }, - ]; - function getProvince(req, res) { - return res.json(province); - } - - function getCity(req, res) { - return res.json(city[req.params.province]); - } - - var geographic = { - 'GET /api/geographic/province': getProvince, - 'GET /api/geographic/city/:province': getCity, - }; - - const getNotices = (req, res) => - res.json([ - { - id: '000000001', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '你收到了 14 份新周报', - datetime: '2017-08-09', - type: 'notification', - }, - { - id: '000000002', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', - title: '你推荐的 曲妮妮 已通过第三轮面试', - datetime: '2017-08-08', - type: 'notification', - }, - { - id: '000000003', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', - title: '这种模板可以区分多种通知类型', - datetime: '2017-08-07', - read: true, - type: 'notification', - }, - { - id: '000000004', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', - title: '左侧图标用于区分不同的类型', - datetime: '2017-08-07', - type: 'notification', - }, - { - id: '000000005', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '内容不要超过两行字,超出时自动截断', - datetime: '2017-08-07', - type: 'notification', - }, - { - id: '000000006', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '曲丽丽 评论了你', - description: '描述信息描述信息描述信息', - datetime: '2017-08-07', - type: 'message', - clickClose: true, - }, - { - id: '000000007', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '朱偏右 回复了你', - description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: '2017-08-07', - type: 'message', - clickClose: true, - }, - { - id: '000000008', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '标题', - description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: '2017-08-07', - type: 'message', - clickClose: true, - }, - { - id: '000000009', - title: '任务名称', - description: '任务需要在 2017-01-12 20:00 前启动', - extra: '未开始', - status: 'todo', - type: 'event', - }, - { - id: '000000010', - title: '第三方紧急代码变更', - description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', - extra: '马上到期', - status: 'urgent', - type: 'event', - }, - { - id: '000000011', - title: '信息安全考试', - description: '指派竹尔于 2017-01-09 前完成更新并发布', - extra: '已耗时 8 天', - status: 'doing', - type: 'event', - }, - { - id: '000000012', - title: 'ABCD 版本发布', - description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', - extra: '进行中', - status: 'processing', - type: 'event', - }, - ]); - - var notices = { - 'GET /api/notices': getNotices, - }; - - const basicGoods = [ - { - id: '1234561', - name: '矿泉水 550ml', - barcode: '12421432143214321', - price: '2.00', - num: '1', - amount: '2.00', - }, - { - id: '1234562', - name: '凉茶 300ml', - barcode: '12421432143214322', - price: '3.00', - num: '2', - amount: '6.00', - }, - { - id: '1234563', - name: '好吃的薯片', - barcode: '12421432143214323', - price: '7.00', - num: '4', - amount: '28.00', - }, - { - id: '1234564', - name: '特别好吃的蛋卷', - barcode: '12421432143214324', - price: '8.50', - num: '3', - amount: '25.50', - }, - ]; - const basicProgress = [ - { - key: '1', - time: '2017-10-01 14:10', - rate: '联系客户', - status: 'processing', - operator: '取货员 ID1234', - cost: '5mins', - }, - { - key: '2', - time: '2017-10-01 14:05', - rate: '取货员出发', - status: 'success', - operator: '取货员 ID1234', - cost: '1h', - }, - { - key: '3', - time: '2017-10-01 13:05', - rate: '取货员接单', - status: 'success', - operator: '取货员 ID1234', - cost: '5mins', - }, - { - key: '4', - time: '2017-10-01 13:00', - rate: '申请审批通过', - status: 'success', - operator: '系统', - cost: '1h', - }, - { - key: '5', - time: '2017-10-01 12:00', - rate: '发起退货申请', - status: 'success', - operator: '用户', - cost: '5mins', - }, - ]; - const advancedOperation1 = [ - { - key: 'op1', - type: '订购关系生效', - name: '曲丽丽', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - memo: '-', - }, - { - key: 'op2', - type: '财务复审', - name: '付小小', - status: 'reject', - updatedAt: '2017-10-03 19:23:12', - memo: '不通过原因', - }, - { - key: 'op3', - type: '部门初审', - name: '周毛毛', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - memo: '-', - }, - { - key: 'op4', - type: '提交订单', - name: '林东东', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - memo: '很棒', - }, - { - key: 'op5', - type: '创建订单', - name: '汗牙牙', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - memo: '-', - }, - ]; - const advancedOperation2 = [ - { - key: 'op1', - type: '订购关系生效', - name: '曲丽丽', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - memo: '-', - }, - ]; - const advancedOperation3 = [ - { - key: 'op1', - type: '创建订单', - name: '汗牙牙', - status: 'agree', - updatedAt: '2017-10-03 19:23:12', - memo: '-', - }, - ]; - const getProfileAdvancedData = { - advancedOperation1, - advancedOperation2, - advancedOperation3, - }; - const { Random } = mockjs; - var profile = { - 'GET /api/profile/advanced': getProfileAdvancedData, - 'GET /api/profile/basic': (req, res) => { - const { id } = req.query; - const application = { - id, - status: '已取货', - orderNo: Random.id(), - childOrderNo: Random.id(), - }; - const userInfo = { - name: Random.cname(), - tel: '18100000000', - delivery: '菜鸟物流', - addr: '浙江省杭州市西湖区万塘路18号', - remark: '备注', - }; - res.json({ - userInfo, - application, - basicGoods, - basicProgress, - }); - }, - }; - - /*! https://mths.be/punycode v1.4.1 by @mathias */ - - /** Highest positive signed 32-bit float value */ - var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - - /** Bootstring parameters */ - - var base = 36; - var tMin = 1; - var tMax = 26; - var skew = 38; - var damp = 700; - var initialBias = 72; - var initialN = 128; // 0x80 - - var delimiter = '-'; // '\x2D' - var regexNonASCII = /[^\x20-\x7E]/; // unprintable ASCII chars + non-ASCII chars - - var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - - /** Error messages */ - - var errors = { - overflow: 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input', - }; - /** Convenience shortcuts */ - - var baseMinusTMin = base - tMin; - var floor = Math.floor; - var stringFromCharCode = String.fromCharCode; - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - - function error(type) { - throw new RangeError(errors[type]); - } - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - - function map(array, fn) { - var length = array.length; - var result = []; - - while (length--) { - result[length] = fn(array[length]); - } - - return result; - } - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } // Avoid `split(regex)` for IE8 compatibility. See #17. - - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - - while (counter < length) { - value = string.charCodeAt(counter++); - - if (value >= 0xd800 && value <= 0xdbff && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - - if ((extra & 0xfc00) == 0xdc00) { - // low surrogate - output.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - - return output; - } - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - - for ( - ; - /* no initialization */ - delta > (baseMinusTMin * tMax) >> 1; - k += base - ) { - delta = floor(delta / baseMinusTMin); - } - - return floor(k + ((baseMinusTMin + 1) * delta) / (delta + skew)); - } - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; // Convert the input in UCS-2 to Unicode - - input = ucs2decode(input); // Cache the length - - inputLength = input.length; // Initialize the state - - n = initialN; - delta = 0; - bias = initialBias; // Handle the basic code points - - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - - handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - // Finish the basic string - if it is not empty - with a delimiter - - if (basicLength) { - output.push(delimiter); - } // Main encoding loop: - - while (handledCPCount < inputLength) { - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - - handledCPCountPlusOne = handledCPCount + 1; - - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - - delta += (m - n) * handledCPCountPlusOne; - n = m; - - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } - - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for ( - q = delta, k = base; - ; - /* no condition */ - k += base - ) { - t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; - - if (q < t) { - break; - } - - qMinusT = q - t; - baseMinusT = base - t; - output.push(stringFromCharCode(digitToBasic(t + (qMinusT % baseMinusT), 0))); - q = floor(qMinusT / baseMinusT); - } - - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } - - ++delta; - ++n; - } - - return output.join(''); - } - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; - }); - } - - // shim for using process in browser - - if (typeof global.setTimeout === 'function'); - - if (typeof global.clearTimeout === 'function'); - - var performance = global.performance || {}; - - var performanceNow = - performance.now || - performance.mozNow || - performance.msNow || - performance.oNow || - performance.webkitNow || - function() { - return new Date().getTime(); - }; // generate timestamp or delta - - // Copyright Joyent, Inc. and other Node contributors. - function isNull(arg) { - return arg === null; - } - function isNullOrUndefined(arg) { - return arg == null; - } - function isString(arg) { - return typeof arg === 'string'; - } - function isObject(arg) { - return typeof arg === 'object' && arg !== null; - } - - // Copyright Joyent, Inc. and other Node contributors. - // - // Permission is hereby granted, free of charge, to any person obtaining a - // copy of this software and associated documentation files (the - // "Software"), to deal in the Software without restriction, including - // without limitation the rights to use, copy, modify, merge, publish, - // distribute, sublicense, and/or sell copies of the Software, and to permit - // persons to whom the Software is furnished to do so, subject to the - // following conditions: - // - // The above copyright notice and this permission notice shall be included - // in all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - // If obj.hasOwnProperty has been overridden, then calling - // obj.hasOwnProperty(prop) will break. - // See: https://github.com/joyent/node/issues/1707 - function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - var isArray = - Array.isArray || - function(xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; - }; - - function stringifyPrimitive(v) { - switch (typeof v) { - case 'string': - return v; - - case 'boolean': - return v ? 'true' : 'false'; - - case 'number': - return isFinite(v) ? v : ''; - - default: - return ''; - } - } - - function stringify(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - - if (obj === null) { - obj = undefined; - } - - if (typeof obj === 'object') { - return map$1(objectKeys(obj), function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - - if (isArray(obj[k])) { - return map$1(obj[k], function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); - } - - if (!name) return ''; - return ( - encodeURIComponent(stringifyPrimitive(name)) + - eq + - encodeURIComponent(stringifyPrimitive(obj)) - ); - } - - function map$1(xs, f) { - if (xs.map) return xs.map(f); - var res = []; - - for (var i = 0; i < xs.length; i++) { - res.push(f(xs[i], i)); - } - - return res; - } - - var objectKeys = - Object.keys || - function(obj) { - var res = []; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); - } - - return res; - }; - - function parse(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - var maxKeys = 1000; - - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; // maxKeys <= 0 means that we should not limit keys count - - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, - vstr, - k, - v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); - - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; - } - - // Copyright Joyent, Inc. and other Node contributors. - function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.host = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.query = null; - this.pathname = null; - this.path = null; - this.href = null; - } // Reference: RFC 3986, RFC 1808, RFC 2396 - // define these here so at least they only have to be - // compiled once on the first module load. - - var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - // Special case for a simple path URL - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - // RFC 2396: characters reserved for delimiting URLs. - // We actually just auto-escape these. - delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], - // RFC 2396: characters not allowed for various reasons. - unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), - // Allowed by RFCs, but cause of XSS attacks. Always escape these. - autoEscape = ["'"].concat(unwise), - // Characters that are never ever allowed in a hostname. - // Note that any invalid chars are also handled, but these - // are the ones that are *expected* to be seen, so we fast-path - // them. - nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), - hostEndingChars = ['/', '?', '#'], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. - unsafeProtocol = { - javascript: true, - 'javascript:': true, - }, - // protocols that never have a hostname. - hostlessProtocol = { - javascript: true, - 'javascript:': true, - }, - // protocols that always contain a // bit. - slashedProtocol = { - http: true, - https: true, - ftp: true, - gopher: true, - file: true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true, - }; - - function urlParse(url, parseQueryString, slashesDenoteHost) { - if (url && isObject(url) && url instanceof Url) return url; - var u = new Url(); - u.parse(url, parseQueryString, slashesDenoteHost); - return u; - } - - Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { - return parse$1(this, url, parseQueryString, slashesDenoteHost); - }; - - function parse$1(self, url, parseQueryString, slashesDenoteHost) { - if (!isString(url)) { - throw new TypeError("Parameter 'url' must be a string, not " + typeof url); - } // Copy chrome, IE, opera backslash-handling behavior. - // Back slashes before the query string get converted to forward slashes - // See: https://code.google.com/p/chromium/issues/detail?id=25916 - - var queryIndex = url.indexOf('?'), - splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#', - uSplit = url.split(splitter), - slashRegex = /\\/g; - uSplit[0] = uSplit[0].replace(slashRegex, '/'); - url = uSplit.join(splitter); - var rest = url; // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - - rest = rest.trim(); - - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); - - if (simplePath) { - self.path = rest; - self.href = rest; - self.pathname = simplePath[1]; - - if (simplePath[2]) { - self.search = simplePath[2]; - - if (parseQueryString) { - self.query = parse(self.search.substr(1)); - } else { - self.query = self.search.substr(1); - } - } else if (parseQueryString) { - self.search = ''; - self.query = {}; - } - - return self; - } - } - - var proto = protocolPattern.exec(rest); - - if (proto) { - proto = proto[0]; - var lowerProto = proto.toLowerCase(); - self.protocol = lowerProto; - rest = rest.substr(proto.length); - } // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - var slashes = rest.substr(0, 2) === '//'; - - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - self.slashes = true; - } - } - - var i, hec, l, p; - - if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. - // find the first instance of any hostEndingChars - var hostEnd = -1; - - for (i = 0; i < hostEndingChars.length; i++) { - hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; - } // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - - var auth, atSign; - - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); - } // Now we have a portion which is definitely the auth. - // Pull that off. - - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - self.auth = decodeURIComponent(auth); - } // the host is the remaining to the left of the first non-host char - - hostEnd = -1; - - for (i = 0; i < nonHostChars.length; i++) { - hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; - } // if we still have not hit it, then the entire thing is a host. - - if (hostEnd === -1) hostEnd = rest.length; - self.host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); // pull out port. - - parseHost(self); // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - - self.hostname = self.hostname || ''; // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - - var ipv6Hostname = - self.hostname[0] === '[' && self.hostname[self.hostname.length - 1] === ']'; // validate a little. - - if (!ipv6Hostname) { - var hostparts = self.hostname.split(/\./); - - for (i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) continue; - - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } // we test again with ASCII char only - - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - - if (notHost.length) { - rest = '/' + notHost.join('.') + rest; - } - - self.hostname = validParts.join('.'); - break; - } - } - } - } - - if (self.hostname.length > hostnameMaxLen) { - self.hostname = ''; - } else { - // hostnames are always lower case. - self.hostname = self.hostname.toLowerCase(); - } - - if (!ipv6Hostname) { - // IDNA Support: Returns a punycoded representation of "domain". - // It only converts parts of the domain name that - // have non-ASCII characters, i.e. it doesn't matter if - // you call it with a domain that already is ASCII-only. - self.hostname = toASCII(self.hostname); - } - - p = self.port ? ':' + self.port : ''; - var h = self.hostname || ''; - self.host = h + p; - self.href += self.host; // strip [ and ] from the hostname - // the host field still retains them, though - - if (ipv6Hostname) { - self.hostname = self.hostname.substr(1, self.hostname.length - 2); - - if (rest[0] !== '/') { - rest = '/' + rest; - } - } - } // now rest is set to the post-host stuff. - // chop off any delim chars. - - if (!unsafeProtocol[lowerProto]) { - // First, make 100% sure that any "autoEscape" chars get - // escaped, even if encodeURIComponent doesn't think they - // need to be. - for (i = 0, l = autoEscape.length; i < l; i++) { - var ae = autoEscape[i]; - if (rest.indexOf(ae) === -1) continue; - var esc = encodeURIComponent(ae); - - if (esc === ae) { - esc = escape(ae); - } - - rest = rest.split(ae).join(esc); - } - } // chop off from the tail first. - - var hash = rest.indexOf('#'); - - if (hash !== -1) { - // got a fragment string. - self.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - - var qm = rest.indexOf('?'); - - if (qm !== -1) { - self.search = rest.substr(qm); - self.query = rest.substr(qm + 1); - - if (parseQueryString) { - self.query = parse(self.query); - } - - rest = rest.slice(0, qm); - } else if (parseQueryString) { - // no query string, but parseQueryString still requested - self.search = ''; - self.query = {}; - } - - if (rest) self.pathname = rest; - - if (slashedProtocol[lowerProto] && self.hostname && !self.pathname) { - self.pathname = '/'; - } //to support http.request - - if (self.pathname || self.search) { - p = self.pathname || ''; - var s = self.search || ''; - self.path = p + s; - } // finally, reconstruct the href based on what has been validated. - - self.href = format(self); - return self; - } // format a parsed object into a url string - - function format(self) { - var auth = self.auth || ''; - - if (auth) { - auth = encodeURIComponent(auth); - auth = auth.replace(/%3A/i, ':'); - auth += '@'; - } - - var protocol = self.protocol || '', - pathname = self.pathname || '', - hash = self.hash || '', - host = false, - query = ''; - - if (self.host) { - host = auth + self.host; - } else if (self.hostname) { - host = auth + (self.hostname.indexOf(':') === -1 ? self.hostname : '[' + this.hostname + ']'); - - if (self.port) { - host += ':' + self.port; - } - } - - if (self.query && isObject(self.query) && Object.keys(self.query).length) { - query = stringify(self.query); - } - - var search = self.search || (query && '?' + query) || ''; - if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. - // unless they had them to begin with. - - if (self.slashes || ((!protocol || slashedProtocol[protocol]) && host !== false)) { - host = '//' + (host || ''); - if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; - } else if (!host) { - host = ''; - } - - if (hash && hash.charAt(0) !== '#') hash = '#' + hash; - if (search && search.charAt(0) !== '?') search = '?' + search; - pathname = pathname.replace(/[?#]/g, function(match) { - return encodeURIComponent(match); - }); - search = search.replace('#', '%23'); - return protocol + host + pathname + search + hash; - } - - Url.prototype.format = function() { - return format(this); - }; - - Url.prototype.resolve = function(relative) { - return this.resolveObject(urlParse(relative, false, true)).format(); - }; - - Url.prototype.resolveObject = function(relative) { - if (isString(relative)) { - var rel = new Url(); - rel.parse(relative, false, true); - relative = rel; - } - - var result = new Url(); - var tkeys = Object.keys(this); - - for (var tk = 0; tk < tkeys.length; tk++) { - var tkey = tkeys[tk]; - result[tkey] = this[tkey]; - } // hash is always overridden, no matter what. - // even href="" will remove it. - - result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. - - if (relative.href === '') { - result.href = result.format(); - return result; - } // hrefs like //foo/bar always cut to the protocol. - - if (relative.slashes && !relative.protocol) { - // take everything except the protocol from relative - var rkeys = Object.keys(relative); - - for (var rk = 0; rk < rkeys.length; rk++) { - var rkey = rkeys[rk]; - if (rkey !== 'protocol') result[rkey] = relative[rkey]; - } //urlParse appends trailing / to urls like http://www.example.com - - if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { - result.path = result.pathname = '/'; - } - - result.href = result.format(); - return result; - } - - var relPath; - - if (relative.protocol && relative.protocol !== result.protocol) { - // if it's a known url protocol, then changing - // the protocol does weird things - // first, if it's not file:, then we MUST have a host, - // and if there was a path - // to begin with, then we MUST have a path. - // if it is file:, then the host is dropped, - // because that's known to be hostless. - // anything else is assumed to be absolute. - if (!slashedProtocol[relative.protocol]) { - var keys = Object.keys(relative); - - for (var v = 0; v < keys.length; v++) { - var k = keys[v]; - result[k] = relative[k]; - } - - result.href = result.format(); - return result; - } - - result.protocol = relative.protocol; - - if (!relative.host && !hostlessProtocol[relative.protocol]) { - relPath = (relative.pathname || '').split('/'); - - while (relPath.length && !(relative.host = relPath.shift())); - - if (!relative.host) relative.host = ''; - if (!relative.hostname) relative.hostname = ''; - if (relPath[0] !== '') relPath.unshift(''); - if (relPath.length < 2) relPath.unshift(''); - result.pathname = relPath.join('/'); - } else { - result.pathname = relative.pathname; - } - - result.search = relative.search; - result.query = relative.query; - result.host = relative.host || ''; - result.auth = relative.auth; - result.hostname = relative.hostname || relative.host; - result.port = relative.port; // to support http.request - - if (result.pathname || result.search) { - var p = result.pathname || ''; - var s = result.search || ''; - result.path = p + s; - } - - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; - } - - var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/', - isRelAbs = relative.host || (relative.pathname && relative.pathname.charAt(0) === '/'), - mustEndAbs = isRelAbs || isSourceAbs || (result.host && relative.pathname), - removeAllDots = mustEndAbs, - srcPath = (result.pathname && result.pathname.split('/')) || [], - psychotic = result.protocol && !slashedProtocol[result.protocol]; - relPath = (relative.pathname && relative.pathname.split('/')) || []; // if the url is a non-slashed url, then relative - // links like ../.. should be able - // to crawl up to the hostname, as well. This is strange. - // result.protocol has already been set by now. - // Later on, put the first path part into the host field. - - if (psychotic) { - result.hostname = ''; - result.port = null; - - if (result.host) { - if (srcPath[0] === '') srcPath[0] = result.host; - else srcPath.unshift(result.host); - } - - result.host = ''; - - if (relative.protocol) { - relative.hostname = null; - relative.port = null; - - if (relative.host) { - if (relPath[0] === '') relPath[0] = relative.host; - else relPath.unshift(relative.host); - } - - relative.host = null; - } - - mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); - } - - var authInHost; - - if (isRelAbs) { - // it's absolute. - result.host = relative.host || relative.host === '' ? relative.host : result.host; - result.hostname = - relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname; - result.search = relative.search; - result.query = relative.query; - srcPath = relPath; // fall through to the dot-handling below. - } else if (relPath.length) { - // it's relative - // throw away the existing file, and take the new path instead. - if (!srcPath) srcPath = []; - srcPath.pop(); - srcPath = srcPath.concat(relPath); - result.search = relative.search; - result.query = relative.query; - } else if (!isNullOrUndefined(relative.search)) { - // just pull out the search. - // like href='?foo'. - // Put this after the other two cases because it simplifies the booleans - if (psychotic) { - result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - - authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; - - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } - } - - result.search = relative.search; - result.query = relative.query; //to support http.request - - if (!isNull(result.pathname) || !isNull(result.search)) { - result.path = - (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); - } - - result.href = result.format(); - return result; - } - - if (!srcPath.length) { - // no path at all. easy. - // we've already handled the other stuff above. - result.pathname = null; //to support http.request - - if (result.search) { - result.path = '/' + result.search; - } else { - result.path = null; - } - - result.href = result.format(); - return result; - } // if a url ENDs in . or .., then it must get a trailing slash. - // however, if it ends in anything else non-slashy, - // then it must NOT get a trailing slash. - - var last = srcPath.slice(-1)[0]; - var hasTrailingSlash = - ((result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..')) || - last === ''; // strip single dots, resolve double dots to parent dir - // if the path tries to go above the root, `up` ends up > 0 - - var up = 0; - - for (var i = srcPath.length; i >= 0; i--) { - last = srcPath[i]; - - if (last === '.') { - srcPath.splice(i, 1); - } else if (last === '..') { - srcPath.splice(i, 1); - up++; - } else if (up) { - srcPath.splice(i, 1); - up--; - } - } // if the path is allowed to go above the root, restore leading ..s - - if (!mustEndAbs && !removeAllDots) { - for (; up--; up) { - srcPath.unshift('..'); - } - } - - if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { - srcPath.unshift(''); - } - - if (hasTrailingSlash && srcPath.join('/').substr(-1) !== '/') { - srcPath.push(''); - } - - var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back - - if (psychotic) { - result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - - authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; - - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } - } - - mustEndAbs = mustEndAbs || (result.host && srcPath.length); - - if (mustEndAbs && !isAbsolute) { - srcPath.unshift(''); - } - - if (!srcPath.length) { - result.pathname = null; - result.path = null; - } else { - result.pathname = srcPath.join('/'); - } //to support request.http - - if (!isNull(result.pathname) || !isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); - } - - result.auth = relative.auth || result.auth; - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; - }; - - Url.prototype.parseHost = function() { - return parseHost(this); - }; - - function parseHost(self) { - var host = self.host; - var port = portPattern.exec(host); - - if (port) { - port = port[0]; - - if (port !== ':') { - self.port = port.substr(1); - } - - host = host.substr(0, host.length - port.length); - } - - if (host) self.hostname = host; - } - - let tableListDataSource = []; - - for (let i = 0; i < 46; i += 1) { - tableListDataSource.push({ - key: i, - disabled: i % 6 === 0, - href: 'https://ant.design', - avatar: [ - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', - ][i % 2], - name: `TradeCode ${i}`, - title: `一个任务名称 ${i}`, - owner: '曲丽丽', - desc: '这是一段描述', - callNo: Math.floor(Math.random() * 1000), - status: Math.floor(Math.random() * 10) % 4, - updatedAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`), - createdAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`), - progress: Math.ceil(Math.random() * 100), - }); - } - - function getRule(req, res, u) { - let url = u; - - if (!url || Object.prototype.toString.call(url) !== '[object String]') { - url = req.url; // eslint-disable-line - } - - const params = urlParse(url, true).query; - let dataSource = tableListDataSource; - - if (params.sorter) { - const s = params.sorter.split('_'); - dataSource = dataSource.sort((prev, next) => { - if (s[1] === 'descend') { - return next[s[0]] - prev[s[0]]; - } - - return prev[s[0]] - next[s[0]]; - }); - } - - if (params.status) { - const status = params.status.split(','); - let filterDataSource = []; - status.forEach(s => { - filterDataSource = filterDataSource.concat( - dataSource.filter(data => parseInt(data.status, 10) === parseInt(s[0], 10)), - ); - }); - dataSource = filterDataSource; - } - - if (params.name) { - dataSource = dataSource.filter(data => data.name.indexOf(params.name) > -1); - } - - let pageSize = 10; - - if (params.pageSize) { - pageSize = params.pageSize * 1; - } - - const result = { - list: dataSource, - pagination: { - total: dataSource.length, - pageSize, - current: parseInt(params.currentPage, 10) || 1, - }, - }; - return res.json(result); - } - - function postRule(req, res, u, b) { - let url = u; - - if (!url || Object.prototype.toString.call(url) !== '[object String]') { - url = req.url; // eslint-disable-line - } - - const body = (b && b.body) || req.body; - const { method, name, desc, key } = body; - - switch (method) { - /* eslint no-case-declarations:0 */ - case 'delete': - tableListDataSource = tableListDataSource.filter(item => key.indexOf(item.key) === -1); - break; - - case 'post': - const i = Math.ceil(Math.random() * 10000); - tableListDataSource.unshift({ - key: i, - href: 'https://ant.design', - avatar: [ - 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png', - 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png', - ][i % 2], - name: `TradeCode ${i}`, - title: `一个任务名称 ${i}`, - owner: '曲丽丽', - desc, - callNo: Math.floor(Math.random() * 1000), - status: Math.floor(Math.random() * 10) % 2, - updatedAt: new Date(), - createdAt: new Date(), - progress: Math.ceil(Math.random() * 100), - }); - break; - - case 'update': - tableListDataSource = tableListDataSource.map(item => { - if (item.key === key) { - Object.assign(item, { - desc, - name, - }); - return item; - } - - return item; - }); - break; - - default: - break; - } - - return getRule(req, res, u); - } - - var rule = { - 'GET /api/rule': getRule, - 'POST /api/rule': postRule, - }; - - // 代码中会兼容本地 service mock 以及部署站点的静态数据 - var user$1 = { - // 支持值为 Object 和 Array - 'GET /api/currentUser': { - name: 'Serati Ma', - avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', - userid: '00000001', - email: 'antdesign@alipay.com', - signature: '海纳百川,有容乃大', - title: '交互专家', - group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', - tags: [ - { - key: '0', - label: '很有想法的', - }, - { - key: '1', - label: '专注设计', - }, - { - key: '2', - label: '辣~', - }, - { - key: '3', - label: '大长腿', - }, - { - key: '4', - label: '川妹子', - }, - { - key: '5', - label: '海纳百川', - }, - ], - notice: [ - { - id: 'xxx1', - title: titles[0], - logo: avatars[0], - description: '那是一种内在的东西,他们到达不了,也无法触及的', - updatedAt: new Date(), - member: '科学搬砖组', - href: '', - memberLink: '', - }, - { - id: 'xxx2', - title: titles[1], - logo: avatars[1], - description: '希望是一个好东西,也许是最好的,好东西是不会消亡的', - updatedAt: new Date('2017-07-24'), - member: '全组都是吴彦祖', - href: '', - memberLink: '', - }, - { - id: 'xxx3', - title: titles[2], - logo: avatars[2], - description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆', - updatedAt: new Date(), - member: '中二少女团', - href: '', - memberLink: '', - }, - { - id: 'xxx4', - title: titles[3], - logo: avatars[3], - description: '那时候我只会想自己想要什么,从不想自己拥有什么', - updatedAt: new Date('2017-07-23'), - member: '程序员日常', - href: '', - memberLink: '', - }, - { - id: 'xxx5', - title: titles[4], - logo: avatars[4], - description: '凛冬将至', - updatedAt: new Date('2017-07-23'), - member: '高逼格设计天团', - href: '', - memberLink: '', - }, - { - id: 'xxx6', - title: titles[5], - logo: avatars[5], - description: '生命就像一盒巧克力,结果往往出人意料', - updatedAt: new Date('2017-07-23'), - member: '骗你来学计算机', - href: '', - memberLink: '', - }, - ], - notifyCount: 12, - unreadCount: 11, - country: 'China', - geographic: { - province: { - label: '浙江省', - key: '330000', - }, - city: { - label: '杭州市', - key: '330100', - }, - }, - address: '西湖区工专路 77 号', - phone: '0752-268888888', - }, - // GET POST 可省略 - 'GET /api/users': [ - { - key: '1', - name: 'John Brown', - age: 32, - address: 'New York No. 1 Lake Park', - }, - { - key: '2', - name: 'Jim Green', - age: 42, - address: 'London No. 1 Lake Park', - }, - { - key: '3', - name: 'Joe Black', - age: 32, - address: 'Sidney No. 1 Lake Park', - }, - ], - 'POST /api/login/account': (req, res) => { - const { password, userName, type } = req.body; - - if (password === 'ant.design' && userName === 'admin') { - res.send({ - status: 'ok', - type, - currentAuthority: 'admin', - }); - return; - } - - if (password === 'ant.design' && userName === 'user') { - res.send({ - status: 'ok', - type, - currentAuthority: 'user', - }); - return; - } - - res.send({ - status: 'error', - type, - currentAuthority: 'guest', - }); - }, - 'POST /api/register': (req, res) => { - res.send({ - status: 'ok', - currentAuthority: 'user', - }); - }, - 'GET /api/500': (req, res) => { - res.status(500).send({ - timestamp: 1513932555104, - status: 500, - error: 'error', - message: 'error', - path: '/base/category/list', - }); - }, - 'GET /api/404': (req, res) => { - res.status(404).send({ - timestamp: 1513932643431, - status: 404, - error: 'Not Found', - message: 'No message available', - path: '/base/category/list/2121212', - }); - }, - 'GET /api/403': (req, res) => { - res.status(403).send({ - timestamp: 1513932555104, - status: 403, - error: 'Unauthorized', - message: 'Unauthorized', - path: '/base/category/list', - }); - }, - 'GET /api/401': (req, res) => { - res.status(401).send({ - timestamp: 1513932555104, - status: 401, - error: 'Unauthorized', - message: 'Unauthorized', - path: '/base/category/list', - }); - }, - }; - - const data = _objectSpread({}, api, chart, geographic, notices, profile, rule, user$1); - - return data; -}); diff --git a/frontend/lambda/mock/matchMock.js b/frontend/lambda/mock/matchMock.js deleted file mode 100644 index d742361..0000000 --- a/frontend/lambda/mock/matchMock.js +++ /dev/null @@ -1,116 +0,0 @@ -const pathToRegexp = require('path-to-regexp'); -const bodyParser = require('body-parser'); - -const mockFile = require('./index'); - -const BODY_PARSED_METHODS = ['post', 'put', 'patch']; - -const debug = console.log; -function parseKey(key) { - let method = 'get'; - let path = key; - if (key.indexOf(' ') > -1) { - const spliced = key.split(' '); - method = spliced[0].toLowerCase(); - path = spliced[1]; // eslint-disable-line - } - const routerBasePath = `${path}`; - return { - method, - path: routerBasePath, - }; -} - -function createHandler(method, path, handler) { - return (req, res, next) => { - function sendData() { - if (typeof handler === 'function') { - handler(req, res, next); - } else { - res.json(handler); - } - } - if (BODY_PARSED_METHODS.includes(method)) { - bodyParser.json({ limit: '5mb', strict: false })(req, res, () => { - bodyParser.urlencoded({ limit: '5mb', extended: true })(req, res, () => { - sendData(); - }); - }); - } else { - sendData(); - } - }; -} - -function normalizeConfig(config) { - return Object.keys(config).reduce((memo, key) => { - const handler = config[key]; - const { method, path } = parseKey(key); - const keys = []; - const re = pathToRegexp(path, keys); - memo.push({ - method, - path, - re, - keys, - handler: createHandler(method, path, handler), - }); - return memo; - }, []); -} - -const mockData = normalizeConfig(mockFile); - -function matchMock(req) { - const { path: exceptPath } = req; - const exceptMethod = req.method.toLowerCase(); - function decodeParam(val) { - if (typeof val !== 'string' || val.length === 0) { - return val; - } - - try { - return decodeURIComponent(val); - } catch (err) { - if (err instanceof URIError) { - err.message = `Failed to decode param ' ${val} '`; - err.statusCode = 400; - err.status = 400; - } - - throw err; - } - } - // eslint-disable-next-line no-restricted-syntax - for (const mock of mockData) { - const { method, re, keys } = mock; - if (method === exceptMethod) { - const match = re.exec(req.path); - if (match) { - const params = {}; - - for (let i = 1; i < match.length; i += 1) { - const key = keys[i - 1]; - const prop = key.name; - const val = decodeParam(match[i]); - - if (val !== undefined || !hasOwnProperty.call(params, prop)) { - params[prop] = val; - } - } - req.params = params; - return mock; - } - } - } - - return mockData.filter(({ method, re }) => method === exceptMethod && re.test(exceptPath))[0]; -} -module.exports = (req, res, next) => { - const match = matchMock(req); - if (match) { - debug(`mock matched: [${match.method}] ${match.path}`); - return match.handler(req, res, next); - } - return next(); -}; diff --git a/frontend/mock/notices.ts b/frontend/mock/notices.ts deleted file mode 100644 index b9e3bf2..0000000 --- a/frontend/mock/notices.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { Request, Response } from 'express'; - -const getNotices = (req: Request, res: Response) => { - res.json([ - { - id: '000000001', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '你收到了 14 份新周报', - datetime: '2017-08-09', - type: 'notification', - }, - { - id: '000000002', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', - title: '你推荐的 曲妮妮 已通过第三轮面试', - datetime: '2017-08-08', - type: 'notification', - }, - { - id: '000000003', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', - title: '这种模板可以区分多种通知类型', - datetime: '2017-08-07', - read: true, - type: 'notification', - }, - { - id: '000000004', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', - title: '左侧图标用于区分不同的类型', - datetime: '2017-08-07', - type: 'notification', - }, - { - id: '000000005', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', - title: '内容不要超过两行字,超出时自动截断', - datetime: '2017-08-07', - type: 'notification', - }, - { - id: '000000006', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '曲丽丽 评论了你', - description: '描述信息描述信息描述信息', - datetime: '2017-08-07', - type: 'message', - clickClose: true, - }, - { - id: '000000007', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '朱偏右 回复了你', - description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: '2017-08-07', - type: 'message', - clickClose: true, - }, - { - id: '000000008', - avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', - title: '标题', - description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', - datetime: '2017-08-07', - type: 'message', - clickClose: true, - }, - { - id: '000000009', - title: '任务名称', - description: '任务需要在 2017-01-12 20:00 前启动', - extra: '未开始', - status: 'todo', - type: 'event', - }, - { - id: '000000010', - title: '第三方紧急代码变更', - description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', - extra: '马上到期', - status: 'urgent', - type: 'event', - }, - { - id: '000000011', - title: '信息安全考试', - description: '指派竹尔于 2017-01-09 前完成更新并发布', - extra: '已耗时 8 天', - status: 'doing', - type: 'event', - }, - { - id: '000000012', - title: 'ABCD 版本发布', - description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', - extra: '进行中', - status: 'processing', - type: 'event', - }, - ]); -}; - -export default { - 'GET /api/notices': getNotices, -}; diff --git a/frontend/mock/route.ts b/frontend/mock/route.ts deleted file mode 100644 index 418d10f..0000000 --- a/frontend/mock/route.ts +++ /dev/null @@ -1,5 +0,0 @@ -export default { - '/api/auth_routes': { - '/form/advanced-form': { authority: ['admin', 'user'] }, - }, -}; diff --git a/frontend/mock/user.ts b/frontend/mock/user.ts deleted file mode 100644 index 4039e5a..0000000 --- a/frontend/mock/user.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { Request, Response } from 'express'; -// 代码中会兼容本地 service mock 以及部署站点的静态数据 -export default { - // 支持值为 Object 和 Array - 'GET /api/currentUser': { - name: 'Serati Ma', - avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', - userid: '00000001', - email: 'antdesign@alipay.com', - signature: '海纳百川,有容乃大', - title: '交互专家', - group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', - tags: [ - { - key: '0', - label: '很有想法的', - }, - { - key: '1', - label: '专注设计', - }, - { - key: '2', - label: '辣~', - }, - { - key: '3', - label: '大长腿', - }, - { - key: '4', - label: '川妹子', - }, - { - key: '5', - label: '海纳百川', - }, - ], - notifyCount: 12, - unreadCount: 11, - country: 'China', - geographic: { - province: { - label: '浙江省', - key: '330000', - }, - city: { - label: '杭州市', - key: '330100', - }, - }, - address: '西湖区工专路 77 号', - phone: '0752-268888888', - }, - // GET POST 可省略 - 'GET /api/users': [ - { - key: '1', - name: 'John Brown', - age: 32, - address: 'New York No. 1 Lake Park', - }, - { - key: '2', - name: 'Jim Green', - age: 42, - address: 'London No. 1 Lake Park', - }, - { - key: '3', - name: 'Joe Black', - age: 32, - address: 'Sidney No. 1 Lake Park', - }, - ], - 'POST /api/login/account': (req: Request, res: Response) => { - const { password, userName, type } = req.body; - if (password === 'ant.design' && userName === 'admin') { - res.send({ - status: 'ok', - type, - currentAuthority: 'admin', - }); - return; - } - if (password === 'ant.design' && userName === 'user') { - res.send({ - status: 'ok', - type, - currentAuthority: 'user', - }); - return; - } - res.send({ - status: 'error', - type, - currentAuthority: 'guest', - }); - }, - 'POST /api/register': (req: Request, res: Response) => { - res.send({ status: 'ok', currentAuthority: 'user' }); - }, - 'GET /api/500': (req: Request, res: Response) => { - res.status(500).send({ - timestamp: 1513932555104, - status: 500, - error: 'error', - message: 'error', - path: '/base/category/list', - }); - }, - 'GET /api/404': (req: Request, res: Response) => { - res.status(404).send({ - timestamp: 1513932643431, - status: 404, - error: 'Not Found', - message: 'No message available', - path: '/base/category/list/2121212', - }); - }, - 'GET /api/403': (req: Request, res: Response) => { - res.status(403).send({ - timestamp: 1513932555104, - status: 403, - error: 'Unauthorized', - message: 'Unauthorized', - path: '/base/category/list', - }); - }, - 'GET /api/401': (req: Request, res: Response) => { - res.status(401).send({ - timestamp: 1513932555104, - status: 401, - error: 'Unauthorized', - message: 'Unauthorized', - path: '/base/category/list', - }); - }, -}; diff --git a/frontend/netlify.toml b/frontend/netlify.toml deleted file mode 100644 index 9d3438c..0000000 --- a/frontend/netlify.toml +++ /dev/null @@ -1,16 +0,0 @@ -[build] - functions = "./functions" - -[[redirects]] - from = "/api/*" - to = "/.netlify/functions/api/:splat" - status = 200 - force = true - [redirects.headers] - X-From = "Netlify" - X-Api-Key = "some-api-key-string" - -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json deleted file mode 100644 index a48b688..0000000 --- a/frontend/package.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "name": "artipub", - "version": "0.1.0", - "private": true, - "description": "An out-of-box UI solution for enterprise applications", - "scripts": { - "analyze": "cross-env ANALYZE=1 umi build", - "build": "umi build", - "deploy": "cross-env ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION=site npm run site && npm run gh-pages", - "docker-hub:build": "docker build -f Dockerfile.hub -t ant-design-pro ./", - "docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build", - "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up", - "docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build", - "docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up", - "docker:push": "npm run docker-hub:build && npm run docker:tag && docker push antdesign/ant-design-pro", - "docker:tag": "docker tag ant-design-pro antdesign/ant-design-pro", - "fetch:blocks": "pro fetch-blocks", - "format-imports": "import-sort --write '**/*.{js,jsx,ts,tsx}'", - "functions:build": "netlify-lambda build ./lambda", - "functions:run": "cross-env NODE_ENV=dev netlify-lambda serve ./lambda", - "gh-pages": "cp CNAME ./dist/ && gh-pages -d dist", - "i18n-remove": "pro i18n-remove --locale=zh-CN --write", - "lint": "npm run lint:js && npm run lint:style && npm run lint:prettier", - "lint-staged": "lint-staged", - "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", - "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style", - "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./", - "lint:prettier": "check-prettier lint", - "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less", - "prettier": "prettier -c --write \"**/*\"", - "site": "npm run fetch:blocks && npm run build && npm run functions:build", - "start": "umi dev", - "start:no-mock": "cross-env MOCK=none umi dev", - "test": "umi test", - "test:all": "node ./tests/run-tests.js", - "test:component": "umi test ./src/components" - }, - "husky": { - "hooks": { - "pre-commit": "npm run lint-staged" - } - }, - "lint-staged": { - "**/*.less": "stylelint --syntax less", - "**/*.{js,jsx,tsx,ts,less,md,json}": [ - "prettier --write", - "git add" - ], - "**/*.{js,jsx}": "npm run lint-staged:js", - "**/*.{js,ts,tsx}": "npm run lint-staged:js" - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not ie <= 10" - ], - "dependencies": { - "@ant-design/pro-layout": "^4.5.9", - "@antv/data-set": "^0.10.2", - "@types/codemirror": "0.0.76", - "@types/showdown": "^1.9.3", - "antd": "^3.20.0", - "classnames": "^2.2.6", - "codemirror": "^5.48.2", - "dva": "^2.4.1", - "github-markdown-css": "^3.0.1", - "hash.js": "^1.1.7", - "lodash": "^4.17.11", - "moment": "^2.24.0", - "numeral": "^2.0.6", - "nzh": "^1.0.4", - "omit.js": "^1.0.2", - "path-to-regexp": "^3.0.0", - "qs": "^6.7.0", - "react": "^16.8.6", - "react-ace": "^7.0.2", - "react-codemirror2": "^6.0.0", - "react-copy-to-clipboard": "^5.0.1", - "react-document-title": "^2.0.3", - "react-dom": "^16.8.6", - "react-showdown": "^1.6.0", - "redux": "^4.0.1", - "showdown": "^1.9.0", - "umi": "^2.8.7", - "umi-plugin-pro-block": "^1.3.2", - "umi-plugin-react": "^1.9.5", - "umi-request": "^1.0.8" - }, - "devDependencies": { - "@ant-design/colors": "^3.1.0", - "@ant-design/pro-cli": "^1.0.0", - "@types/classnames": "^2.2.7", - "@types/express": "^4.17.0", - "@types/history": "^4.7.2", - "@types/jest": "^24.0.13", - "@types/lodash": "^4.14.133", - "@types/qs": "^6.5.3", - "@types/react": "^16.8.19", - "@types/react-document-title": "^2.0.3", - "@types/react-dom": "^16.8.4", - "@umijs/fabric": "^1.1.0", - "chalk": "^2.4.2", - "check-prettier": "^1.0.3", - "cross-env": "^5.2.0", - "cross-port-killer": "^1.1.1", - "enzyme": "^3.9.0", - "eslint": "^5.16.0", - "express": "^4.17.1", - "gh-pages": "^2.0.1", - "husky": "^3.0.0", - "import-sort-cli": "^6.0.0", - "import-sort-parser-babylon": "^6.0.0", - "import-sort-parser-typescript": "^6.0.0", - "import-sort-style-module": "^6.0.0", - "jest-puppeteer": "^4.2.0", - "lint-staged": "^9.0.0", - "mockjs": "^1.0.1-beta3", - "netlify-lambda": "^1.4.13", - "node-fetch": "^2.6.0", - "prettier": "^1.17.1", - "pro-download": "1.0.1", - "serverless-http": "^2.0.2", - "slash2": "^2.0.0", - "stylelint": "^10.1.0", - "umi-plugin-ga": "^1.1.3", - "umi-plugin-pro": "^1.0.2", - "umi-types": "^0.3.8", - "webpack-theme-color-replacer": "^1.2.15" - }, - "optionalDependencies": { - "puppeteer": "^1.17.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "checkFiles": [ - "src/**/*.js*", - "src/**/*.ts*", - "src/**/*.less", - "config/**/*.js*", - "scripts/**/*.js" - ], - "create-umi": { - "ignoreScript": [ - "docker*", - "functions*", - "site", - "generateMock" - ], - "ignoreDependencies": [ - "netlify*", - "serverless", - "^express$" - ], - "ignore": [ - ".dockerignore", - ".git", - ".gitpod.yml", - "CODE_OF_CONDUCT.md", - "Dockerfile", - "Dockerfile.*", - "lambda", - "LICENSE", - "netlify.toml", - "README.*.md", - "azure-pipelines.yml", - "docker", - "create-umi" - ] - } -} diff --git a/frontend/tests/run-tests.js b/frontend/tests/run-tests.js deleted file mode 100644 index ea531ef..0000000 --- a/frontend/tests/run-tests.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint-disable eslint-comments/disable-enable-pair */ -/* eslint-disable @typescript-eslint/no-var-requires */ -/* eslint-disable eslint-comments/no-unlimited-disable */ -const { spawn } = require('child_process'); -const { kill } = require('cross-port-killer'); - -const env = Object.create(process.env); -env.BROWSER = 'none'; -env.TEST = true; -// flag to prevent multiple test -let once = false; - -const startServer = spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['start'], { - env, -}); - -startServer.stderr.on('data', data => { - // eslint-disable-next-line - console.log(data.toString()); -}); - -startServer.on('exit', () => { - kill(process.env.PORT || 8000); -}); - -console.log('Starting development server for e2e tests...'); -startServer.stdout.on('data', data => { - console.log(data.toString()); - // hack code , wait umi - if ( - (!once && data.toString().indexOf('Compiled successfully') >= 0) || - data.toString().indexOf('Theme generated successfully') >= 0 - ) { - // eslint-disable-next-line - once = true; - console.log('Development server is started, ready to run tests.'); - const testCmd = spawn( - /^win/.test(process.platform) ? 'npm.cmd' : 'npm', - ['test', '--', '--maxWorkers=1', '--runInBand'], - { - stdio: 'inherit', - }, - ); - testCmd.on('exit', code => { - startServer.kill(); - process.exit(code); - }); - } -}); diff --git a/backend/init.js b/init.js similarity index 100% rename from backend/init.js rename to init.js diff --git a/frontend/jsconfig.json b/jsconfig.json similarity index 100% rename from frontend/jsconfig.json rename to jsconfig.json diff --git a/backend/lib/ArticlePublisher.js b/lib/ArticlePublisher.js similarity index 100% rename from backend/lib/ArticlePublisher.js rename to lib/ArticlePublisher.js diff --git a/backend/lib/BaseExecutor.js b/lib/BaseExecutor.js similarity index 90% rename from backend/lib/BaseExecutor.js rename to lib/BaseExecutor.js index 447894d..ece9d3a 100644 --- a/backend/lib/BaseExecutor.js +++ b/lib/BaseExecutor.js @@ -25,6 +25,8 @@ class BaseExecutor { spider = new spiders.JianshuSpider(task._id) } else if (spiderName === constants.platform.CSDN) { spider = new spiders.CsdnSpider(task._id) + } else if (spiderName === constants.platform.ZHIHU) { + spider = new spiders.ZhihuSpider(task._id) } this.spider = spider } diff --git a/backend/lib/StatsFetcher.js b/lib/StatsFetcher.js similarity index 100% rename from backend/lib/StatsFetcher.js rename to lib/StatsFetcher.js diff --git a/backend/logger.js b/logger.js similarity index 100% rename from backend/logger.js rename to logger.js diff --git a/backend/models/article.js b/models/article.js similarity index 100% rename from backend/models/article.js rename to models/article.js diff --git a/backend/models/cookie.js b/models/cookie.js similarity index 100% rename from backend/models/cookie.js rename to models/cookie.js diff --git a/backend/models/index.js b/models/index.js similarity index 100% rename from backend/models/index.js rename to models/index.js diff --git a/backend/models/platform.js b/models/platform.js similarity index 100% rename from backend/models/platform.js rename to models/platform.js diff --git a/backend/models/task.js b/models/task.js similarity index 100% rename from backend/models/task.js rename to models/task.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..427bae8 --- /dev/null +++ b/package.json @@ -0,0 +1,118 @@ +{ + "name": "artipub", + "version": "0.1.1", + "description": "Article publishing platform that automatically distributes your articles to various media channels", + "main": "index.js", + "scripts": { + "start": "node cli.js start", + "start:frontend": "umi dev", + "start:backend": "node server.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "bin": { + "artipub": "./cli.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/crawlab-team/artipub.git" + }, + "keywords": [ + "nodejs", + "publish", + "article", + "media", + "write", + "post", + "puppeteer" + ], + "author": "Marvin Zhang", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/crawlab-team/artipub/issues" + }, + "homepage": "https://github.com/crawlab-team/artipub#readme", + "dependencies": { + "@ant-design/pro-layout": "^4.5.9", + "@antv/data-set": "^0.10.2", + "@types/codemirror": "0.0.76", + "@types/showdown": "^1.9.3", + "antd": "^3.20.0", + "async-lock": "^1.2.2", + "body-parser": "^1.19.0", + "classnames": "^2.2.6", + "clipboardy": "^2.1.0", + "codemirror": "^5.48.2", + "commander": "^3.0.1", + "cors": "^2.8.5", + "cron": "^1.7.1", + "dva": "^2.4.1", + "express": "^4.17.1", + "github-markdown-css": "^3.0.1", + "hash.js": "^1.1.7", + "lodash": "^4.17.11", + "log4js": "^5.1.0", + "moment": "^2.24.0", + "mongoose": "^5.6.12", + "morgan": "^1.9.1", + "numeral": "^2.0.6", + "nzh": "^1.0.4", + "omit.js": "^1.0.2", + "path-to-regexp": "^3.0.0", + "puppeteer-chromium-resolver": "^2.0.1", + "qs": "^6.7.0", + "react": "^16.8.6", + "react-ace": "^7.0.2", + "react-codemirror2": "^6.0.0", + "react-copy-to-clipboard": "^5.0.1", + "react-document-title": "^2.0.3", + "react-dom": "^16.8.6", + "react-showdown": "^1.6.0", + "redux": "^4.0.1", + "showdown": "^1.9.0", + "umi": "^2.8.7", + "umi-plugin-pro-block": "^1.3.2", + "umi-plugin-react": "^1.9.5", + "umi-request": "^1.0.8" + }, + "devDependencies": { + "@ant-design/colors": "^3.1.0", + "@ant-design/pro-cli": "^1.0.0", + "@types/classnames": "^2.2.7", + "@types/express": "^4.17.0", + "@types/history": "^4.7.2", + "@types/jest": "^24.0.13", + "@types/lodash": "^4.14.133", + "@types/qs": "^6.5.3", + "@types/react": "^16.8.19", + "@types/react-document-title": "^2.0.3", + "@types/react-dom": "^16.8.4", + "@umijs/fabric": "^1.1.0", + "chalk": "^2.4.2", + "check-prettier": "^1.0.3", + "cross-env": "^5.2.0", + "cross-port-killer": "^1.1.1", + "enzyme": "^3.9.0", + "eslint": "^5.16.0", + "express": "^4.17.1", + "gh-pages": "^2.0.1", + "husky": "^3.0.0", + "import-sort-cli": "^6.0.0", + "import-sort-parser-babylon": "^6.0.0", + "import-sort-parser-typescript": "^6.0.0", + "import-sort-style-module": "^6.0.0", + "jest-puppeteer": "^4.2.0", + "lint-staged": "^9.0.0", + "mockjs": "^1.0.1-beta3", + "netlify-lambda": "^1.4.13", + "node-fetch": "^2.6.0", + "prettier": "^1.17.1", + "pro-download": "1.0.1", + "serverless-http": "^2.0.2", + "slash2": "^2.0.0", + "stylelint": "^10.1.0", + "umi-plugin-ga": "^1.1.3", + "umi-plugin-pro": "^1.0.2", + "umi-types": "^0.3.8", + "webpack-theme-color-replacer": "^1.2.15" + } +} diff --git a/frontend/public/favicon.ico b/public/favicon.ico similarity index 100% rename from frontend/public/favicon.ico rename to public/favicon.ico diff --git a/frontend/public/favicon.png b/public/favicon.png similarity index 100% rename from frontend/public/favicon.png rename to public/favicon.png diff --git a/frontend/public/icons/icon-128x128.png b/public/icons/icon-128x128.png similarity index 100% rename from frontend/public/icons/icon-128x128.png rename to public/icons/icon-128x128.png diff --git a/frontend/public/icons/icon-192x192.png b/public/icons/icon-192x192.png similarity index 100% rename from frontend/public/icons/icon-192x192.png rename to public/icons/icon-192x192.png diff --git a/frontend/public/icons/icon-512x512.png b/public/icons/icon-512x512.png similarity index 100% rename from frontend/public/icons/icon-512x512.png rename to public/icons/icon-512x512.png diff --git a/backend/routes/article.js b/routes/article.js similarity index 98% rename from backend/routes/article.js rename to routes/article.js index a109942..ede66ec 100644 --- a/backend/routes/article.js +++ b/routes/article.js @@ -4,7 +4,7 @@ const ObjectId = require('bson').ObjectId module.exports = { getArticleList: async (req, res) => { - const articles = await models.Article.find() + const articles = await models.Article.find().sort({ _id: -1 }) for (let i = 0; i < articles.length; i++) { const article = articles[i] article.tasks = await models.Task.find({ articleId: article._id }) diff --git a/backend/routes/cookie.js b/routes/cookie.js similarity index 100% rename from backend/routes/cookie.js rename to routes/cookie.js diff --git a/backend/routes/index.js b/routes/index.js similarity index 100% rename from backend/routes/index.js rename to routes/index.js diff --git a/backend/routes/platform.js b/routes/platform.js similarity index 100% rename from backend/routes/platform.js rename to routes/platform.js diff --git a/backend/routes/task.js b/routes/task.js similarity index 100% rename from backend/routes/task.js rename to routes/task.js diff --git a/backend/server.js b/server.js similarity index 100% rename from backend/server.js rename to server.js diff --git a/backend/spiders/base.js b/spiders/base.js similarity index 97% rename from backend/spiders/base.js rename to spiders/base.js index b81c15f..6d5391e 100644 --- a/backend/spiders/base.js +++ b/spiders/base.js @@ -4,6 +4,7 @@ const credentials = require('../credentials') const models = require('../models') const constants = require('../constants') const config = require('./config') +const globalConfig = require('../config') const logger = require('../logger') class BaseSpider { @@ -61,8 +62,7 @@ class BaseSpider { // 打开开发者工具, 当此值为true时, headless总为false devtools: false, // 关闭headless模式, 不会打开浏览器 - headless: false - // headless: true + headless: globalConfig.HEADLESS }) // 页面 @@ -176,7 +176,7 @@ class BaseSpider { } async inputFooter(article, editorSel) { - const footerContent = `\n\n> 本文由文章发布工具[ArtiPub](https://github.com/crawlab-team/artipub)自动生成` + const footerContent = `\n\n> 本篇文章由[ArtiPub](https://github.com/crawlab-team/artipub)自动发布, ArtiPub让您的文章随处可阅` const el = document.querySelector(editorSel.content) el.focus() document.execCommand('insertText', false, footerContent) diff --git a/backend/spiders/config.js b/spiders/config.js similarity index 65% rename from backend/spiders/config.js rename to spiders/config.js index 90e171e..418df04 100644 --- a/backend/spiders/config.js +++ b/spiders/config.js @@ -2,12 +2,12 @@ module.exports = { juejin: { urls: { login: 'https://juejin.im/login', - editor: 'https://juejin.im/editor/drafts/new', + editor: 'https://juejin.im/editor/drafts/new' }, loginSel: { username: '.input[name="loginPhoneOrEmail"]', password: '.input[name="loginPassword"]', - submit: '.btn:nth-child(3)', + submit: '.btn:nth-child(3)' }, editorSel: { title: '.title-input', @@ -19,12 +19,12 @@ module.exports = { segmentfault: { urls: { login: 'https://segmentfault.com/user/login', - editor: 'https://segmentfault.com/write', + editor: 'https://segmentfault.com/write' }, loginSel: { username: 'input[name="username"]', password: 'input[name="password"]', - submit: 'button[type="submit"]', + submit: 'button[type="submit"]' }, editorSel: { title: '#myTitle', @@ -36,12 +36,12 @@ module.exports = { jianshu: { urls: { login: 'https://www.jianshu.com/sign_in', - editor: 'https://www.jianshu.com/writer', + editor: 'https://www.jianshu.com/writer' }, loginSel: { username: '', password: '', - submit: '', + submit: '' }, editorSel: { title: 'input:not([name="name"])', @@ -53,16 +53,32 @@ module.exports = { csdn: { urls: { login: '', - editor: 'https://mp.csdn.net/postedit', + editor: 'https://mp.csdn.net/postedit' }, loginSel: { username: '', - password: '', + password: '' }, editorSel: { title: '#txtTitle', content: '.htmledit_views', publish: '#btnPublish' } + }, + + zhihu: { + urls: { + login: '', + editor: 'https://zhuanlan.zhihu.com/write' + }, + loginSel: { + username: '', + password: '' + }, + editorSel: { + title: '.WriteIndex-titleInput > .Input', + content: '.public-DraftEditor-content', + publish: '.PublishPanel-stepTwoButton' + } } } diff --git a/backend/spiders/csdn.js b/spiders/csdn.js similarity index 100% rename from backend/spiders/csdn.js rename to spiders/csdn.js diff --git a/backend/spiders/import/base.js b/spiders/import/base.js similarity index 89% rename from backend/spiders/import/base.js rename to spiders/import/base.js index 8551efa..66680c8 100644 --- a/backend/spiders/import/base.js +++ b/spiders/import/base.js @@ -2,7 +2,9 @@ const PCR = require('puppeteer-chromium-resolver') const showdown = require('showdown') const models = require('../../models') const BaseSpider = require('../base') +const globalConfig = require('../../config') const config = require('../config') +const logger = require('../../logger') showdown.setOption('tables', true) showdown.setOption('tasklists', true) @@ -37,11 +39,12 @@ class BaseImportSpider extends BaseSpider { timeout: 60000, //如果是访问https页面 此属性会忽略https错误 ignoreHTTPSErrors: true, - // 打开开发者工具, 当此值为true时, headless总为false devtools: false, - // 关闭headless模式, 不会打开浏览器 - headless: false, - // headless: true, + headless: globalConfig.HEADLESS, + args: [ + '--no-sandbox', + '--disable-setuid-sandbox' + ] }) // 页面 @@ -76,6 +79,8 @@ class BaseImportSpider extends BaseSpider { } async fetch() { + logger.info('fetching articles') + await this.init() await this.setCookies() try { @@ -96,6 +101,8 @@ class BaseImportSpider extends BaseSpider { } async import(siteArticles) { + logger.info('importing articles') + await this.init() await this.setCookies() for (let i = 0; i < siteArticles.length; i++) { @@ -103,7 +110,10 @@ class BaseImportSpider extends BaseSpider { if (siteArticle.exists && siteArticle.associated) continue await this.importArticle(siteArticle) } + await this.browser.close() + + logger.info('imported articles') } } diff --git a/backend/spiders/import/csdn.js b/spiders/import/csdn.js similarity index 100% rename from backend/spiders/import/csdn.js rename to spiders/import/csdn.js diff --git a/backend/spiders/import/jianshu.js b/spiders/import/jianshu.js similarity index 100% rename from backend/spiders/import/jianshu.js rename to spiders/import/jianshu.js diff --git a/backend/spiders/import/juejin.js b/spiders/import/juejin.js similarity index 77% rename from backend/spiders/import/juejin.js rename to spiders/import/juejin.js index dc45979..a2e7ec1 100644 --- a/backend/spiders/import/juejin.js +++ b/spiders/import/juejin.js @@ -1,7 +1,10 @@ const ObjectId = require('bson').ObjectId +const os = require('os') +const clipboardy = require('clipboardy') const BaseImportSpider = require('./base') const models = require('../../models') const constants = require('../../constants') +const logger = require('../../logger') class JuejinImportSpider extends BaseImportSpider { async fetchArticles() { @@ -31,7 +34,7 @@ class JuejinImportSpider extends BaseImportSpider { title: item.querySelector('a.title').innerText, readNum: elRead ? Number(elRead.innerText.replace('阅读 ', '')) : 0, likeNum: elLike ? Number(elLike.innerText) : 0, - commentNum: elComment ? Number(elComment.innerText) : 0, + commentNum: elComment ? Number(elComment.innerText) : 0 }) } return _articles @@ -39,55 +42,47 @@ class JuejinImportSpider extends BaseImportSpider { } async importArticle(siteArticle) { + logger.info(`importing ${siteArticle.url}`) + // 获取文章ID const id = siteArticle.url.match(/\/(\w+)$/)[1] // 导航至文章编辑页面 - await this.page.goto(`https://juejin.im/editor/posts/${id}`) + await this.page.goto(`https://juejin.im/editor/posts/${ id }`) await this.page.waitFor(5000) // 点击文章选择框 await this.page.click(this.editorSel.content) + // 根据操作系统决定操作键 + const ctrlKey = os.platform() === 'darwin' ? 'Meta' : 'Control' + // 全选文章内容 - await this.page.keyboard.down('Control') + await this.page.keyboard.down(ctrlKey) await this.page.keyboard.press('KeyA') - await this.page.keyboard.up('Control') + await this.page.keyboard.up(ctrlKey) await this.page.waitFor(500) // 拷贝文章内容 - await this.page.keyboard.down('Control') + await this.page.keyboard.down(ctrlKey) await this.page.keyboard.press('KeyC') - await this.page.keyboard.up('Control') - await this.page.waitFor(500) - - // 导航至本地粘贴页面 - await this.page.goto('http://localhost:8000/paste') - await this.page.click('#paste') + await this.page.keyboard.up(ctrlKey) await this.page.waitFor(500) + await this.page.screenshot({path: 'C:\\Users\\marvzhang\\artipub\\backend\\screenshot1.png'}) - // 粘贴文章内容 - await this.page.keyboard.down('Control') - await this.page.keyboard.press('KeyV') - await this.page.keyboard.up('Control') - await this.page.waitFor(500) - - // 获取文章内容 - const content = await this.page.evaluate(() => { - const el = document.querySelector('#paste') - return el.value - }) + // 读取剪切板内容 + const content = clipboardy.readSync() if (siteArticle.exists) { // 保存文章 - const article = await models.Article.findOne({_id: ObjectId(siteArticle.articleId)}) + const article = await models.Article.findOne({ _id: ObjectId(siteArticle.articleId) }) article.content = content article.contentHtml = this.converter.makeHtml(content) article.updateTs = new Date() await article.save() // 保存任务 - const task = await models.Task.findOne({platformId: this.platform._id, articleId: article._id}) + const task = await models.Task.findOne({ platformId: this.platform._id, articleId: article._id }) task.url = siteArticle.url task.status = constants.status.FINISHED task.updateTs = new Date() @@ -115,7 +110,7 @@ class JuejinImportSpider extends BaseImportSpider { authType: constants.authType.COOKIES, readNum: siteArticle.readNum, likeNum: siteArticle.likeNum, - commentNum: siteArticle.commentNum, + commentNum: siteArticle.commentNum }) await task.save() } diff --git a/backend/spiders/import/segmentfault.js b/spiders/import/segmentfault.js similarity index 100% rename from backend/spiders/import/segmentfault.js rename to spiders/import/segmentfault.js diff --git a/backend/spiders/index.js b/spiders/index.js similarity index 83% rename from backend/spiders/index.js rename to spiders/index.js index 260f75d..efe0241 100644 --- a/backend/spiders/index.js +++ b/spiders/index.js @@ -3,4 +3,5 @@ module.exports = { SegmentfaultSpider: require('./segmentfault'), JianshuSpider: require('./jianshu'), CsdnSpider: require('./csdn'), + ZhihuSpider: require('./zhihu'), } diff --git a/backend/spiders/jianshu.js b/spiders/jianshu.js similarity index 100% rename from backend/spiders/jianshu.js rename to spiders/jianshu.js diff --git a/backend/spiders/juejin.js b/spiders/juejin.js similarity index 100% rename from backend/spiders/juejin.js rename to spiders/juejin.js diff --git a/backend/spiders/segmentfault.js b/spiders/segmentfault.js similarity index 100% rename from backend/spiders/segmentfault.js rename to spiders/segmentfault.js diff --git a/spiders/zhihu.js b/spiders/zhihu.js new file mode 100644 index 0000000..9b2dd20 --- /dev/null +++ b/spiders/zhihu.js @@ -0,0 +1,49 @@ +const BaseSpider = require('./base') +const constants = require('../constants') + +class ZhihuSpider extends BaseSpider { + async inputContent(article, editorSel) { + const el = document.querySelector(editorSel.content) + el.focus() + document.execCommand('insertText', false, '') + document.execCommand('insertHTML', false, article.contentHtml) + } + + async inputFooter(article, editorSel) { + // do nothing + } + + async afterInputEditor() { + // 点击发布文章 + const elPubBtn = await this.page.$('.PublishPanel-triggerButton') + await elPubBtn.click() + await this.page.waitFor(5000) + + // 选择标签 + const tags = this.task.tag.split(',') + for (const tag of tags) { + const elTagInput = await this.page.$('.PublishPanel-searchInput') + await elTagInput.type(tag) + await this.page.waitFor(5000) + await this.page.evaluate(() => { + document.querySelector('.PublishPanel-suggest > li:nth-child(1)').click() + }) + } + await this.page.waitFor(5000) + } + + async afterPublish() { + // this.task.url = await this.page.evaluate(() => { + // const el = document.querySelector('a.title') + // return 'https://juejin.im' + el.getAttribute('href') + // }) + // this.task.updateTs = new Date() + // this.task.status = constants.status.FINISHED + // await this.task.save() + } + + async fetchStats() { + } +} + +module.exports = ZhihuSpider diff --git a/frontend/src/assets/img/csdn-logo.jpg b/src/assets/img/csdn-logo.jpg similarity index 100% rename from frontend/src/assets/img/csdn-logo.jpg rename to src/assets/img/csdn-logo.jpg diff --git a/frontend/src/assets/img/jianshu-logo.png b/src/assets/img/jianshu-logo.png similarity index 100% rename from frontend/src/assets/img/jianshu-logo.png rename to src/assets/img/jianshu-logo.png diff --git a/frontend/src/assets/img/juejin-logo.svg b/src/assets/img/juejin-logo.svg similarity index 100% rename from frontend/src/assets/img/juejin-logo.svg rename to src/assets/img/juejin-logo.svg diff --git a/frontend/src/assets/img/segmentfault-logo.jpg b/src/assets/img/segmentfault-logo.jpg similarity index 100% rename from frontend/src/assets/img/segmentfault-logo.jpg rename to src/assets/img/segmentfault-logo.jpg diff --git a/frontend/src/assets/logo.svg b/src/assets/logo.svg similarity index 100% rename from frontend/src/assets/logo.svg rename to src/assets/logo.svg diff --git a/frontend/src/components/Authorized/Authorized.tsx b/src/components/Authorized/Authorized.tsx similarity index 100% rename from frontend/src/components/Authorized/Authorized.tsx rename to src/components/Authorized/Authorized.tsx diff --git a/frontend/src/components/Authorized/AuthorizedRoute.tsx b/src/components/Authorized/AuthorizedRoute.tsx similarity index 100% rename from frontend/src/components/Authorized/AuthorizedRoute.tsx rename to src/components/Authorized/AuthorizedRoute.tsx diff --git a/frontend/src/components/Authorized/CheckPermissions.tsx b/src/components/Authorized/CheckPermissions.tsx similarity index 100% rename from frontend/src/components/Authorized/CheckPermissions.tsx rename to src/components/Authorized/CheckPermissions.tsx diff --git a/frontend/src/components/Authorized/PromiseRender.tsx b/src/components/Authorized/PromiseRender.tsx similarity index 100% rename from frontend/src/components/Authorized/PromiseRender.tsx rename to src/components/Authorized/PromiseRender.tsx diff --git a/frontend/src/components/Authorized/Secured.tsx b/src/components/Authorized/Secured.tsx similarity index 100% rename from frontend/src/components/Authorized/Secured.tsx rename to src/components/Authorized/Secured.tsx diff --git a/frontend/src/components/Authorized/index.tsx b/src/components/Authorized/index.tsx similarity index 100% rename from frontend/src/components/Authorized/index.tsx rename to src/components/Authorized/index.tsx diff --git a/frontend/src/components/Authorized/renderAuthorize.ts b/src/components/Authorized/renderAuthorize.ts similarity index 100% rename from frontend/src/components/Authorized/renderAuthorize.ts rename to src/components/Authorized/renderAuthorize.ts diff --git a/frontend/src/components/CopyBlock/index.less b/src/components/CopyBlock/index.less similarity index 100% rename from frontend/src/components/CopyBlock/index.less rename to src/components/CopyBlock/index.less diff --git a/frontend/src/components/CopyBlock/index.tsx b/src/components/CopyBlock/index.tsx similarity index 100% rename from frontend/src/components/CopyBlock/index.tsx rename to src/components/CopyBlock/index.tsx diff --git a/frontend/src/components/GlobalHeader/AvatarDropdown.tsx b/src/components/GlobalHeader/AvatarDropdown.tsx similarity index 100% rename from frontend/src/components/GlobalHeader/AvatarDropdown.tsx rename to src/components/GlobalHeader/AvatarDropdown.tsx diff --git a/frontend/src/components/GlobalHeader/NoticeIconView.tsx b/src/components/GlobalHeader/NoticeIconView.tsx similarity index 100% rename from frontend/src/components/GlobalHeader/NoticeIconView.tsx rename to src/components/GlobalHeader/NoticeIconView.tsx diff --git a/frontend/src/components/GlobalHeader/RightContent.tsx b/src/components/GlobalHeader/RightContent.tsx similarity index 100% rename from frontend/src/components/GlobalHeader/RightContent.tsx rename to src/components/GlobalHeader/RightContent.tsx diff --git a/frontend/src/components/GlobalHeader/index.less b/src/components/GlobalHeader/index.less similarity index 100% rename from frontend/src/components/GlobalHeader/index.less rename to src/components/GlobalHeader/index.less diff --git a/frontend/src/components/HeaderDropdown/index.less b/src/components/HeaderDropdown/index.less similarity index 100% rename from frontend/src/components/HeaderDropdown/index.less rename to src/components/HeaderDropdown/index.less diff --git a/frontend/src/components/HeaderDropdown/index.tsx b/src/components/HeaderDropdown/index.tsx similarity index 100% rename from frontend/src/components/HeaderDropdown/index.tsx rename to src/components/HeaderDropdown/index.tsx diff --git a/frontend/src/components/HeaderSearch/index.less b/src/components/HeaderSearch/index.less similarity index 100% rename from frontend/src/components/HeaderSearch/index.less rename to src/components/HeaderSearch/index.less diff --git a/frontend/src/components/HeaderSearch/index.tsx b/src/components/HeaderSearch/index.tsx similarity index 100% rename from frontend/src/components/HeaderSearch/index.tsx rename to src/components/HeaderSearch/index.tsx diff --git a/frontend/src/components/NoticeIcon/NoticeList.less b/src/components/NoticeIcon/NoticeList.less old mode 100755 new mode 100644 similarity index 100% rename from frontend/src/components/NoticeIcon/NoticeList.less rename to src/components/NoticeIcon/NoticeList.less diff --git a/frontend/src/components/NoticeIcon/NoticeList.tsx b/src/components/NoticeIcon/NoticeList.tsx similarity index 100% rename from frontend/src/components/NoticeIcon/NoticeList.tsx rename to src/components/NoticeIcon/NoticeList.tsx diff --git a/frontend/src/components/NoticeIcon/index.less b/src/components/NoticeIcon/index.less similarity index 100% rename from frontend/src/components/NoticeIcon/index.less rename to src/components/NoticeIcon/index.less diff --git a/frontend/src/components/NoticeIcon/index.tsx b/src/components/NoticeIcon/index.tsx similarity index 100% rename from frontend/src/components/NoticeIcon/index.tsx rename to src/components/NoticeIcon/index.tsx diff --git a/frontend/src/components/PageLoading/index.tsx b/src/components/PageLoading/index.tsx similarity index 100% rename from frontend/src/components/PageLoading/index.tsx rename to src/components/PageLoading/index.tsx diff --git a/frontend/src/components/SelectLang/index.less b/src/components/SelectLang/index.less similarity index 100% rename from frontend/src/components/SelectLang/index.less rename to src/components/SelectLang/index.less diff --git a/frontend/src/components/SelectLang/index.tsx b/src/components/SelectLang/index.tsx similarity index 100% rename from frontend/src/components/SelectLang/index.tsx rename to src/components/SelectLang/index.tsx diff --git a/frontend/src/components/SettingDrawer/themeColorClient.ts b/src/components/SettingDrawer/themeColorClient.ts similarity index 100% rename from frontend/src/components/SettingDrawer/themeColorClient.ts rename to src/components/SettingDrawer/themeColorClient.ts diff --git a/frontend/src/constants.ts b/src/constants.ts similarity index 95% rename from frontend/src/constants.ts rename to src/constants.ts index f9fd793..1591c39 100644 --- a/frontend/src/constants.ts +++ b/src/constants.ts @@ -4,6 +4,7 @@ export default { SEGMENTFAULT: 'segmentfault', JIANSHU: 'jianshu', CSDN: 'csdn', + ZHIHU: 'zhihu', }, status: { NOT_STARTED: 'not-started', diff --git a/frontend/src/e2e/__mocks__/antd-pro-merge-less.js b/src/e2e/__mocks__/antd-pro-merge-less.js similarity index 100% rename from frontend/src/e2e/__mocks__/antd-pro-merge-less.js rename to src/e2e/__mocks__/antd-pro-merge-less.js diff --git a/frontend/src/e2e/baseLayout.e2e.js b/src/e2e/baseLayout.e2e.js similarity index 100% rename from frontend/src/e2e/baseLayout.e2e.js rename to src/e2e/baseLayout.e2e.js diff --git a/frontend/src/e2e/topMenu.e2e.js b/src/e2e/topMenu.e2e.js similarity index 100% rename from frontend/src/e2e/topMenu.e2e.js rename to src/e2e/topMenu.e2e.js diff --git a/frontend/src/global.less b/src/global.less similarity index 100% rename from frontend/src/global.less rename to src/global.less diff --git a/frontend/src/global.tsx b/src/global.tsx similarity index 100% rename from frontend/src/global.tsx rename to src/global.tsx diff --git a/frontend/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx similarity index 100% rename from frontend/src/layouts/BasicLayout.tsx rename to src/layouts/BasicLayout.tsx diff --git a/frontend/src/layouts/BlankLayout.tsx b/src/layouts/BlankLayout.tsx similarity index 100% rename from frontend/src/layouts/BlankLayout.tsx rename to src/layouts/BlankLayout.tsx diff --git a/frontend/src/layouts/UserLayout.less b/src/layouts/UserLayout.less old mode 100755 new mode 100644 similarity index 100% rename from frontend/src/layouts/UserLayout.less rename to src/layouts/UserLayout.less diff --git a/frontend/src/layouts/UserLayout.tsx b/src/layouts/UserLayout.tsx similarity index 100% rename from frontend/src/layouts/UserLayout.tsx rename to src/layouts/UserLayout.tsx diff --git a/frontend/src/locales/en-US.ts b/src/locales/en-US.ts similarity index 100% rename from frontend/src/locales/en-US.ts rename to src/locales/en-US.ts diff --git a/frontend/src/locales/en-US/component.ts b/src/locales/en-US/component.ts similarity index 100% rename from frontend/src/locales/en-US/component.ts rename to src/locales/en-US/component.ts diff --git a/frontend/src/locales/en-US/globalHeader.ts b/src/locales/en-US/globalHeader.ts similarity index 100% rename from frontend/src/locales/en-US/globalHeader.ts rename to src/locales/en-US/globalHeader.ts diff --git a/frontend/src/locales/en-US/menu.ts b/src/locales/en-US/menu.ts similarity index 100% rename from frontend/src/locales/en-US/menu.ts rename to src/locales/en-US/menu.ts diff --git a/frontend/src/locales/en-US/pwa.ts b/src/locales/en-US/pwa.ts similarity index 100% rename from frontend/src/locales/en-US/pwa.ts rename to src/locales/en-US/pwa.ts diff --git a/frontend/src/locales/en-US/settingDrawer.ts b/src/locales/en-US/settingDrawer.ts similarity index 100% rename from frontend/src/locales/en-US/settingDrawer.ts rename to src/locales/en-US/settingDrawer.ts diff --git a/frontend/src/locales/en-US/settings.ts b/src/locales/en-US/settings.ts similarity index 100% rename from frontend/src/locales/en-US/settings.ts rename to src/locales/en-US/settings.ts diff --git a/frontend/src/locales/pt-BR.ts b/src/locales/pt-BR.ts similarity index 100% rename from frontend/src/locales/pt-BR.ts rename to src/locales/pt-BR.ts diff --git a/frontend/src/locales/pt-BR/component.ts b/src/locales/pt-BR/component.ts similarity index 100% rename from frontend/src/locales/pt-BR/component.ts rename to src/locales/pt-BR/component.ts diff --git a/frontend/src/locales/pt-BR/globalHeader.ts b/src/locales/pt-BR/globalHeader.ts similarity index 100% rename from frontend/src/locales/pt-BR/globalHeader.ts rename to src/locales/pt-BR/globalHeader.ts diff --git a/frontend/src/locales/pt-BR/menu.ts b/src/locales/pt-BR/menu.ts similarity index 100% rename from frontend/src/locales/pt-BR/menu.ts rename to src/locales/pt-BR/menu.ts diff --git a/frontend/src/locales/pt-BR/pwa.ts b/src/locales/pt-BR/pwa.ts similarity index 100% rename from frontend/src/locales/pt-BR/pwa.ts rename to src/locales/pt-BR/pwa.ts diff --git a/frontend/src/locales/pt-BR/settingDrawer.ts b/src/locales/pt-BR/settingDrawer.ts similarity index 100% rename from frontend/src/locales/pt-BR/settingDrawer.ts rename to src/locales/pt-BR/settingDrawer.ts diff --git a/frontend/src/locales/pt-BR/settings.ts b/src/locales/pt-BR/settings.ts similarity index 100% rename from frontend/src/locales/pt-BR/settings.ts rename to src/locales/pt-BR/settings.ts diff --git a/frontend/src/locales/zh-CN.ts b/src/locales/zh-CN.ts similarity index 100% rename from frontend/src/locales/zh-CN.ts rename to src/locales/zh-CN.ts diff --git a/frontend/src/locales/zh-CN/component.ts b/src/locales/zh-CN/component.ts similarity index 100% rename from frontend/src/locales/zh-CN/component.ts rename to src/locales/zh-CN/component.ts diff --git a/frontend/src/locales/zh-CN/globalHeader.ts b/src/locales/zh-CN/globalHeader.ts similarity index 100% rename from frontend/src/locales/zh-CN/globalHeader.ts rename to src/locales/zh-CN/globalHeader.ts diff --git a/frontend/src/locales/zh-CN/menu.ts b/src/locales/zh-CN/menu.ts similarity index 100% rename from frontend/src/locales/zh-CN/menu.ts rename to src/locales/zh-CN/menu.ts diff --git a/frontend/src/locales/zh-CN/pwa.ts b/src/locales/zh-CN/pwa.ts similarity index 100% rename from frontend/src/locales/zh-CN/pwa.ts rename to src/locales/zh-CN/pwa.ts diff --git a/frontend/src/locales/zh-CN/settingDrawer.ts b/src/locales/zh-CN/settingDrawer.ts similarity index 100% rename from frontend/src/locales/zh-CN/settingDrawer.ts rename to src/locales/zh-CN/settingDrawer.ts diff --git a/frontend/src/locales/zh-CN/settings.ts b/src/locales/zh-CN/settings.ts similarity index 100% rename from frontend/src/locales/zh-CN/settings.ts rename to src/locales/zh-CN/settings.ts diff --git a/frontend/src/locales/zh-TW.ts b/src/locales/zh-TW.ts similarity index 100% rename from frontend/src/locales/zh-TW.ts rename to src/locales/zh-TW.ts diff --git a/frontend/src/locales/zh-TW/component.ts b/src/locales/zh-TW/component.ts similarity index 100% rename from frontend/src/locales/zh-TW/component.ts rename to src/locales/zh-TW/component.ts diff --git a/frontend/src/locales/zh-TW/globalHeader.ts b/src/locales/zh-TW/globalHeader.ts similarity index 100% rename from frontend/src/locales/zh-TW/globalHeader.ts rename to src/locales/zh-TW/globalHeader.ts diff --git a/frontend/src/locales/zh-TW/menu.ts b/src/locales/zh-TW/menu.ts similarity index 100% rename from frontend/src/locales/zh-TW/menu.ts rename to src/locales/zh-TW/menu.ts diff --git a/frontend/src/locales/zh-TW/pwa.ts b/src/locales/zh-TW/pwa.ts similarity index 100% rename from frontend/src/locales/zh-TW/pwa.ts rename to src/locales/zh-TW/pwa.ts diff --git a/frontend/src/locales/zh-TW/settingDrawer.ts b/src/locales/zh-TW/settingDrawer.ts similarity index 100% rename from frontend/src/locales/zh-TW/settingDrawer.ts rename to src/locales/zh-TW/settingDrawer.ts diff --git a/frontend/src/locales/zh-TW/settings.ts b/src/locales/zh-TW/settings.ts similarity index 100% rename from frontend/src/locales/zh-TW/settings.ts rename to src/locales/zh-TW/settings.ts diff --git a/frontend/src/manifest.json b/src/manifest.json similarity index 100% rename from frontend/src/manifest.json rename to src/manifest.json diff --git a/frontend/src/models/article.ts b/src/models/article.ts similarity index 100% rename from frontend/src/models/article.ts rename to src/models/article.ts diff --git a/frontend/src/models/connect.d.ts b/src/models/connect.d.ts similarity index 100% rename from frontend/src/models/connect.d.ts rename to src/models/connect.d.ts diff --git a/frontend/src/models/global.ts b/src/models/global.ts similarity index 100% rename from frontend/src/models/global.ts rename to src/models/global.ts diff --git a/frontend/src/models/login.ts b/src/models/login.ts similarity index 100% rename from frontend/src/models/login.ts rename to src/models/login.ts diff --git a/frontend/src/models/platform.ts b/src/models/platform.ts similarity index 84% rename from frontend/src/models/platform.ts rename to src/models/platform.ts index c3c1e0e..02b15c6 100644 --- a/frontend/src/models/platform.ts +++ b/src/models/platform.ts @@ -2,7 +2,8 @@ import { Effect } from 'dva'; import { addPlatform, deletePlatform, - fetchPlatformArticles, importPlatformArticles, + fetchPlatformArticles, + importPlatformArticles, queryPlatformList, savePlatform, } from '@/services/platform'; @@ -34,7 +35,7 @@ export interface PlatformModelState { modalVisible?: boolean; fetchModalVisible?: boolean; fetchLoading?: boolean; - importProgressModalVisible?: boolean; + importLoading?: boolean; } export interface PlatformModelType { @@ -50,7 +51,6 @@ export interface PlatformModelType { saveFetchModalVisible: Effect; fetchSiteArticles: Effect; saveSiteArticles: Effect; - saveImportProgressModalVisible: Effect; importArticles: Effect; }; reducers: { @@ -60,7 +60,7 @@ export interface PlatformModelType { setCurrentPlatform: Reducer; setSiteArticles: Reducer; setFetchLoading: Reducer; - setImportProgressModalVisible: Reducer; + setImportLoading: Reducer; }; } @@ -72,7 +72,7 @@ const PlatformModel: PlatformModelType = { modalVisible: false, fetchModalVisible: false, fetchLoading: false, - importProgressModalVisible: false, + importLoading: false, }, effects: { @@ -138,15 +138,26 @@ const PlatformModel: PlatformModelType = { payload: action.payload, }); }, - *saveImportProgressModalVisible(action, {put}) { + *importArticles(action, { put, call }) { yield put({ - type: 'setImportProgressModalVisible', - payload: action.payload, - }) + type: 'setImportLoading', + payload: true, + }); + const response = yield call(importPlatformArticles, action.payload); + if (response) { + message.success('文章导入完毕'); + } else { + message.error('文章导入出错'); + } + yield put({ + type: 'setImportLoading', + payload: false, + }); + yield put({ + type: 'setFetchModalVisible', + payload: false, + }); }, - *importArticles(action, {call}) { - yield call(importPlatformArticles, action.payload); - } }, reducers: { @@ -186,12 +197,12 @@ const PlatformModel: PlatformModelType = { fetchLoading: action.payload, }; }, - setImportProgressModalVisible(state, action) { + setImportLoading(state, action) { return { ...state, - importProgressModalVisible: action.payload, - } - } + importLoading: action.payload, + }; + }, }, }; diff --git a/frontend/src/models/setting.ts b/src/models/setting.ts similarity index 100% rename from frontend/src/models/setting.ts rename to src/models/setting.ts diff --git a/frontend/src/models/task.ts b/src/models/task.ts similarity index 100% rename from frontend/src/models/task.ts rename to src/models/task.ts diff --git a/frontend/src/models/user.ts b/src/models/user.ts similarity index 100% rename from frontend/src/models/user.ts rename to src/models/user.ts diff --git a/src/pages/.umi/LocaleWrapper.jsx b/src/pages/.umi/LocaleWrapper.jsx new file mode 100644 index 0000000..08a1d24 --- /dev/null +++ b/src/pages/.umi/LocaleWrapper.jsx @@ -0,0 +1,155 @@ +import React from 'react'; +import { + _setIntlObject, + addLocaleData, + IntlProvider, + intlShape, + LangContext, + _setLocaleContext +} from 'umi-plugin-locale'; + +const InjectedWrapper = (() => { + let sfc = (props, context) => { + _setIntlObject(context.intl); + return props.children; + }; + sfc.contextTypes = { + intl: intlShape, + }; + return sfc; +})(); + +import 'moment/locale/pt-br'; +import 'moment/locale/zh-cn'; +import 'moment/locale/zh-tw'; + +const baseNavigator = true; +const baseSeparator = '-'; +const useLocalStorage = true; + +import { LocaleProvider, version } from 'antd'; +import moment from 'moment'; +import 'moment/locale/zh-cn'; +let defaultAntd = require('antd/lib/locale-provider/zh_CN'); +defaultAntd = defaultAntd.default || defaultAntd; + +const localeInfo = { + 'en-US': { + messages: { + ...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/marvzhang/artipub/src/locales/en-US.ts')), + }, + locale: 'en-US', + antd: require('antd/lib/locale-provider/en_US'), + data: require('react-intl/locale-data/en'), + momentLocale: '', + }, + 'pt-BR': { + messages: { + ...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/marvzhang/artipub/src/locales/pt-BR.ts')), + }, + locale: 'pt-BR', + antd: require('antd/lib/locale-provider/pt_BR'), + data: require('react-intl/locale-data/pt'), + momentLocale: 'pt-br', + }, + 'zh-CN': { + messages: { + ...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/marvzhang/artipub/src/locales/zh-CN.ts')), + }, + locale: 'zh-CN', + antd: require('antd/lib/locale-provider/zh_CN'), + data: require('react-intl/locale-data/zh'), + momentLocale: 'zh-cn', + }, + 'zh-TW': { + messages: { + ...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/marvzhang/artipub/src/locales/zh-TW.ts')), + }, + locale: 'zh-TW', + antd: require('antd/lib/locale-provider/zh_TW'), + data: require('react-intl/locale-data/zh'), + momentLocale: 'zh-tw', + }, +}; + +class LocaleWrapper extends React.Component{ + state = { + locale: 'zh-CN', + }; + getAppLocale(){ + let appLocale = { + locale: 'zh-CN', + messages: {}, + data: require('react-intl/locale-data/zh'), + momentLocale: 'zh-cn', + }; + + const runtimeLocale = require('umi/_runtimePlugin').mergeConfig('locale') || {}; + const runtimeLocaleDefault = typeof runtimeLocale.default === 'function' ? runtimeLocale.default() : runtimeLocale.default; + if ( + useLocalStorage + && typeof localStorage !== 'undefined' + && localStorage.getItem('umi_locale') + && localeInfo[localStorage.getItem('umi_locale')] + ) { + appLocale = localeInfo[localStorage.getItem('umi_locale')]; + } else if ( + typeof navigator !== 'undefined' + && localeInfo[navigator.language] + && baseNavigator + ) { + appLocale = localeInfo[navigator.language]; + } else if(localeInfo[runtimeLocaleDefault]){ + appLocale = localeInfo[runtimeLocaleDefault]; + } else { + appLocale = localeInfo['zh-CN'] || appLocale; + } + window.g_lang = appLocale.locale; + window.g_langSeparator = baseSeparator || '-'; + appLocale.data && addLocaleData(appLocale.data); + return appLocale; + } + reloadAppLocale = () => { + const appLocale = this.getAppLocale(); + this.setState({ + locale: appLocale.locale, + }); + }; + + render(){ + const appLocale = this.getAppLocale(); + // react-intl must use `-` separator + const reactIntlLocale = appLocale.locale.split(baseSeparator).join('-'); + const LangContextValue = { + locale: reactIntlLocale, + reloadAppLocale: this.reloadAppLocale, + }; + let ret = this.props.children; + ret = ( + + + {(value) => { + _setLocaleContext(value); + return this.props.children + }} + + + ) + // avoid antd ConfigProvider not found + let AntdProvider = LocaleProvider; + const [major, minor] = `${version || ''}`.split('.'); + // antd 3.21.0 use ConfigProvider not LocaleProvider + const isConfigProvider = Number(major) > 3 || (Number(major) >= 3 && Number(minor) >= 21); + if (isConfigProvider) { + try { + AntdProvider = require('antd/lib/config-provider').default; + } catch (e) {} + } + + return ( + {ret} + ); + return ret; + } +} +export default LocaleWrapper; diff --git a/src/pages/.umi/dva.js b/src/pages/.umi/dva.js new file mode 100644 index 0000000..1e33afe --- /dev/null +++ b/src/pages/.umi/dva.js @@ -0,0 +1,43 @@ +import dva from 'dva'; +import { Component } from 'react'; +import createLoading from 'dva-loading'; +import history from '@tmp/history'; + +let app = null; + +export function _onCreate() { + const plugins = require('umi/_runtimePlugin'); + const runtimeDva = plugins.mergeConfig('dva'); + app = dva({ + history, + + ...(runtimeDva.config || {}), + ...(window.g_useSSR ? { initialState: window.g_initialData } : {}), + }); + + app.use(createLoading()); + (runtimeDva.plugins || []).forEach(plugin => { + app.use(plugin); + }); + + app.model({ namespace: 'article', ...(require('C:/Users/marvzhang/artipub/src/models/article.ts').default) }); +app.model({ namespace: 'global', ...(require('C:/Users/marvzhang/artipub/src/models/global.ts').default) }); +app.model({ namespace: 'login', ...(require('C:/Users/marvzhang/artipub/src/models/login.ts').default) }); +app.model({ namespace: 'platform', ...(require('C:/Users/marvzhang/artipub/src/models/platform.ts').default) }); +app.model({ namespace: 'setting', ...(require('C:/Users/marvzhang/artipub/src/models/setting.ts').default) }); +app.model({ namespace: 'task', ...(require('C:/Users/marvzhang/artipub/src/models/task.ts').default) }); +app.model({ namespace: 'user', ...(require('C:/Users/marvzhang/artipub/src/models/user.ts').default) }); + return app; +} + +export function getApp() { + return app; +} + +export class _DvaContainer extends Component { + render() { + const app = getApp(); + app.router(() => this.props.children); + return app.start()(); + } +} diff --git a/src/pages/.umi/history.js b/src/pages/.umi/history.js new file mode 100644 index 0000000..26941fa --- /dev/null +++ b/src/pages/.umi/history.js @@ -0,0 +1,6 @@ +// create history +const history = require('umi/lib/createHistory').default({ + basename: window.routerBase, +}); +window.g_history = history; +export default history; diff --git a/src/pages/.umi/polyfills.js b/src/pages/.umi/polyfills.js new file mode 100644 index 0000000..15e4cf6 --- /dev/null +++ b/src/pages/.umi/polyfills.js @@ -0,0 +1,6 @@ +import 'core-js'; +import 'regenerator-runtime/runtime'; + +// Include this seperatly since it's not included in core-js +// ref: https://github.com/zloirock/core-js/issues/117 +import '../../../node_modules/umi-build-dev/node_modules/url-polyfill/url-polyfill.js'; diff --git a/src/pages/.umi/router.js b/src/pages/.umi/router.js new file mode 100644 index 0000000..830b32c --- /dev/null +++ b/src/pages/.umi/router.js @@ -0,0 +1,200 @@ +import React from 'react'; +import { Router as DefaultRouter, Route, Switch } from 'react-router-dom'; +import dynamic from 'umi/dynamic'; +import renderRoutes from 'umi/lib/renderRoutes'; +import history from '@tmp/history'; +import RendererWrapper0 from 'C:/Users/marvzhang/artipub/src/pages/.umi/LocaleWrapper.jsx'; +import _dvaDynamic from 'dva/dynamic'; + +const Router = require('dva/router').routerRedux.ConnectedRouter; + +const routes = [ + { + path: '/articles/edit/:id', + name: 'article-edit', + authority: ['admin', 'user'], + icon: 'read', + hideInMenu: true, + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__ArticleEdit__ArticleEdit" */ '../ArticleEdit/ArticleEdit'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../ArticleEdit/ArticleEdit').default, + exact: true, + }, + { + path: '/articles/new', + name: 'article-new', + authority: ['admin', 'user'], + icon: 'read', + hideInMenu: true, + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__ArticleEdit__ArticleEdit" */ '../ArticleEdit/ArticleEdit'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../ArticleEdit/ArticleEdit').default, + exact: true, + }, + { + path: '/paste', + name: 'paste', + authority: ['admin', 'user'], + icon: 'read', + hideInMenu: true, + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__Paste__Paste" */ '../Paste/Paste'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../Paste/Paste').default, + exact: true, + }, + { + path: '/demo', + name: 'demo', + authority: ['admin', 'user'], + icon: 'read', + hideInMenu: true, + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__Demo__Demo" */ '../Demo/Demo'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../Demo/Demo').default, + exact: true, + }, + { + path: '/', + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "layouts__BasicLayout" */ '../../layouts/BasicLayout'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../../layouts/BasicLayout').default, + Routes: [require('../Authorized').default], + authority: ['admin', 'user'], + routes: [ + { + path: '/', + redirect: '/platforms', + exact: true, + }, + { + path: '/platforms', + name: 'platforms', + icon: 'cloud', + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__PlatformList__PlatformList" */ '../PlatformList/PlatformList'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../PlatformList/PlatformList').default, + exact: true, + }, + { + path: '/articles', + name: 'articles', + icon: 'read', + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__ArticleList__ArticleList" */ '../ArticleList/ArticleList'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../ArticleList/ArticleList').default, + exact: true, + }, + { + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => + import(/* webpackChunkName: "p__404" */ '../404'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../404').default, + exact: true, + }, + { + component: () => + React.createElement( + require('C:/Users/marvzhang/artipub/node_modules/umi-build-dev/lib/plugins/404/NotFound.js') + .default, + { pagesPath: 'src/pages', hasRoutesInConfig: true }, + ), + }, + ], + }, + { + component: __IS_BROWSER + ? _dvaDynamic({ + component: () => import(/* webpackChunkName: "p__404" */ '../404'), + LoadingComponent: require('C:/Users/marvzhang/artipub/src/components/PageLoading/index') + .default, + }) + : require('../404').default, + exact: true, + }, + { + component: () => + React.createElement( + require('C:/Users/marvzhang/artipub/node_modules/umi-build-dev/lib/plugins/404/NotFound.js') + .default, + { pagesPath: 'src/pages', hasRoutesInConfig: true }, + ), + }, +]; +window.g_routes = routes; +const plugins = require('umi/_runtimePlugin'); +plugins.applyForEach('patchRoutes', { initialValue: routes }); + +export { routes }; + +export default class RouterWrapper extends React.Component { + unListen = () => {}; + + constructor(props) { + super(props); + + // route change handler + function routeChangeHandler(location, action) { + plugins.applyForEach('onRouteChange', { + initialValue: { + routes, + location, + action, + }, + }); + } + this.unListen = history.listen(routeChangeHandler); + routeChangeHandler(history.location); + } + + componentWillUnmount() { + this.unListen(); + } + + render() { + const props = this.props || {}; + return ( + + {renderRoutes(routes, props)} + + ); + } +} diff --git a/src/pages/.umi/umi.js b/src/pages/.umi/umi.js new file mode 100644 index 0000000..a2d2aac --- /dev/null +++ b/src/pages/.umi/umi.js @@ -0,0 +1,159 @@ +import './polyfills'; +import history from './history'; +import '../../global.tsx'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import findRoute, { + getUrlQuery, +} from 'C:/Users/marvzhang/artipub/node_modules/umi-build-dev/lib/findRoute.js'; + +// runtime plugins +const plugins = require('umi/_runtimePlugin'); +window.g_plugins = plugins; +plugins.init({ + validKeys: [ + 'patchRoutes', + 'render', + 'rootContainer', + 'modifyRouteProps', + 'onRouteChange', + 'modifyInitialProps', + 'initialProps', + 'dva', + 'locale', + ], +}); +plugins.use(require('../../../node_modules/umi-plugin-dva/lib/runtime')); + +const app = require('@tmp/dva')._onCreate(); +window.g_app = app; + +// render +let clientRender = async () => { + window.g_isBrowser = true; + let props = {}; + // Both support SSR and CSR + if (window.g_useSSR) { + // 如果开启服务端渲染则客户端组件初始化 props 使用服务端注入的数据 + props = window.g_initialData; + } else { + const pathname = location.pathname; + const activeRoute = findRoute(require('@tmp/router').routes, pathname); + // 在客户端渲染前,执行 getInitialProps 方法 + // 拿到初始数据 + if ( + activeRoute && + activeRoute.component && + activeRoute.component.getInitialProps + ) { + const initialProps = plugins.apply('modifyInitialProps', { + initialValue: {}, + }); + props = activeRoute.component.getInitialProps + ? await activeRoute.component.getInitialProps({ + route: activeRoute, + isServer: false, + location, + ...initialProps, + }) + : {}; + } + } + const rootContainer = plugins.apply('rootContainer', { + initialValue: React.createElement(require('./router').default, props), + }); + ReactDOM[window.g_useSSR ? 'hydrate' : 'render']( + rootContainer, + document.getElementById('root'), + ); +}; +const render = plugins.compose( + 'render', + { initialValue: clientRender }, +); + +const moduleBeforeRendererPromises = []; +// client render +if (__IS_BROWSER) { + Promise.all(moduleBeforeRendererPromises) + .then(() => { + render(); + }) + .catch(err => { + window.console && window.console.error(err); + }); +} + +// export server render +let serverRender, ReactDOMServer; +if (!__IS_BROWSER) { + serverRender = async (ctx = {}) => { + // ctx.req.url may be `/bar?locale=en-US` + const [pathname] = (ctx.req.url || '').split('?'); + const history = require('@tmp/history').default; + history.push(ctx.req.url); + let props = {}; + const activeRoute = + findRoute(require('./router').routes, pathname) || false; + if ( + activeRoute && + activeRoute.component && + activeRoute.component.getInitialProps + ) { + const initialProps = plugins.apply('modifyInitialProps', { + initialValue: {}, + }); + // patch query object + const location = history.location + ? { ...history.location, query: getUrlQuery(history.location.search) } + : {}; + props = await activeRoute.component.getInitialProps({ + route: activeRoute, + isServer: true, + location, + // only exist in server + req: ctx.req || {}, + res: ctx.res || {}, + ...initialProps, + }); + props = plugins.apply('initialProps', { + initialValue: props, + }); + } else { + // message activeRoute or getInitialProps not found + console.log( + !activeRoute + ? `${pathname} activeRoute not found` + : `${pathname} activeRoute's getInitialProps function not found`, + ); + } + const rootContainer = plugins.apply('rootContainer', { + initialValue: React.createElement(require('./router').default, props), + }); + const htmlTemplateMap = {}; + return { + htmlElement: + activeRoute && activeRoute.path + ? htmlTemplateMap[activeRoute.path] + : '', + rootContainer, + matchPath: activeRoute && activeRoute.path, + g_initialData: props, + }; + }; + // using project react-dom version + // https://github.com/facebook/react/issues/13991 + ReactDOMServer = require('react-dom/server'); +} + +export { ReactDOMServer }; +export default (__IS_BROWSER ? null : serverRender); + +require('../../global.less'); + +// hot module replacement +if (__IS_BROWSER && module.hot) { + module.hot.accept('./router', () => { + clientRender(); + }); +} diff --git a/src/pages/.umi/umiExports.js b/src/pages/.umi/umiExports.js new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/pages/404.tsx b/src/pages/404.tsx similarity index 100% rename from frontend/src/pages/404.tsx rename to src/pages/404.tsx diff --git a/frontend/src/pages/ArticleEdit/ArticleEdit.scss b/src/pages/ArticleEdit/ArticleEdit.scss similarity index 100% rename from frontend/src/pages/ArticleEdit/ArticleEdit.scss rename to src/pages/ArticleEdit/ArticleEdit.scss diff --git a/frontend/src/pages/ArticleEdit/ArticleEdit.tsx b/src/pages/ArticleEdit/ArticleEdit.tsx similarity index 100% rename from frontend/src/pages/ArticleEdit/ArticleEdit.tsx rename to src/pages/ArticleEdit/ArticleEdit.tsx diff --git a/frontend/src/pages/ArticleList/ArticleList.scss b/src/pages/ArticleList/ArticleList.scss similarity index 100% rename from frontend/src/pages/ArticleList/ArticleList.scss rename to src/pages/ArticleList/ArticleList.scss diff --git a/frontend/src/pages/ArticleList/ArticleList.tsx b/src/pages/ArticleList/ArticleList.tsx similarity index 97% rename from frontend/src/pages/ArticleList/ArticleList.tsx rename to src/pages/ArticleList/ArticleList.tsx index ae9b874..4eb525d 100644 --- a/frontend/src/pages/ArticleList/ArticleList.tsx +++ b/src/pages/ArticleList/ArticleList.tsx @@ -572,6 +572,18 @@ const ArticleList: React.FC = props => { ); + } else if (currentPlatform && currentPlatform.name === constants.platform.ZHIHU) { + platformContent = ( +
+ + + +
+ ); } return ( diff --git a/frontend/src/pages/Authorized.tsx b/src/pages/Authorized.tsx similarity index 100% rename from frontend/src/pages/Authorized.tsx rename to src/pages/Authorized.tsx diff --git a/frontend/src/pages/Demo/Demo.scss b/src/pages/Demo/Demo.scss similarity index 100% rename from frontend/src/pages/Demo/Demo.scss rename to src/pages/Demo/Demo.scss diff --git a/frontend/src/pages/Demo/Demo.tsx b/src/pages/Demo/Demo.tsx similarity index 100% rename from frontend/src/pages/Demo/Demo.tsx rename to src/pages/Demo/Demo.tsx diff --git a/frontend/src/pages/Paste/Paste.tsx b/src/pages/Paste/Paste.tsx similarity index 60% rename from frontend/src/pages/Paste/Paste.tsx rename to src/pages/Paste/Paste.tsx index 9a89af0..e9f8b73 100644 --- a/frontend/src/pages/Paste/Paste.tsx +++ b/src/pages/Paste/Paste.tsx @@ -3,7 +3,7 @@ import React from 'react'; const Paste: React.FC = () => { return (
-