淘宝退款

This commit is contained in:
wanyongkang
2020-10-15 14:03:09 +08:00
parent 91a914bcc4
commit 729b32f0a4
6 changed files with 78 additions and 15 deletions

View File

@@ -34,7 +34,7 @@ class Jwt {
* ]
* @return bool|string
*/
public static function getToken(array $payload)
public static function getToken($payload)
{
if(is_array($payload))
{
@@ -53,7 +53,7 @@ class Jwt {
* @param string $Token 需要验证的token
* @return bool|string
*/
public static function verifyToken(string $Token)
public static function verifyToken($Token)
{
$tokens = explode('.', $Token);
if (count($tokens) != 3)
@@ -95,7 +95,7 @@ class Jwt {
* @param string $input 需要编码的字符串
* @return string
*/
private static function base64UrlEncode(string $input)
private static function base64UrlEncode($input)
{
return str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));
}
@@ -105,7 +105,7 @@ class Jwt {
* @param string $input 需要解码的字符串
* @return bool|string
*/
private static function base64UrlDecode(string $input)
private static function base64UrlDecode($input)
{
$remainder = strlen($input) % 4;
if ($remainder) {
@@ -122,7 +122,7 @@ class Jwt {
* @param string $alg 算法方式
* @return mixed
*/
private static function signature(string $input, string $key, string $alg = 'HS256')
private static function signature($input, $key, $alg)
{
$alg_config=array(
'HS256'=>'sha256'

View File

@@ -2,7 +2,7 @@
/*
* @Author: your name
* @Date: 2020-09-30 17:32:46
* @LastEditTime: 2020-10-14 20:02:14
* @LastEditTime: 2020-10-14 20:40:36
* @LastEditors: kangkang
* @Description: In User Settings Edit
* @FilePath: /phptest/fastphp/base/Model.php
@@ -61,5 +61,14 @@ class Model extends Sql
{
return $this->field($fields)->where($where)->limit('1')->fetch();
}
/**
* @description: 更新一条数据
* @param {type}
* @return {type}
*/
public function updateOne($where = [], $data = [])
{
return $this->where($where)->update($data);
}
}