选择厂商
这个提交包含在:
父节点
2081e3d6fa
当前提交
919151b0fa
@ -1,4 +1,12 @@
|
|||||||
|
|
||||||
|
# [v1.0.4] 2024.xx.xx
|
||||||
|
|
||||||
|
------
|
||||||
|
> - 优化缓存工具
|
||||||
|
> - 网络工具优化
|
||||||
|
> - 本次更新内容较多,请自行查看文档
|
||||||
|
>
|
||||||
|
|
||||||
# [v1.0.3] 2024.10.15
|
# [v1.0.3] 2024.10.15
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
* 常用工具
|
* 常用工具
|
||||||
*/
|
*/
|
||||||
export { ToolsHelper } from './src/main/ets/utils/ToolsHelper'
|
export { ToolsHelper } from './src/main/ets/utils/ToolsHelper'
|
||||||
|
export { ToolsHelperForTS } from './src/main/ets/utils/ToolsHelperForTS'
|
||||||
export { AlgorithmHelper } from './src/main/ets/utils/AlgorithmHelper'
|
export { AlgorithmHelper } from './src/main/ets/utils/AlgorithmHelper'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -11,7 +11,7 @@ type HttpParamsGet = {
|
|||||||
}
|
}
|
||||||
type HttpParamsPost = {
|
type HttpParamsPost = {
|
||||||
url: string
|
url: string
|
||||||
data?: Object
|
data?: string | Object | ArrayBuffer
|
||||||
query?: Record<string, string> | Object
|
query?: Record<string, string> | Object
|
||||||
headers?: Record<string, string>
|
headers?: Record<string, string>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
import { HashMap } from "@kit.ArkTS";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用方法,部分方法,在ets里面不能用
|
||||||
|
*/
|
||||||
|
export class ToolsHelperForTS {
|
||||||
|
// Map转为Record
|
||||||
|
static mapToRecord(myMap: HashMap<string, string>): Record<string, string> {
|
||||||
|
return Object.fromEntries(myMap.entries()) as Record<string, string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Record转为Map
|
||||||
|
static recordToMap(myRecord: Record<string, string>): HashMap<string, string> {
|
||||||
|
let myMap: HashMap<string, string> = new HashMap();
|
||||||
|
for (const key in myRecord) {
|
||||||
|
myMap.set(key, myRecord[key]);
|
||||||
|
}
|
||||||
|
return myMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
正在加载...
在新工单中引用
屏蔽一个用户