2024-06-07 13:38:31 +08:00

36 lines
1.1 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// HBApiParams.h
// FlyChat1
//
// Created by Liv on 2022/3/6.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HBApiParams : NSObject
/**
client:结构为获取的当前的终端信息,参考字面义
clientVer:当前开发的前端app、pc、h5版本号参与验签
cont:请求包体内容内容为空时则直接接留空,参与验签
timestamp:时间戳,毫秒值,参与验签
clientType请求终端传值为ios android h5 web;参与验签
apiVer调用接口版本默认为1 ;参与验签
验签key:使用sha1(终端类型)转hex值获取
以上验签字段使用key=value结构拼接按照字段排序key即可
生成的验签串如下:
apiVer=1&clientType=web&clientVer=1&cont=哈哈哈&timestamp=1572760249513&key=CA84D1343B96BAA8137C943ED1860E522CACB238
再将验签串进行md5加密转hex获得sign的值如下
最终生成的签名内容为:A6218946715FF5272527BFEADE70D022
***/
+ (NSDictionary *)fetchPostParams:(id)info encryption:(BOOL)encryption;
@end
NS_ASSUME_NONNULL_END