JJ Chen

.NET Developer

All Posts

aliyun oss download with custom filename

阿里云对象存储产品文档:通过设置HTTP头管理OSS文件元数据 阿里云 OSS 生成对象的下载 URL 时,浏览器会使用保存到 OSS 的文件名作为下载文件名。 但一般业务,在保存时,会生成一个“唯一”的文件名,比如用 GUID 生成——这就导致 下载文件名 与 实际文件名 不一致的问题。 为了解决这个问题,可以在上传文件时,通过设置 Content-Disposition 来解决。
OSS

Google 地图瓦片国内域名失效

今天用一个第三方的系统看地图,发现谷歌地图的卫星图挂了。 F12 查了下,一堆接口 404——发现瓦片是通过 gac-geo.googlecnapps.cn 获取的,比如: https://gac-geo.googlecnapps.cn/maps/vt?lyrs=shl=zh-CNx=223346y=103684z=18 (这域名还是谷歌自己注册😏) 试了下直接把域名换成 www.google.com,可以拿到瓦片(请求超时的,请使用魔法),比如: https://www.google.com/maps/vt?lyrs=shl=zh-CNx=223346y=103684z=18 因为是第三方的系统,改不了人家的代码,只能直接想办法重定向了。 找了个浏览器插件 Redirector,直接搜就有: Redirector-add-on 添加一个重定向: Example URL:直接用上面的。

EF Core 字段备注

参考:博客园:小技巧 EntityFrameworkCore 实现 CodeFirst 通过模型生成数据库表时自动携带模型及字段注释信息

基于 APISIX 的微入侵登录方案

参考:博客园:apisix基于username和password的JWT验证插件 实现 Lua 脚本 -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the License); you may not use this file except in
APISIX

时间戳日志格式化插件

manifest.json { manifest_version: 3, name: TimeUtil, version: 1.0.0, description: XAG log timestamp transformer, icons: { 48: icon.png }, action: { default_icon: icon.png }, permissions: [ activeTab ], content_scripts: [ { matches: [ https://xrtk.xaggeo.com/log/*.log ],
Chrome JS