🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
联盟成员注册后才能使用,注册成功后,每个联盟成员有一个身份ID和一个KEY,调用接口时必须传入身份ID(参数名为:union_id)和用数据签名。 sign生成方法:对请求中的data数据加上**key=分配给成员的KEY**,进行MD5并转为大写。 示例: **原始请求为:** {"data":{"name":"张三","time":"2022-02-24 16:20:41","pass_type":"in","user_type":"2","id_number":"1234567890","telephone":"18799098765","face_img":"test","code":"test","user_code":"1","gate_name":"test","aisle_name":"test1"}} **签名方法:** data后面加上:key=7B315B512350500E 得到(7B315B512350500E为分配给联盟成员的KEY): {"name":"张三","time":"2022-02-24 16:20:41","pass_type":"in","user_type":"2","id_number":"1234567890","telephone":"18799098765","face_img":"test","code":"test","user_code":"1","gate_name":"test","aisle_name":"test1"}key=7B315B512350500E 对上面的字符串MD5并大写得到:0427A04F49FE3E25804C12999F45A96C,在MD5方法中,取字节时使用**utf-8码** **请求数据为:** {"platform\_name": "shanghai","union\_id": "200538","sign": "0427A04F49FE3E25804C12999F45A96C","timestamp": "1645690842","data": { "name": "张三","time": "2022-02-24 16:20:41","pass\_type": "in","user\_type": "2", "id\_number": "1234567890","telephone": "18799098765","face\_img": "test","code": "test","user\_code": "1","gate\_name": "test","aisle\_name": "test1"    } } 返回结果: {"code":1,"data":"{\\"state\\":1,\\"message\\":\\"上报成功\\"}","message":"成功"}