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

推荐订阅源

S
Security @ Cisco Blogs
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Project Zero
Project Zero
C
CERT Recently Published Vulnerability Notes
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cisco Blogs
博客园 - 司徒正美
L
LINUX DO - 热门话题
D
Docker
M
MIT News - Artificial intelligence
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
Jina AI
Jina AI
Last Week in AI
Last Week in AI
Security Latest
Security Latest
The Hacker News
The Hacker News
L
Lohrmann on Cybersecurity
Y
Y Combinator Blog
A
Arctic Wolf
小众软件
小众软件
T
Threat Research - Cisco Blogs
Know Your Adversary
Know Your Adversary
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
腾讯CDC
Google DeepMind News
Google DeepMind News
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 叶小钗
I
Intezer
NISL@THU
NISL@THU
A
About on SuperTechFans
爱范儿
爱范儿
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
G
Google Developers Blog
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Cyberwarzone
Cyberwarzone
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
Latest news
Latest news

博客园 - 风清云淡

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