惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
有赞技术团队
有赞技术团队
J
Java Code Geeks
小众软件
小众软件
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
U
Unit 42
大猫的无限游戏
大猫的无限游戏
G
Google Developers Blog
I
InfoQ
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
IT之家
IT之家
博客园 - Franky
腾讯CDC
罗磊的独立博客
雷峰网
雷峰网
M
MIT News - Artificial intelligence
博客园 - 司徒正美
A
About on SuperTechFans
SecWiki News
SecWiki News
Project Zero
Project Zero
T
Tenable Blog
The Last Watchdog
The Last Watchdog
Security Latest
Security Latest
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
PCI Perspectives
PCI Perspectives
博客园 - 【当耐特】
C
Check Point Blog
F
Full Disclosure
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
Google Online Security Blog
Google Online Security Blog
T
Tor Project blog
T
Threat Research - Cisco Blogs
AI
AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
美团技术团队
Spread Privacy
Spread Privacy

博客园 - 风清云淡

Oracle 10g的备份与还原 如何通过反射动态调用泛型方法 Oracle与Sql Server写SQL的区别 Oracle 表与字段的注释操作 将MS SQL SERVER 数据库导入到ORACLE的坑 SQL SERVER 触发器的误区 Asp.net Core部署于CentOS上报404错误的坑 SqlBulkCopy 来自数据源的 String 类型的给定值不能转换为指定目标列的类型 bit SQL SERVER OVER开窗函数,Partition By,ROW_NUMBER(),DENSE_RANK(),RANK()排名函数 CefSharp"Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies" 在同一个项中引用同一类库的多个版本 Visual Studio中Js使用智能感知 Func<T>,Action<T>,Predicate<T>使用小结 Nuget 在VS中操作命令 Unity的动态加载简单使用 枚举的使用总结 IIS WEB程序如何访问共享目录 AngularJS之页面跳转Route ASP.NET MVC4 BundleConfig的注意事项
Extjs使用 RestfulWebApi +Token验证小结
风清云淡 · 2018-06-26 · via 博客园 - 风清云淡

Extjs Restful+Wpi Token

目标
1.Extjs使用Restful提交,将主页,编辑页的view,controller,viewModel合并为只有一个view,controller,viewModel,大幅度减少文件与代码,同时减少Extjs.Ajax的访问后端的代码
2.通过JWT 的使用,用tonken将后台的访问以标准的验证,授权规范起来,有效保护webapi的安全(登录时返回token,存于客户端,客户端访问webapi时在httpheader带上token,webapi对token进行解码验证)

技术点
1.Extjs中Restful的使用
a.将Extjs Store的proxy 的type设置为'rest'
b.将Extjs Storer的writer的writeAllFields设置为true
c.新增用Store.add()
d.删除用Store.remove()
e.新增,删除,修改后统一使用 store.sync()方法提交到远端webapi
f.在Ext GridPanel中加上window,做法:在panel的items中加入gridpanel和windowpanel
g.EXT UI的form字段验证,在Model中加入validators,绑定字段,UI会自动加入validate,前端验证可以使用form.isValid()
h.window编辑内容与gridpanel选中内容的同步,将window对应的viewmodel绑定到gridpanel的selection,则window的内容与gridpanel的选中内容双向同步

2.JWT tonken的使用
a.实现基本验证服务BaseAuthentiction Filter(取httpheader进行解码)
b.将基本验证服务filter注册,使所有的访问必先经过此filter
c.实现基本授权特性BaseAuthorize Attribute,在需要授权检查的webapi加上此特性
d.实现登录webapi,若登录成功则返回token给调用方
e.token的生成与解码使用jwt