1.0.12 • Published 5 months ago
@besovideo/apifox-service-gen v1.0.12
当前包包含多个从apifox文档生成的typescript接口模块 和 必要的工具
// 接口文档 https://bvcsp.apifox.cn/
import bvcsp from "@besovideo/apifox-service-gen/bvcsp";
// 接口文档 https://bvnru.apifox.cn/
import bvnru from "@besovideo/apifox-service-gen/bvnru";
// 接口文档 https://bvalg.apifox.cn/
import bvnru from "@besovideo/apifox-service-gen/bvalg";
// 接口文档 https://bvworkorder.apifox.cn/
import bvworkorder from "@besovideo/apifox-service-gen/bvworkorder";
// 配置/工具库
import {ServiceGlobalConfig, ServiceGlobalUtils} from "@besovideo/apifox-service-gen";示例
import { ServiceGlobalConfig, ServiceGlobalUtils } from "@besovideo/apifox-service-gen";
import { linkaction, auth } from "@besovideo/apifox-service-gen/bvcsp";
async function test() {
// 工具库 登录加密
const loginParams =
ServiceGlobalUtils.PlatformLoginEncryPasswordWithTimestamp(
"admin",
"123456"
);
// 登录
const loginResult = await auth.postBvcspV1AuthLogin({ body: loginParams });
if (!loginResult.error && loginResult.data?.code == 0) {
const tokenInfo = loginResult.data.data;
if (tokenInfo && tokenInfo.token) {
//设置token
ServiceGlobalConfig.SetConfig(tokenInfo.token);
}
}
// 修改报警联动
const a = await linkaction.putBvcspV1LinkactionById({
path: {
id: 1,
},
body: {}
});
}
test();