Giter VIP home page Giter VIP logo

hikopenapitools's Introduction

海康威视综合安防管理平台API测试工具与签名认证工具 👋

Version License: ISC

hik_sign_tool通过AK,SK生成海康威视OpenAPI访问所需的签名。
hik_api_test_tool作为前端调用签名并访问API,查看返回结果

Usage

签名服务 hik_sign_tool

修改app.js中的appKey和secertKey为你自己的AK和SK
使用PM2守护启动

npm install -g pm2
pm2 app.js

通过前端调用 http://部署设备IP:3000/getsign?Method=调用方法&apiPath=API路径地址 来获取签名字符串
例如: http://localhost:3000/getsign?Method=POST&apiPath=/artemis/api/resource/v1/unit/getAllTreeCode

注意api地址需要带上/artemis一起签名
这是比较坑的一个地方。因为一般集成商给出的文档中,API地址只有/api/resource/v1/unit/getAllTreeCode这一节,但是实际访问要求带上/artemis

接口测试工具 hik_api_test_tool

修改vite.config.js
/dev-api中的target为调用api的服务器地址 /sign-api中的target为签名服务的服务器地址

npm run dev

/data/apis.ts中包含所有待调试测试的api地址,可自行修改 每次通过输入参数传入的结构体会被自动记录,存储在本地,方便调用

Author

👤 huyu

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

hikopenapitools's People

Contributors

scienticat avatar

Watchers

 avatar

hikopenapitools's Issues

获取的签名用不了

你好,我按照你的教程,修改了appKey和appSecret,
访问http://部署设备IP:3000/getsign?method=POST&apipath=/artemis/api/resource/v1/regions/root
返回

{"code":1,"sign":"PQ7g5/FLcBVTt+N7kvccQ3AqfCZsC99vBJJw5SPWB4s=","errorMsg":""}

测试hik_api_test_tool
修改了vite.config.js中的dev-api和sign-api,
输出参数一直是

{
"code": "0x02401001",
"msg": "Consumer inexistence!"
}
请问我是哪里设置不对呢?

我在平台在线调试,都是正常的
QQ截图20240724122128

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.