1549469775 3 years ago
parent
commit
5d38fb5f0d
  1. 4
      route.txt
  2. 2
      source/plugins/index.ts
  3. 1
      template/helper/flush.pug
  4. 0
      template/helper/form_security.pug
  5. 4
      template/helper/helper.pug
  6. 1
      template/helper/rain.pug
  7. 6
      template/helper/ui.pug
  8. 1
      template/layout/layout.pug
  9. 6
      template/views/about.pug
  10. 2
      template/views/index.pug
  11. 4
      template/views/login.pug

4
route.txt

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

2
source/plugins/index.ts

@ -38,7 +38,7 @@ export default [
// 需要设置auth是try或者true才行
const isLogin = request.auth.isAuthenticated;
// @ts-ignore
console.log(isLogin, request.path, request.response.variety);
// console.log(isLogin, request.path, request.response.variety);
let user;
if(isLogin){
const { id } = request.auth.credentials;

1
template/helper/flush.pug

@ -1,3 +1,4 @@
//- 服务器反馈UI
if flash&&flash.error
.toast-container.top-0.end-0.p-3
each item in flash.error

0
template/views/include/form_security.pug → template/helper/form_security.pug

4
template/helper/helper.pug

@ -0,0 +1,4 @@
mixin css(href)
link(rel="stylesheet" href="/public/"+href)
mixin script(src)
script(src="/public/"+src)

1
template/helper/rain.pug

@ -1,3 +1,4 @@
//- 下雨UI
canvas(id="snow") 不支持canvas
style
| canvas#snow { position: absolute; z-index: -1; top: 0; left: 0; opacity: 0.5; }

6
template/helper/ui.pug

@ -1,8 +1,4 @@
mixin css(href)
link(rel="stylesheet" href="/public/"+href)
mixin script(src)
script(src="/public/"+src)
//- 站点导航栏
mixin header()
nav.navbar.navbar-expand-lg.bg-light
.container

1
template/layout/layout.pug

@ -1,4 +1,5 @@
doctype html
include @/helper/helper.pug
include @/helper/ui.pug
html(lang="zh-cn")

6
template/views/about.pug

@ -50,3 +50,9 @@ block content
//- li https://getbase.org/
//- li https://tooltt.com/html2pug/
//- li https://www.pugjs.cn/language/conditionals.html
//- li https://bulma.io/
//- https://picturepan2.github.io/spectre/index.html
//- http://v3.getuikit.work/doc/v3/components/offcanvas.html
//- https://github.com/pure-css/pure
//- https://semantic-ui.com/
//- https://github.com/transitive-bullshit/check-links/blob/master/lib/check-link.js

2
template/views/index.pug

@ -9,4 +9,4 @@ block head
block content
.container
sad
div sda

4
template/views/login.pug

@ -23,7 +23,7 @@ block content
input(type='text', name="username", placeholder='请输入用户名')
input(type='email', name="email",placeholder='请输入邮箱')
input(type='password', name="password",placeholder='请输入密码')
include include/form_security.pug
include @/helper/form_security.pug
button 注册
.form-container.sign-in-container
form(action='/login' method='post')
@ -38,7 +38,7 @@ block content
span 填写您的账户
input(type='text',name="username" , placeholder='请输入邮箱')
input(type='password',name="password" , placeholder='请输入密码')
include include/form_security.pug
include @/helper/form_security.pug
a(href='#') 忘记密码?
button 登录
.overlay-container

Loading…
Cancel
Save