Browse Source

fixed bug

dev
1549469775 3 years ago
parent
commit
531c1b8441
  1. 228
      pnpm-lock.yaml
  2. 8
      public/css/page/login.css
  3. 7
      route.txt
  4. BIN
      source/db/data.db
  5. 18
      source/plugins/index.ts
  6. 12
      source/route/views/index/index.ts
  7. 38
      source/route/views/login.ts
  8. 3
      source/run.ts
  9. 2
      source/schema/index.ts
  10. 23
      template/helper/flush.pug
  11. 13
      template/helper/ui.pug
  12. 6
      template/layout/layout.pug
  13. 44
      template/views/about.pug
  14. 20
      template/views/include/flush.pug
  15. 42
      template/views/index.pug
  16. 31
      template/views/login.pug

228
pnpm-lock.yaml

@ -1,4 +1,4 @@
lockfileVersion: 5.4
lockfileVersion: 5.3
specifiers:
'@hapi/code': ^9.0.1
@ -59,8 +59,8 @@ dependencies:
bcrypt: 5.0.1
fs-extra: 10.1.0
hapi-auth-jwt2: 10.2.0
hapi-sequelizejs: 4.5.0_qvf7o3m36i74qppgjxp4amnmp4
hapi-swagger: 14.2.0_7vfmy7cdcj4whrdhceanslo3uq
hapi-sequelizejs: 4.5.0_854bf76d9bf23fc83de64ddfc031ac7f
hapi-swagger: 14.2.0_@hapi+hapi@20.1.4+joi@17.4.0
joi: 17.4.0
json-merge-patch: 1.0.1
jsonwebtoken: 8.5.1
@ -88,7 +88,7 @@ devDependencies:
fast-glob: 3.2.11
file-type: 16.5.0
log4js: 6.4.1
ts-node: 10.0.0_tfhj3vxmzmwirfyh7roeacsfam
ts-node: 10.0.0_994e9dd6eccb2c889707fc5c400a4503
ts-node-dev: 1.1.6_typescript@4.3.2
tsc-alias: 1.7.0
tsconfig-paths: 3.9.0
@ -139,7 +139,7 @@ packages:
- supports-color
dev: true
/@babel/eslint-parser/7.18.9_454u7sltq2wfyzqnoclqps3oeu:
/@babel/eslint-parser/7.18.9_@babel+core@7.18.9+eslint@8.20.0:
resolution: {integrity: sha512-KzSGpMBggz4fKbRbWLNyPVTuQr6cmCcBhOyXTw/fieOVaw5oYAwcAj4a7UKcDYCPxQq+CG1NCDZH9e2JTXquiQ==}
engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0}
peerDependencies:
@ -333,7 +333,7 @@ packages:
dev: false
/@hapi/b64/5.0.0:
resolution: {integrity: sha512-ngu0tSEmrezoiIaNGG6rRvKOUkUuDdf4XTPnONHGYfSGRmDqPZX5oJL6HAdKTo1UQHECbdB4OzhWrfgVppjHUw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@hapi/b64/-/b64-5.0.0.tgz}
resolution: {integrity: sha512-ngu0tSEmrezoiIaNGG6rRvKOUkUuDdf4XTPnONHGYfSGRmDqPZX5oJL6HAdKTo1UQHECbdB4OzhWrfgVppjHUw==}
dependencies:
'@hapi/hoek': 9.2.0
@ -437,7 +437,7 @@ packages:
dependencies:
'@hapi/boom': 9.1.2
/@hapi/eslint-plugin/6.0.0_wqcvymnvjgsbm7r7tbeuxzyrdi:
/@hapi/eslint-plugin/6.0.0_b4055c31b549a4167e3f98494be7111a:
resolution: {integrity: sha512-6eN1fnBO742nTTSpQtYB35aFGAT9I7r4u2v/+R2c9ToYTQp4QBoPOBA5R3+C7+Az3I0ugs+lTIqAsMPDLpsRAg==}
peerDependencies:
'@babel/core': ^7.14.3
@ -449,7 +449,7 @@ packages:
optional: true
dependencies:
'@babel/core': 7.18.9_supports-color@8.1.1
'@babel/eslint-parser': 7.18.9_454u7sltq2wfyzqnoclqps3oeu
'@babel/eslint-parser': 7.18.9_@babel+core@7.18.9+eslint@8.20.0
dev: true
/@hapi/file/2.0.0:
@ -506,7 +506,7 @@ packages:
dev: false
/@hapi/iron/6.0.0:
resolution: {integrity: sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@hapi/iron/-/iron-6.0.0.tgz}
resolution: {integrity: sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw==}
dependencies:
'@hapi/b64': 5.0.0
'@hapi/boom': 9.1.2
@ -524,9 +524,9 @@ packages:
optional: true
dependencies:
'@babel/core': 7.18.9_supports-color@8.1.1
'@babel/eslint-parser': 7.18.9_454u7sltq2wfyzqnoclqps3oeu
'@babel/eslint-parser': 7.18.9_@babel+core@7.18.9+eslint@8.20.0
'@hapi/bossy': 6.0.0
'@hapi/eslint-plugin': 6.0.0_wqcvymnvjgsbm7r7tbeuxzyrdi
'@hapi/eslint-plugin': 6.0.0_b4055c31b549a4167e3f98494be7111a
'@hapi/hoek': 10.0.0
diff: 5.1.0
eslint: 8.20.0_supports-color@8.1.1
@ -568,7 +568,7 @@ packages:
dev: false
/@hapi/podium/4.1.3:
resolution: {integrity: sha512-ljsKGQzLkFqnQxE7qeanvgGj4dejnciErYd30dbrYzUOF/FyS/DOF97qcrT3bhoVwCYmxa6PEMhxfCPlnUcD2g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@hapi/podium/-/podium-4.1.3.tgz}
resolution: {integrity: sha512-ljsKGQzLkFqnQxE7qeanvgGj4dejnciErYd30dbrYzUOF/FyS/DOF97qcrT3bhoVwCYmxa6PEMhxfCPlnUcD2g==}
dependencies:
'@hapi/hoek': 9.2.0
'@hapi/teamwork': 5.1.0
@ -768,7 +768,7 @@ packages:
'@hapi/hoek': 9.2.0
/@sideway/address/4.1.3:
resolution: {integrity: sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@sideway/address/-/address-4.1.3.tgz}
resolution: {integrity: sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==}
dependencies:
'@hapi/hoek': 9.2.0
@ -824,7 +824,7 @@ packages:
resolution: {integrity: sha512-A6ivRrXD5glmnJna1UAGw87QNZRp/vdFO9U4GS+WhOMWzHnw+oTGkMvg0g6y1930CbeheGOCm7A1qHsqH7AXqg==}
/@types/hapi__cookie/10.1.4:
resolution: {integrity: sha512-CESd2IRnTYAnr+gxHGTXIuLOvi5+M2dw4aG6efP+K6bVTdE385Cu63k/DNLO6iQX0hoXtxCYUKy1QyQEy/Xg5A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/hapi__cookie/-/hapi__cookie-10.1.4.tgz}
resolution: {integrity: sha512-CESd2IRnTYAnr+gxHGTXIuLOvi5+M2dw4aG6efP+K6bVTdE385Cu63k/DNLO6iQX0hoXtxCYUKy1QyQEy/Xg5A==}
dependencies:
'@types/hapi__hapi': 20.0.10
joi: 17.6.0
@ -838,7 +838,7 @@ packages:
dev: true
/@types/hapi__hapi/20.0.10:
resolution: {integrity: sha512-Nt/SY/20/JAlHhbgH616j0g18vsANR9OWoyMdQcytlW6o7TBN+wRgf0MB8AgzjYpuzQam5oTiqyED9WwHmQKYQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/hapi__hapi/-/hapi__hapi-20.0.10.tgz}
resolution: {integrity: sha512-Nt/SY/20/JAlHhbgH616j0g18vsANR9OWoyMdQcytlW6o7TBN+wRgf0MB8AgzjYpuzQam5oTiqyED9WwHmQKYQ==}
dependencies:
'@hapi/boom': 9.1.2
'@hapi/iron': 6.0.0
@ -850,17 +850,17 @@ packages:
joi: 17.4.0
/@types/hapi__mimos/4.1.4:
resolution: {integrity: sha512-i9hvJpFYTT/qzB5xKWvDYaSXrIiNqi4ephi+5Lo6+DoQdwqPXQgmVVOZR+s3MBiHoFqsCZCX9TmVWG3HczmTEQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/hapi__mimos/-/hapi__mimos-4.1.4.tgz}
resolution: {integrity: sha512-i9hvJpFYTT/qzB5xKWvDYaSXrIiNqi4ephi+5Lo6+DoQdwqPXQgmVVOZR+s3MBiHoFqsCZCX9TmVWG3HczmTEQ==}
dependencies:
'@types/mime-db': 1.43.1
/@types/hapi__shot/4.1.2:
resolution: {integrity: sha512-8wWgLVP1TeGqgzZtCdt+F+k15DWQvLG1Yv6ZzPfb3D5WIo5/S+GGKtJBVo2uNEcqabP5Ifc71QnJTDnTmw1axA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/hapi__shot/-/hapi__shot-4.1.2.tgz}
resolution: {integrity: sha512-8wWgLVP1TeGqgzZtCdt+F+k15DWQvLG1Yv6ZzPfb3D5WIo5/S+GGKtJBVo2uNEcqabP5Ifc71QnJTDnTmw1axA==}
dependencies:
'@types/node': 17.0.21
/@types/hapi__vision/5.5.3:
resolution: {integrity: sha512-R4+r9345+5LCM8/0OQ1J8UVVPwnOwMdUVtPrtJE4oNbZ31+rLSy/bLoGpuZJwjROeC006YXbibnRF1hcVQFjGA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/hapi__vision/-/hapi__vision-5.5.3.tgz}
resolution: {integrity: sha512-R4+r9345+5LCM8/0OQ1J8UVVPwnOwMdUVtPrtJE4oNbZ31+rLSy/bLoGpuZJwjROeC006YXbibnRF1hcVQFjGA==}
dependencies:
'@types/hapi__hapi': 20.0.10
handlebars: 4.7.7
@ -884,7 +884,7 @@ packages:
dev: false
/@types/mime-db/1.43.1:
resolution: {integrity: sha512-kGZJY+R+WnR5Rk+RPHUMERtb2qBRViIHCBdtUrY+NmwuGb8pQdfTqQiCKPrxpdoycl8KWm2DLdkpoSdt479XoQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/@types/mime-db/-/mime-db-1.43.1.tgz}
resolution: {integrity: sha512-kGZJY+R+WnR5Rk+RPHUMERtb2qBRViIHCBdtUrY+NmwuGb8pQdfTqQiCKPrxpdoycl8KWm2DLdkpoSdt479XoQ==}
/@types/node/17.0.21:
resolution: {integrity: sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==}
@ -1258,7 +1258,7 @@ packages:
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.2
fsevents: registry.npmmirror.com/fsevents/2.3.2
/chokidar/3.5.3:
resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
@ -1272,7 +1272,7 @@ packages:
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.2
fsevents: registry.npmmirror.com/fsevents/2.3.2
dev: true
/chownr/1.1.4:
@ -1331,12 +1331,6 @@ packages:
dev: false
optional: true
/commander/2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
requiresBuild: true
dev: false
optional: true
/commander/9.4.0:
resolution: {integrity: sha512-sRPT+umqkz90UA8M1yqYfnHlZA7fF6nSphDtxeywPZ49ysjxDQybzk13CL+mXekDRG92skbcqCLVovuCusNmFw==}
engines: {node: ^12.20.0 || >=14}
@ -1350,7 +1344,7 @@ packages:
engines: {node: '>=8'}
dependencies:
dot-prop: 5.3.0
graceful-fs: 4.2.6
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.6
make-dir: 3.1.0
unique-string: 2.0.0
write-file-atomic: 3.0.3
@ -1431,7 +1425,7 @@ packages:
optional: true
/date-format/4.0.3:
resolution: {integrity: sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/date-format/-/date-format-4.0.3.tgz}
resolution: {integrity: sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==}
engines: {node: '>=4.0'}
dev: true
@ -1443,41 +1437,18 @@ packages:
meow: 3.7.0
dev: true
/debug/2.6.9_supports-color@5.5.0:
/debug/2.6.9:
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.0.0
supports-color: 5.5.0
dev: false
/debug/3.2.7:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.3
dev: false
/debug/3.2.7_supports-color@5.5.0:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: 2.1.3
supports-color: 5.5.0
dev: false
/debug/4.3.1:
resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==}
engines: {node: '>=6.0'}
@ -1491,7 +1462,7 @@ packages:
dev: false
/debug/4.3.3:
resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/debug/-/debug-4.3.3.tgz}
resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@ -1502,7 +1473,7 @@ packages:
ms: 2.1.2
/debug/4.3.3_supports-color@8.1.1:
resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/debug/-/debug-4.3.3.tgz}
resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
@ -1974,7 +1945,7 @@ packages:
dev: true
/flatted/3.2.5:
resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/flatted/-/flatted-3.2.5.tgz}
resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==}
dev: true
/foreach/2.0.5:
@ -2024,18 +1995,11 @@ packages:
/fs.realpath/1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
/fsevents/2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
optional: true
/fstream/1.0.12:
resolution: {integrity: sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==}
engines: {node: '>=0.6'}
dependencies:
graceful-fs: 4.2.6
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.6
inherits: 2.0.4
mkdirp: 0.5.5
rimraf: 2.7.1
@ -2187,7 +2151,7 @@ packages:
source-map: 0.6.1
wordwrap: 1.0.0
optionalDependencies:
uglify-js: 3.13.9
uglify-js: registry.npmmirror.com/uglify-js/3.13.9
/hapi-auth-jwt2/10.2.0:
resolution: {integrity: sha512-6Xkt0LHNBglYWOlFulNgf5pUPqRGMKpAHZjwEZqC8/07TVlgxr240pENctrthcLi8k/yCunm7x2xCSLNyTGKmg==}
@ -2198,8 +2162,8 @@ packages:
jsonwebtoken: 8.5.1
dev: false
/hapi-sequelizejs/4.5.0_qvf7o3m36i74qppgjxp4amnmp4:
resolution: {integrity: sha512-+A2Qgu2lIM8kz7PDxbDtmhGJbnobRPdOEMkmc7NvhElZr5AIkbhoYcV/dmqI70tw671zvRjS9A255igShyigow==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/hapi-sequelizejs/-/hapi-sequelizejs-4.5.0.tgz}
/hapi-sequelizejs/4.5.0_854bf76d9bf23fc83de64ddfc031ac7f:
resolution: {integrity: sha512-+A2Qgu2lIM8kz7PDxbDtmhGJbnobRPdOEMkmc7NvhElZr5AIkbhoYcV/dmqI70tw671zvRjS9A255igShyigow==}
engines: {node: '>=12.0.0', npm: '>=5.6.0'}
peerDependencies:
'@hapi/hapi': 19.x || 20.x
@ -2212,7 +2176,7 @@ packages:
sequelize: 6.6.2_sqlite3@5.0.2
dev: false
/hapi-swagger/14.2.0_7vfmy7cdcj4whrdhceanslo3uq:
/hapi-swagger/14.2.0_@hapi+hapi@20.1.4+joi@17.4.0:
resolution: {integrity: sha512-S0XoYfWOsMXA4rk43YCCzNUFW2zNHKfDcagJqrurTMcJgyKK7soHzEbaF34m/kyeT4n4YiKLDdcFhfXzSAMycw==}
engines: {node: '>=12.0.0'}
peerDependencies:
@ -2228,8 +2192,6 @@ packages:
json-schema-ref-parser: 6.1.0
swagger-parser: 4.0.2
swagger-ui-dist: 3.50.0
transitivePeerDependencies:
- supports-color
dev: false
/har-schema/2.0.0:
@ -2621,7 +2583,7 @@ packages:
'@sideway/pinpoint': 2.0.0
/joi/17.6.0:
resolution: {integrity: sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/joi/-/joi-17.6.0.tgz}
resolution: {integrity: sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==}
dependencies:
'@hapi/hoek': 9.2.0
'@hapi/topo': 5.0.0
@ -2680,8 +2642,6 @@ packages:
debug: 3.2.7
js-yaml: 3.14.1
ono: 4.0.11
transitivePeerDependencies:
- supports-color
dev: false
/json-schema-ref-parser/6.1.0:
@ -2727,7 +2687,7 @@ packages:
dependencies:
universalify: 2.0.0
optionalDependencies:
graceful-fs: 4.2.6
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.6
/jsonwebtoken/8.5.1:
resolution: {integrity: sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==}
@ -2816,7 +2776,7 @@ packages:
resolution: {integrity: sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==}
engines: {node: '>=0.10.0'}
dependencies:
graceful-fs: 4.2.6
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.6
parse-json: 2.2.0
pify: 2.3.0
pinkie-promise: 2.0.1
@ -2876,7 +2836,7 @@ packages:
dev: false
/log4js/6.4.1:
resolution: {integrity: sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/log4js/-/log4js-6.4.1.tgz}
resolution: {integrity: sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==}
engines: {node: '>=8.0'}
dependencies:
date-format: 4.0.3
@ -3062,11 +3022,11 @@ packages:
dev: false
/ms/2.0.0:
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/ms/-/ms-2.0.0.tgz}
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
dev: false
/ms/2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/ms/-/ms-2.1.2.tgz}
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
/ms/2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@ -3098,8 +3058,6 @@ packages:
debug: 3.2.7
iconv-lite: 0.4.24
sax: 1.2.4
transitivePeerDependencies:
- supports-color
dev: false
/neo-async/2.6.2:
@ -3114,27 +3072,6 @@ packages:
engines: {node: 4.x || >=6.0.0}
dev: false
/node-gyp/3.8.0:
resolution: {integrity: sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==}
engines: {node: '>= 0.8.0'}
hasBin: true
requiresBuild: true
dependencies:
fstream: 1.0.12
glob: 7.1.7
graceful-fs: 4.2.6
mkdirp: 0.5.5
nopt: 3.0.6
npmlog: 4.1.2
osenv: 0.1.5
request: 2.88.2
rimraf: 2.7.1
semver: 5.3.0
tar: 2.2.2
which: 1.3.1
dev: false
optional: true
/node-pre-gyp/0.11.0:
resolution: {integrity: sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==}
deprecated: 'Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future'
@ -3150,8 +3087,6 @@ packages:
rimraf: 2.7.1
semver: 5.7.1
tar: 4.4.13
transitivePeerDependencies:
- supports-color
dev: false
/node-releases/2.0.6:
@ -3165,14 +3100,14 @@ packages:
requiresBuild: true
dependencies:
chokidar: 3.5.2
debug: 3.2.7_supports-color@5.5.0
debug: 3.2.7
ignore-by-default: 1.0.1
minimatch: 3.0.4
pstree.remy: 1.1.8
semver: 5.7.1
supports-color: 5.5.0
touch: 3.1.0
undefsafe: 2.0.3_supports-color@5.5.0
undefsafe: 2.0.3
update-notifier: 4.1.3
dev: false
@ -3409,7 +3344,7 @@ packages:
resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==}
engines: {node: '>=0.10.0'}
dependencies:
graceful-fs: 4.2.6
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.6
pify: 2.3.0
pinkie-promise: 2.0.1
dev: true
@ -3802,7 +3737,7 @@ packages:
dev: true
/rfdc/1.3.0:
resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/rfdc/-/rfdc-1.3.0.tgz}
resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==}
dev: true
/rimraf/2.7.1:
@ -4005,9 +3940,7 @@ packages:
node-addon-api: 3.2.1
node-pre-gyp: 0.11.0
optionalDependencies:
node-gyp: 3.8.0
transitivePeerDependencies:
- supports-color
node-gyp: registry.npmmirror.com/node-gyp/3.8.0
dev: false
/sshpk/1.16.1:
@ -4033,7 +3966,7 @@ packages:
dev: false
/streamroller/3.0.2:
resolution: {integrity: sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npm.taobao.org/streamroller/-/streamroller-3.0.2.tgz}
resolution: {integrity: sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==}
engines: {node: '>=8.0'}
dependencies:
date-format: 4.0.3
@ -4187,8 +4120,6 @@ packages:
swagger-methods: 1.0.8
swagger-schema-official: 2.0.0-bab6bed
z-schema: 3.25.1
transitivePeerDependencies:
- supports-color
dev: false
/swagger-schema-official/2.0.0-bab6bed:
@ -4329,7 +4260,7 @@ packages:
typescript: 4.3.2
dev: true
/ts-node/10.0.0_tfhj3vxmzmwirfyh7roeacsfam:
/ts-node/10.0.0_994e9dd6eccb2c889707fc5c400a4503:
resolution: {integrity: sha512-ROWeOIUvfFbPZkoDis0L/55Fk+6gFQNZwwKPLinacRl6tsxstTF1DbAcLKkovwnpKMVvOMHP1TIbnwXwtLg1gg==}
engines: {node: '>=12.0.0'}
hasBin: true
@ -4449,13 +4380,6 @@ packages:
resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==}
dev: false
/uglify-js/3.13.9:
resolution: {integrity: sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==}
engines: {node: '>=0.8.0'}
hasBin: true
requiresBuild: true
optional: true
/uid-safe/2.1.5:
resolution: {integrity: sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==}
engines: {node: '>= 0.8'}
@ -4472,12 +4396,10 @@ packages:
which-boxed-primitive: 1.0.2
dev: false
/undefsafe/2.0.3_supports-color@5.5.0:
/undefsafe/2.0.3:
resolution: {integrity: sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==}
dependencies:
debug: 2.6.9_supports-color@5.5.0
transitivePeerDependencies:
- supports-color
debug: 2.6.9
dev: false
/unique-string/2.0.0:
@ -4712,5 +4634,59 @@ packages:
lodash.isequal: 4.5.0
validator: 10.11.0
optionalDependencies:
commander: 2.20.3
commander: registry.npmmirror.com/commander/2.20.3
dev: false
registry.npmmirror.com/commander/2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz}
name: commander
version: 2.20.3
requiresBuild: true
dev: false
optional: true
registry.npmmirror.com/fsevents/2.3.2:
resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz}
name: fsevents
version: 2.3.2
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
requiresBuild: true
optional: true
registry.npmmirror.com/graceful-fs/4.2.6:
resolution: {integrity: sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.6.tgz}
name: graceful-fs
version: 4.2.6
registry.npmmirror.com/node-gyp/3.8.0:
resolution: {integrity: sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/node-gyp/-/node-gyp-3.8.0.tgz}
name: node-gyp
version: 3.8.0
engines: {node: '>= 0.8.0'}
hasBin: true
requiresBuild: true
dependencies:
fstream: 1.0.12
glob: 7.1.7
graceful-fs: registry.npmmirror.com/graceful-fs/4.2.6
mkdirp: 0.5.5
nopt: 3.0.6
npmlog: 4.1.2
osenv: 0.1.5
request: 2.88.2
rimraf: 2.7.1
semver: 5.3.0
tar: 2.2.2
which: 1.3.1
dev: false
optional: true
registry.npmmirror.com/uglify-js/3.13.9:
resolution: {integrity: sha512-wZbyTQ1w6Y7fHdt8sJnHfSIuWeDgk6B5rCb4E/AM6QNNPbOMIZph21PW5dRB3h7Df0GszN+t7RuUH6sWK5bF0g==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/uglify-js/-/uglify-js-3.13.9.tgz}
name: uglify-js
version: 3.13.9
engines: {node: '>=0.8.0'}
hasBin: true
requiresBuild: true
optional: true

8
public/css/page/login.css

@ -13,7 +13,7 @@ body {
flex-direction: column;
font-family: 'Montserrat', sans-serif;
height: 100vh;
margin: -20px 0 50px;
/* margin: -20px 0 50px; */
}
h1 {
@ -92,7 +92,7 @@ input {
.container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 14px 28px rgba(0,0,0,0.25),
box-shadow: 0 14px 28px rgba(0,0,0,0.25),
0 10px 10px rgba(0,0,0,0.22);
position: relative;
overflow: hidden;
@ -137,7 +137,7 @@ input {
opacity: 0;
z-index: 1;
}
50%, 100% {
opacity: 1;
z-index: 5;
@ -249,4 +249,4 @@ footer i {
footer a {
color: #3c97bf;
text-decoration: none;
}
}

7
route.txt

@ -1,4 +1,4 @@
D:\1XYX\demo\hapi-demo\source\route\api对应路径:
/home/topuser/桌面/demo/hapi-demo/source/route/api对应路径:
不需权限 : GET /api/{path*}
需要权限 : GET /api/v1/upload
需要权限 : POST /api/v1/upload/upload
@ -7,13 +7,14 @@ D:\1XYX\demo\hapi-demo\source\route\api对应路径:
不需权限 : POST /api/v1/user/login
需要权限 : DELETE /api/v1/user/del
需要权限 : GET /api/v1/user/userinfo
D:\1XYX\demo\hapi-demo\source\route\views对应路径:
/home/topuser/桌面/demo/hapi-demo/source/route/views对应路径:
不需权限(提供无需验证): GET /404
不需权限 : GET /css
不需权限(提供无需验证): GET /
不需权限 : GET /about
不需权限(提供无需验证): GET /about
不需权限 : GET /docs/{path*}
不需权限 : GET /{path*}
不需权限(提供无需验证): GET /login
不需权限 : POST /login
不需权限 : POST /login/register
不需权限 : GET /nav

BIN
source/db/data.db

Binary file not shown.

18
source/plugins/index.ts

@ -34,7 +34,19 @@ export default [
version: "0.0.1",
// https://github.com/hks-epod/paydash/blob/master/lib/flash.js
register: function (server: Server, options) {
server.ext('onPreResponse', function(request: Request, h) {
server.ext('onPreResponse', async function(request: Request, h) {
// 需要设置auth是try或者true才行
const isLogin = request.auth.isAuthenticated;
// @ts-ignore
console.log(isLogin, request.path, request.response.variety);
let user;
if(isLogin){
const { id } = request.auth.credentials;
const User = request.getModel("User")
user = <any>await User.findOne({ where: { id: id } });
user = user.toJSON();
delete user.password;
}
// @ts-ignore
if (request.yar && request.yar.flash && request.response.variety === 'view') {
var flash = request.yar.flash();
@ -42,7 +54,9 @@ export default [
// @ts-ignore
request.response.source.context = Hoek.applyToDefaults(
{
flash: flash
flash: flash,
isLogin: isLogin,
user: user
},
// @ts-ignore
request.response.source.context

12
source/route/views/index/index.ts

@ -21,17 +21,17 @@ export default class Index {
}
@auth("try")
async index(request: Req, h: Res): ReturnValue {
async index(request: Req, h: Res): ReturnValue {
if (request.auth.isAuthenticated) {
// 登录了
} else {
} else {
// 未登录
}
return h.view("views/index.pug", { isLogin: request.auth.isAuthenticated });
}
@route("/about")
@auth(false)
@auth("try")
async about(request: Req, h) {
// console.log(request.auth);
// console.log(1);
@ -47,7 +47,7 @@ export default class Index {
const md = new MarkdownIt();
var result = md.render('# markdown-it rulezz!');
return h.view("views/about.pug", {
result: '# markdown-it rulezz!'
md: result
});
}
@ -81,7 +81,7 @@ export default class Index {
@route("/{path*}")
async any(req: Req, h: Res): ReturnValue {
console.log(req.raw.req.url);
return h.redirect("/404?r="+encodeURIComponent(req.raw.req.url));
}
@route("/404")
@ -89,7 +89,7 @@ export default class Index {
async 404(request: Req, h: Res): ReturnValue {
if (request.auth.isAuthenticated) {
// 登录了
} else {
} else {
// 未登录
}
if(request.query?.r){

38
source/route/views/login.ts

@ -1,6 +1,7 @@
import { Req, Res, ReturnValue } from "#/global";
import { gFail } from "@/util";
import { auth, config, method, route } from "@noderun/hapi-router";
import { UserSchema } from "@/schema";
import { gFail, gSuccess } from "@/util";
import { auth, config, method, route, validate } from "@noderun/hapi-router";
import * as bcrypt from "bcrypt";
/**
*
@ -11,11 +12,12 @@ export default class {
@method("GET")
async loginView(request: Req, h: Res): ReturnValue {
if (request.auth.isAuthenticated) {
request.yar.flash('error', '您已经登陆');
return h.redirect("/")
} else {
logger.debug("未登录");
}
return h.view("views/login.pug");
}
return h.view("views/login.pug");
}
@method("POST")
@ -27,11 +29,35 @@ export default class {
const account = <any>await User.findOne({ where: { username: username } });
if (!account || !(await bcrypt.compare(password, account.password))) {
request.yar.flash('error', 'Invalid username or password');
return h.redirect("/login");
request.yar.flash('error', 'Invalid username or password');
return h.redirect("/login");
}
request.cookieAuth.set({ id: account.id });
return h.redirect("/");
}
@method("POST")
@route("/register")
@auth(false)
async register(request: Req, h: Res): ReturnValue {
let { username, password, email } = request.payload as any;
if (!username) username = email;
const User = request.getModel("User")
logger.trace(username, email);
try {
const result = await User.findOne({ where: { username: username } });
if (result != null) {
request.yar.flash('error', '已存在该用户');
return h.redirect("/login");
}
let salt = bcrypt.genSaltSync(10);
let pwdLock = bcrypt.hashSync(password, salt);
await User.create({ username, password: pwdLock, email });
return h.redirect("/")
} catch (e) {
request.yar.flash('error', '注册用户失败');
return h.redirect("/login");
}
}
}

3
source/run.ts

@ -90,11 +90,10 @@ const run = async (): Promise<Server> => {
// By default Pug uses relative paths (e.g. ../root.pug), when using absolute paths (e.g. include /root.pug), basedir is prepended.
// https://pugjs.org/language/includes.html
basedir: templateDir,
globals: [],
plugins: [
pugPluginAlias({
// as Function
'@': fn => fn.replace(/^@/, 'template')
'@': fn => fn.replace(/^@/, 'template')
})
]
},

2
source/schema/index.ts

@ -6,5 +6,5 @@ export const UserSchema = Joi.object({
email: Joi.string().email({
minDomainSegments: 2,
tlds: { allow: ["com", "net"] },
}),
})
}).or("username", "email");

23
template/helper/flush.pug

@ -0,0 +1,23 @@
if flash&&flash.error
.toast-container.top-0.end-0.p-3
each item in flash.error
.toast.show(role='alert', aria-live='assertive', aria-atomic='true')
.toast-header
img.rounded.me-2(src='...', alt='错误')
strong.me-auto 提示
small.text-muted just now
button.btn-close(type='button', data-bs-dismiss='toast', aria-label='Close')
.toast-body.
#{item}
//- .toast-container.position-fixed.bottom-0.end-0.p-3
//- #liveToast.toast(role='alert', aria-live='assertive', aria-atomic='true')
//- .toast-header
//- img.rounded.me-2(src='...', alt='...')
//- strong.me-auto Bootstrap
//- small 11 mins ago
//- button.btn-close(type='button', data-bs-dismiss='toast', aria-label='Close')
//- .toast-body.
//- Hello, world! This is a toast message.
//- ul
//- each item in flash.error
//- li #{item}

13
template/helper/ui.pug

@ -2,8 +2,6 @@ mixin css(href)
link(rel="stylesheet" href="/public/"+href)
mixin script(src)
script(src="/public/"+src)
mixin mdScript()
//- script(src="https://cdn.bootcdn.net/ajax/libs/markdown-it/13.0.1/markdown-it.min.js")
mixin header()
nav.navbar.navbar-expand-lg.bg-light
@ -13,6 +11,13 @@ mixin header()
span.navbar-toggler-icon
.collapse.navbar-collapse#navbarSupportedContent
ul.navbar-nav.me-auto.mb-2.mb-lg-0
li.nav-item
li.nav-item
a.nav-link.active(aria-current='page', href='/util') 工具
li.nav-item
a.nav-link.active(aria-current='page', href='/about') 关于
.navbar-text
if !isLogin
a(href="/login")
.btn.btn-sm.btn-outline-secondary 登陆/注册
else
div #{user.username}

6
template/layout/layout.pug

@ -8,16 +8,16 @@ html(lang="zh-cn")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
link(rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon")
//- device-width 宽度低于1100像素的设备直接缩小
meta(name="viewport", content="width=1100, initial-scale=1.0")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
title #{title || 'WEB'}
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css", integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx", crossorigin="anonymous")
+css("style/common/style.css")
block head
body
include @/helper/flush.pug
if !hideHeader
+header()
block content
script(src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js", integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa", crossorigin="anonymous")
+mdScript()
block script
include @/helper/rain.pug
//- include @/helper/rain.pug

44
template/views/about.pug

@ -9,6 +9,44 @@ block head
block content
.container(style="margin-top: 20px;")
include:markdown-it ../md/about.md
//- - var markdown = require("markdown-it")
//- #{markdown}
include:markdown-it @/md/about.md
div!= md
//- .row.overflow-hidden
//- .col-12.p-2.col-md-6.col-lg-3
//- .card(style='margin: 0 auto;')
//- .card-body
//- h5.card-title Card title
//- h6.card-subtitle.mb-2.text-muted Card subtitle
//- p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
//- a.card-link(href='#') Card link
//- a.card-link(href='#') Another link
//- .col-12.p-2.col-md-6.col-lg-3
//- .card(style='margin: 0 auto;')
//- .card-body
//- h5.card-title Card title
//- h6.card-subtitle.mb-2.text-muted Card subtitle
//- p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
//- a.card-link(href='#') Card link
//- a.card-link(href='#') Another link
//- .col-12.p-2.col-md-6.col-lg-3
//- .card(style='margin: 0 auto;')
//- .card-body
//- h5.card-title Card title
//- h6.card-subtitle.mb-2.text-muted Card subtitle
//- p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
//- a.card-link(href='#') Card link
//- a.card-link(href='#') Another link
//- .col-12.p-2.col-md-6.col-lg-3
//- .card(style='margin: 0 auto;')
//- .card-body
//- h5.card-title Card title
//- h6.card-subtitle.mb-2.text-muted Card subtitle
//- p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
//- a.card-link(href='#') Card link
//- a.card-link(href='#') Another link
//- ul
//- li: a(href="https://cloud.tencent.com/developer/article/1793543" target="_blank") 15个最优秀的响应式CSS框架
//- li https://getbootstrap.com/docs/5.2/components/collapse/
//- li https://getbase.org/
//- li https://tooltt.com/html2pug/
//- li https://www.pugjs.cn/language/conditionals.html

20
template/views/include/flush.pug

@ -1,20 +0,0 @@
if flash&&flash.error
<div class="message message--error">
<ul>
each item in flash.error
<li>#{item}</li>
</ul>
</div>
//- <div class="toast-container position-fixed bottom-0 end-0 p-3">
//- <div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
//- <div class="toast-header">
//- <img src="..." class="rounded me-2" alt="...">
//- <strong class="me-auto">Bootstrap</strong>
//- <small>11 mins ago</small>
//- <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
//- </div>
//- <div class="toast-body">
//- Hello, world! This is a toast message.
//- </div>
//- </div>
//- </div>

42
template/views/index.pug

@ -8,43 +8,5 @@ block head
+css("style/views/index.css")
block content
.container
.row.overflow-hidden
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
.col-12.p-2.col-md-6.col-lg-3
.card(style='margin: 0 auto;')
.card-body
h5.card-title Card title
h6.card-subtitle.mb-2.text-muted Card subtitle
p.card-text Some quick example text to build on the card title and make up the bulk of the card's content.
a.card-link(href='#') Card link
a.card-link(href='#') Another link
ul
li: a(href="https://cloud.tencent.com/developer/article/1793543" target="_blank") 15个最优秀的响应式CSS框架
li https://getbootstrap.com/docs/5.2/components/collapse/
li https://getbase.org/
li https://tooltt.com/html2pug/
li https://www.pugjs.cn/language/conditionals.html
.container
sad

31
template/views/login.pug

@ -1,14 +1,16 @@
extends /layout/layout
block var
-title="登陆" // 网页标题
-hideHeader=true
block head
+css("css/page/login.css")
block content
include include/flush.pug
h2 天蚕 / 地雀
block content
.container#container
.form-container.sign-up-container
form(action='#' onsubmit='return false')
form(action='/login/register' method='post')
h1 创建账户
.social-container
a.social(href='#')
@ -18,11 +20,11 @@ block content
a.social(href='#')
i.fab.fa-linkedin-in
span 使用您的邮箱注册
input(type='text', placeholder='请输入用户名')
input(type='email', placeholder='请输入邮箱')
input(type='password', placeholder='请输入密码')
input(type='text', name="username", placeholder='请输入用户名')
input(type='email', name="email",placeholder='请输入邮箱')
input(type='password', name="password",placeholder='请输入密码')
include include/form_security.pug
button(type='submit') 注册
button 注册
.form-container.sign-in-container
form(action='/login' method='post')
h1 登录
@ -49,15 +51,6 @@ block content
h1 你好朋友!
p 创建您的个人账户,随我们遨游于此吧!
button.ghost#signUp 注册
footer
p
| Created with
i.fa.fa-heart
| by
a(target='_blank', href='https://florin-pop.com') Florin Pop
| - Read how I created this and how you can join the challenge
a(target='_blank', href='https://www.florin-pop.com/blog/2019/03/double-slider-sign-in-up-form/') here
| .
block script
+script("js/page/login.js")
block script
+script("js/page/login.js")

Loading…
Cancel
Save