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

推荐订阅源

Y
Y Combinator Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
N
Netflix TechBlog - Medium
P
Privacy International News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
G
Google Developers Blog
Recorded Future
Recorded Future
The Hacker News
The Hacker News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
G
GRAHAM CLULEY
A
Arctic Wolf
N
News | PayPal Newsroom
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Visual Studio Blog
Webroot Blog
Webroot Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
H
Heimdal Security Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
M
MIT News - Artificial intelligence
V2EX - 技术
V2EX - 技术
Jina AI
Jina AI
TaoSecurity Blog
TaoSecurity Blog
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
WordPress大学
WordPress大学
V
V2EX
Cyberwarzone
Cyberwarzone
Stack Overflow Blog
Stack Overflow Blog
Cloudbric
Cloudbric
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 风清云淡

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