开源一款好用的ajax和fetch拦截器
ajax interceptor, fetch interceptor
ajax interceptor, fetch interceptor
10月份的时候有空,刚好云服务器到期,便想自建一个nas服务器,提供文件、流媒体、CI/CD等服务,如果自己能够建起一套一键安装的软件套装和集成一个一键开机的nas产品,那是很不错的。于是在github上找了个ansible-nas放到本地来玩。 主要是在周末投入几个小时来搞,目前算是正式上线了。 一路摸索过来,发现软件配套是可以的,硬件配套也是可以的,但是一键安装和一键开机是没有的。主要是因为以下原因: 这里列几个成本高具体案例: 产品最终成型的流水线太长了。成本高企。 不如做成盒子,各类服务一个独立小盒子,接上路由器就用。
install ansible on Ubuntu18.04 2. ansible general ad-hoc command format 3. list all ansible modules 4. basic concepts of ansible 5. ansible parallerism 6. ansible facts 7. playbook setctions
1、 install svn on my mac. 2、check the wordpress plugin’s revision number. We want the latest one. 3、Clone the repo to local directory. 4、run fetch process. 5、 add the repo…
I’ve been using VPS for a few years and it is really convenient in the perspective of deployment and public accessibility. But the problem for me is that my VPS…
Let’s Encrypt SSL certificate is free and is widely used nowadays. I’m planning to upgrade my blog from http to https to be more secure and more modernized~ I’ll use…
General steps to follow: 1 New laravel project setup with latest laravel framework version. 2 namespace setup for whole app 3 composer.json migration 3.1 find correct version for all old…
For the past two weeks I’ve been developing payment procedures for some company’s international business. Basically this company has branches in 5 different countries spanning across different time zones and…
I have been scratching my head for a few hours on migrating GA to GTM this week. This project used google analytics and now customer wants GTM with more freedom…
Usually I find it hard for me to compose raw sql than to write queries using ORM. Here’s a case I did recently. In my opinion sometimes there’s no good…
Basically speaking, I hate developing on wordpress as it is not modern enough or say not using modern techniques like composer, oop. Fortunately after studying a few modern themes and…
I’ve been working on migrating a legacy laravel 4.2 project to Laravel 7.2 recently. And I’ve written some feature test cases and artisan command test cases as well as laravel…
pip install django. (after this I usually use ln -s to link specific python site-package folder to vendor folder under the same django project.) If you’re using Ubuntu linux for…
Wordpress manual migration
soure code of authServiceProvidor:
http://docs.apiato.io/getting-started/installation/ 3rd party api-ato library:
https://www.script-tutorials.com/design-patterns-in-php/ https://nicole929chan.wordpress.com/category/solid/ https://nicole929chan.wordpress.com/category/tdd-%E7%B7%B4%E7%BF%92/
原文链接:https://blog.csdn.net/zwk626542417/article/details/46726491 RBAC是Role-BasedAccess Control的英文缩写,意思是基于角色的访问控制。RBAC认为权限授权实际上是Who、What、How的问题。在RBAC模型中,who、what、how构成了访问权限三元组,也就是“Who对What(Which)进行How的操作,也就是“主体”对“客体”的操作,其中who——是权限的拥有者或主体(如:User、Role),what——是资源或对象(Resource、Class) RBAC其实是一种分析模型,主要分为:基本模型RBAC0(Core RBAC)、角色分层模型RBAC1(Hierarchal RBAC)、角色限制模型RBAC2(Constraint RBAC)和统一模型RBAC3(Combines RBAC)。 RBAC2: 案例: 先大概解释下我们的业务,我们做的是教育行业高校云平台,每个学校都可以在我们平台进行注册,注册完成后可以享受一些基础的服务,当然了不同级别的用户享受的基础服务是不同的,这些基础的服务包括新生注册管理、基础系统管理、考试系统管理、评教系统管理等模块,每个模块都相当于一个子系统,每个子系统都有各自的功能,每个功能也都有各自的相关的页面,而所有的子系统、页面以及页面上的功能按钮都是需要我们权限进行管理,所以我们的权限管理相对来说任务也是比较繁重的。 许可我一般称它为权限,它包括控制对象和操作,控制对象一般为资源,包括菜单、页面、文件等资源,而操作一般包括增删改查等,图中“系统操作”就是操作,“菜单信息”就是控制对象; 菜单信息中的每个菜单都会有增删改查等操作,所以菜单信息与系统操作是一对多的关系。 我们给角色授予权限时,授予就是颗粒最小的权限,所以我们将系统操作权限授予某些角色。一个角色可以拥有多个系统操作,一个系统操作同样也可以属于多个角色,所以系统操作和角色为多对多的关系。 进一步的细化深化: 完整的RBAC模型: Microservices API RBAC model: 如果把微服务化后的所有api接口都定义为上文的Resources,那么我们可以看到这么一个情况。案例: Authorization on API gateway: Authorization on microservice itself: Solution…
helpers: logger() 或者 Log门面Illuminate\Log\Logger 你可以使用 Log 门面记录日志信息,如上所述,日志系统提供了定义在 RFC 5424 规范中的八种日志级别:emergency、alert、critical、error、warning、 notice、info 和 debug: Path helpers: Str::slug() Arr:has() Str::uuid() Arr::pluck()
在微服务架构下,要考虑外部应用接入的场景、 用户 – 服务的鉴权、 服务 – 服务的鉴权 等多种鉴权场景。 统一身份管理(UIM)是整个平台帐号和权限管控的基础,由此构建的系统称为UIMS(Unified Identity Management System),平台下所有系统的账户管理、身份认证、用户授权、权限控制等行为都经由 UIMS 处理,提供帐号密码管理、基本资料管理、角色权限管理等功能。UIMS 基于『统一身份治理』的概念,可划分为两级账户体系、基础权限模块和基础信息模块三大模块。其中两级账户体系将账户分为组织实体帐号和个人实体账户两大类,个人实体从属于组织实体,也可以不从属任何组织实体,且个人实体可同时从属于多个组织实体;基础权限模块将各业务系统的资源权限进行统一管理和授权;基础信息模块用于描述组织实体和个人实体的基本信息,如组织实体名称、地址、法人,个人实体姓名、电话号码、性别等基础信息。UIMS 提供统一的 API 与各子系统连接。 问题: 目前,接入各个业务线的用户系统数量多类型复杂,且数据分散,比如有公司的员工系统(LDAP系统),公司的销售人员系统,公司的外包人员系统,外部互联网用户系统(使用APP的客户)。 不同类型的用户系统都有可能接入某些微服务,那么如何用权限系统去控制不通用户对同一个微服务的调用,对我们来说,又是一个挑战。 解决方案: Authentication: SSO: 共享存储的Session: 客户端 Token 方案: 客户端 Token…
Defining model in Laravel Overide default database table name Overide default database table primary key Time stamps 时间戳 指定数据库连接 获取模型数据 Query Scopes /范围查询
simple operation 2. database transaction 4. on table() operations 查询 根据主键id查询数据 Multiple tables 关联表查询 join 插入 更新/修改 删除
Copy your json format data file to one of Laravel’s directories, preferably database. create a seeder file: php artisan make:seeder JsondataTableSeeder Modify the seeder class 4. Add the newly created…
One method to avoid a PHP pitfall of PUT and PATCH with _method hacking of POST. This is for Laravel 5. Avoid getting parameters from $request->input() which means getting data…
global middlewares are triggered before route middlewares in Laravel as you can see in the following source code from Laravel framework:
In public/index.php file, dd($app) before $response is returned, you will get $app itself printed in browser. ( Of course you should run php artisan serve to start the built-in web…
Mount linux file system under Macos: Laravel frequently used references: Laravel-mix webpack.mix.js example: package.json example (using Vue.js): Laravel blade template system interpolation V.S. Vue.js interpolation: Content distribution( in Vue.js) as…
It is better to use a service to handle Angular errors including errors outside your app(but sent back to app like backend error), network errors, internal errors and so on….
Observable is a stream of data/events to be observed/processed. Observer is as the name itself suggests, a consumer of the Observable stream. Subscription is a relationship between a Observable and…
This is the original source for your reference. https://hackernoon.com/everything-you-need-to-know-about-change-detection-in-angular-8006c51d206f Below it is the main change detection procedure: Angular has a bunch of high-level concepts to manipulate the views. I’ve written…
Adding globals.ts: 2. import global.ts to main.ts: 3. accessing modules from console: window[‘@angular/core’].ApplicationRef 4. use ng.probe() to check components and trigger actions.
https://hackernoon.com/here-is-how-to-get-viewcontainerref-before-viewchild-query-is-evaluated-f649e51315fb
1.Angular 2 支持的 View(视图) 类型有哪几种 ? Embedded Views – Template 模板元素 Host Views – Component 组件 1.1 如何创建 Embedded View 1.2 如何创建 Host View 2.Angular 2 Component 组件中定义的 <template> 模板元素为什么渲染后会被移除…
{ static: true } needs to be set when you want to access the ViewChild in ngOnInit. { static: false } can only be accessed in ngAfterViewInit. This is also what you want to go for…
所支持的选择器包括: 任何带有 @Component 或 @Directive 装饰器的类 字符串形式的模板引用变量(比如可以使用 @ViewChild(‘cmp’) 来查询 <my-component #cmp></my-component> 组件树中任何当前组件的子组件所定义的提供商(比如 @ViewChild(SomeService) someService: SomeService ) 任何通过字符串令牌定义的提供商(比如 @ViewChild(‘someToken’) someTokenVal: any ) TemplateRef(比如可以用 @ViewChild(TemplateRef) template; 来查询 <ng-template></ng-template>) @ViewChild(‘myname’, {read: ViewContainerRef}) target : ViewContainerRef; The following is an explanation to read: There can be several instances…
This is an example using ElementRef and Render2 to modify CSS style dynamically. import { Component, ElementRef, ViewChild, AfterViewInit, Renderer2 } from ‘@angular/core’; @Component({ selector: ‘my-app’, template: ` <h1>Welcome to…