|
@@ -227,38 +227,26 @@ function ImageNewsToArray($datas)
|
|
/**
|
|
/**
|
|
* 加密site id
|
|
* 加密site id
|
|
*/
|
|
*/
|
|
-function encodeDistributionChannelId($id)
|
|
|
|
-{
|
|
|
|
- $encrypt_pool = [];
|
|
|
|
- if (isset($encrypt_pool[$id])) {
|
|
|
|
|
|
+function encodeDistributionChannelId($id){
|
|
|
|
+ $encrypt_pool = ['10497'=>'wdtest'];
|
|
|
|
+ if(isset($encrypt_pool[$id])){
|
|
return $encrypt_pool[$id];
|
|
return $encrypt_pool[$id];
|
|
}
|
|
}
|
|
- /*$db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
|
|
|
|
- ->where('distribution_channel_id',$id)
|
|
|
|
- ->where('is_enable',1)
|
|
|
|
- ->select('en_distribution_channel_id')
|
|
|
|
- ->first();
|
|
|
|
-
|
|
|
|
- if($db_encrypt_info && $db_encrypt_info->en_distribution_channel_id){
|
|
|
|
- return $db_encrypt_info->en_distribution_channel_id;
|
|
|
|
- }*/
|
|
|
|
- $hashids = new \Hashids\Hashids('', 16, 'abcdefghjklmnopqrstuvwxyz1234567890');
|
|
|
|
|
|
+ $hashids = new \Hashids\Hashids(config('hashids.connections.main.salt'),16,'abcdefghjklmnopqrstuvwxyz1234567890');
|
|
return $hashids->encode($id);
|
|
return $hashids->encode($id);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 解密密site id
|
|
* 解密密site id
|
|
*/
|
|
*/
|
|
-function decodeDistributionChannelId($code)
|
|
|
|
-{
|
|
|
|
- $encrypt_pool = [];
|
|
|
|
- if (isset($encrypt_pool[$code])) {
|
|
|
|
|
|
+function decodeDistributionChannelId($code){
|
|
|
|
+ $encrypt_pool = ['wdtest'=>'10497'];
|
|
|
|
+ if(isset($encrypt_pool[$code])){
|
|
return $encrypt_pool[$code];
|
|
return $encrypt_pool[$code];
|
|
}
|
|
}
|
|
-
|
|
|
|
- $hashids = new \Hashids\Hashids('', 16, 'abcdefghjklmnopqrstuvwxyz1234567890');
|
|
|
|
- $res = $hashids->decode($code);
|
|
|
|
- if ($res && isset($res[0])) {
|
|
|
|
|
|
+ $hashids = new \Hashids\Hashids(config('hashids.connections.main.salt'),16,'abcdefghjklmnopqrstuvwxyz1234567890');
|
|
|
|
+ $res = $hashids->decode($code);
|
|
|
|
+ if($res && isset($res[0])){
|
|
return $res[0];
|
|
return $res[0];
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|