博客 页面 8

简易app版本管理

nodejs读取apk信息:

https://github.com/openstf/adbkit-apkreader

angular可用的表格组件

@angular/material的表格功能太弱了,github上找到的比较好的几个:

 

https://github.com/akveo/ng2-smart-table

https://github.com/ssuperczynski/ngx-easy-table

https://github.com/swimlane/ngx-datatable

数据可视化研究学习

基于GIS:

https://github.com/maptalks/maptalks.js

https://github.com/Leaflet/Leaflet

https://github.com/AnalyticalGraphicsInc/cesium

3D:

https://github.com/xeolabs/xeogl

 

sso实现方式研究

JWT

优点:服务器不保存,减轻服务器压力,减轻数据库查询压力,服务器重启后,仍然可以访问

缺点:信息泄露后,其他人就会获得所有权限,服务器端无法让其过期

适用场景:

1.有效期短

2.只被使用一次

参考

https://www.cnblogs.com/yuanrw/p/10089796.html

https://baijiahao.baidu.com/s?id=1608021814182894637&wfr=spider&for=pc

结论

JWT不适合用作SSO认证方案

ngrx学习

https://blog.csdn.net/xs20691718/article/details/78049301

https://www.jianshu.com/p/b5bb16147209

对现代化社区程序的研究

三大主题:问答、写作、阅读

 

https://github.com/esotalk/esoTalk

 

 

https://github.com/flarum/flarum

https://github.com/justjavac/Flarum

开源MQTT broker方案

node:

https://github.com/mcollina/mosca

python:

https://github.com/beerfactory/hbmqtt

ionic4使用hammerjs添加手势事件支持

1.安装hammerjs,并在angular.json中添加

2.app.modules中添加

import { BrowserModule, HAMMER_GESTURE_CONFIG, HammerGestureConfig } from '@angular/platform-browser';

providers: [
  { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig }
]

3.在要使用的html中添加press、tap、swipe等事件

ionic4禁用手势操作/滑动返回

在ionic3中,可以通过NavController.swipeBackEnabled禁用手势返回操作,但ionic4中没有这个api。

4的文档没有搜索功能,也没找到对应的api接口,自己研究出两种方法:

方法1:

自己把组件写成stencil组件。

通过看ionic4源码得知,ionic4提供了单独的gesture接口:

constructor( private gesture: Gesture ) { }
this.gesture.setDisabled(true);

但这个方法通过angular调用会报错,只能供stencil组件调用,非常坑

 

方法2:

另一个方法是通过swipeGesture指令,但只有ion-router-outlet等少数ionic组件有。

<ion-router-outlet [swipeGesture]="swipeEnable"></ion-router-outlet>

而且ion-router-outlet通常是在app.component.html中,也就是说,你得在app.component.html中写个订阅,其他组件中才能操作它;或者在app.component.ts中监听页面,确定哪些页面不允许手势回退。

代码如下:

  swipeEnable = true;
  watchSwipeEnable() {
    this.events.subscribe("swipeEnable", (enable: boolean) => {
      setTimeout(() => {
        this.swipeEnable = enable;
      });
    })
  }

这样会触发ExpressionChangedAfterItHasBeenCheckedError报错,必须用异步方法调用。总之这样的做法不完美,但能用。

 

暂时没找到其他方法

ionic4 判断是否登录,然后跳转设置rootpage

1.ionic 4是用的单独的angular路由,和ionic3不同,不是通过app.component跳转的;

2.正确做法是通过,路由守卫判断,然后使用NavController.navigateRoot设置rootpage;

ps:不能在app.component中判断,否则会每次先出现路由中的root,再跳转到你设置的root

路由守卫文档:

https://angular.cn/guide/router#milestone-5-route-guards