Просмотр исходного кода

Merge branch 'master' of http://git.huxiukeji.com/zhangxiaobin/ggyuyin

lizhen_gitee 1 год назад
Родитель
Сommit
2e250bca1b

+ 2 - 1
addons/qcloudsms/config.php

@@ -101,7 +101,8 @@ return [
             'resetpwd' => '1844866',
             'changepwd' => '1844866',
             'profile' => '1844866',
-            'changepaypwd' => '1844866',
+            'editpaypwd' => '1844866',
+            'forgetpaypwd' => '1844866',
             'default' => '1844866',
         ],
         'rule' => 'required',

+ 1 - 1
application/api/controller/Index.php

@@ -258,7 +258,7 @@ class Index extends Api
 
         $timeArr = [1=>$hour,2=>$today,3=>$weekend,4=>$month];
         $where = [];
-        $where["a.type"] = ["in",[2,3,5,6]];//type:1=充值,2=买锤子,3=送礼物,4=声币换钻石,5=开贵族,6=买装扮,7=拒绝订单返还,8=完成订单收益
+        $where["a.type"] = ["in",[0,2,3,5,6,11,13]];//查看wallet.php文件
         $where["a.createtime"] = ["gt",$timeArr[$time]];
         $list = model('UserJewelLog')->alias("a")
             ->field("sum(a.value) as total_price,u.avatar,u.nickname")

+ 47 - 26
application/api/controller/User.php

@@ -7,6 +7,7 @@ use app\common\library\Ems;
 use app\common\library\Sms;
 use app\common\service\UserService;
 use fast\Random;
+use think\Exception;
 use think\Validate;
 use miniprogram\wxBizDataCrypt;
 use onlogin\onlogin;
@@ -916,8 +917,8 @@ class User extends Api
     public function realauth()
     {
         try {
-            $realName = $this->request->param('real_name',0);
-            $idCard   = $this->request->param('id_card',0);
+            $realName = $this->request->param('real_name','');
+            $idCard   = $this->request->param('id_card','');
             if ($this->auth->is_auth == 2) {
                 $this->error('您已经真人认证过了~');
             }
@@ -927,16 +928,17 @@ class User extends Api
             if (empty($idCard)) {
                 throw new Exception('请输入身份证号');
             }
-            $userService = new UserService();
+            /*$userService = new UserService();
             $faceParams = [
                 'real_name' => $realName,
                 'id_card' => $idCard,
+                'user_id' => $this->auth->id,
             ];
-            $res = $userService->faceAuth($faceParams);echo '<pre>';var_dump($res);exit;
+            $res = $userService->faceAuth($faceParams);
             if (!$res['status']) {
                 $this->error('您的网络开小差啦5~');
             }
-            $rs = json_decode($res['data'], true);
+            $rs = $res['data'];
             if (!$rs || $rs['code'] != 0) {
                 $this->error('您的网络开小差啦6~');
             }
@@ -945,13 +947,31 @@ class User extends Api
                 'user_id' => $this->auth->id,
                 'realname' => $realName,
                 'idcard' => $idCard,
-                'certify_id' => $rs['result']['faceId'],
-                'out_trade_no' => $data['orderNo'],
+                'certify_id' => isset($rs['result']['faceId']) ? $rs['result']['faceId'] : '',
+                'out_trade_no' => isset($rs['result']['orderNo']) ? $rs['result']['orderNo'] : '',
+                'status' => 0,
+                'createtime' => time(),
+                'updatetime' => time()
+            ];*/
+            $userService = new UserService();
+            $aliParams = [
+                'id_card' => $idCard,
+                'real_name' => $realName,
+            ];
+            $aliCheckRes = $userService->aliCheck($aliParams);
+            if (!$aliCheckRes['status']) {
+                throw new Exception($aliCheckRes['msg']);
+            }
+            $user_auth = [
+                'user_id' => $this->auth->id,
+                'realname' => $realName,
+                'idcard' => $idCard,
+                'certify_id' => '',
+                'out_trade_no' => '',
                 'status' => 0,
                 'createtime' => time(),
                 'updatetime' => time()
             ];
-
             //开启事务
             Db::startTrans();
             //查询是否认证过
@@ -966,22 +986,21 @@ class User extends Api
                 $this->error('您的网络开小差啦7~');
             }
             //修改用户表认证状态
-            $user_rs = Db::name('user')->where(['id' => $this->auth->id])->setField('real_status', 0);
+            $user_rs = Db::name('user')->where(['id' => $this->auth->id])->setField('is_auth', 2);
             if ($user_rs === false) {
                 Db::rollback();
                 $this->error('您的网络开小差啦8~');
             }
 
             Db::commit();
-
-            $return_data = [
+            /*$return_data = [
                 'face_id' => $user_auth['certify_id'],
                 'order_no' => $user_auth['out_trade_no'],
                 'user_id' => (string)$this->auth->id,
-                'nonce' => $sign_data['nonce'],
-                'sign' => $sign
-            ];
-            $this->success('success', $return_data);
+                'nonce' => $rs['nonce'],
+                'sign' => $rs['sign'],
+            ];*/
+            $this->success('验证成功');
         } catch (Exception $e) {
             $this->error($e->getMessage());
         }
@@ -999,9 +1018,11 @@ class User extends Api
         if (!$user_auth['certify_id']) {
             $this->success('请先进行真人认证');
         }
-
+        $tencentConfig = config('tencent_yun');
+        $sercrtId = isset($tencentConfig['SecretId']) ? $tencentConfig['SecretId'] : '';
+        $sercrtKey = isset($tencentConfig['SecretKey']) ? $tencentConfig['SecretKey'] : '';
         //获取token
-        $token_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id='.config('tencent_yun')['secret_id'].'&secret='.config('tencent_yun')['secret_key'].'&grant_type=client_credential&version=1.0.0';
+        $token_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id='.$sercrtId.'&secret='.$sercrtKey.'&grant_type=client_credential&version=1.0.0';
         $token_result = file_get_contents($token_url);
         if (!$token_result) {
             $this->error('您的网络开小差啦1~');
@@ -1013,7 +1034,7 @@ class User extends Api
         $token = $token_result['access_token'];
 
         //获取签名鉴权参数ticket
-        $ticket_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id='.config('tencent_yun')['secret_id'].'&access_token='.$token.'&type=SIGN&version=1.0.0';
+        $ticket_url = 'https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id='.$sercrtId.'&access_token='.$token.'&type=SIGN&version=1.0.0';
         $ticket_result = file_get_contents($ticket_url);
         if (!$ticket_result) {
             $this->error('您的网络开小差啦3~');
@@ -1026,7 +1047,7 @@ class User extends Api
 
         //获取签名
         $sign_data = [
-            'wbappid' => config('tencent_yun')['secret_id'],
+            'wbappid' => $sercrtId,
             'orderNo'  => $user_auth['out_trade_no'],
             'version' => '1.0.0',
             'ticket'  => $ticket,
@@ -1039,7 +1060,7 @@ class User extends Api
         //人脸核身结果查询
         $url = 'https://miniprogram-kyc.tencentcloudapi.com/api/v2/base/queryfacerecord?orderNo=' . $user_auth['out_trade_no'];
         $data = [
-            'appId' => config('tencent_yun')['secret_id'],
+            'appId' => $sercrtId,
             'version' => '1.0.0',
             'nonce' => $sign_data['nonce'],
             'orderNo' => $user_auth['out_trade_no'],
@@ -1055,10 +1076,10 @@ class User extends Api
             $this->error($rs['msg']);
         }
         if ($rs['result']['liveRate'] >= 90 && $rs['result']['similarity'] >= 90) {
-            $edit_data['status'] = 1;
+            $edit_data['status'] = 2;
             $msg = '真人认证成功';
         } else {
-            $edit_data['status'] = 2;
+            $edit_data['status'] = -1;
             $edit_data['certify_id'] = '';
             $edit_data['out_trade_no'] = '';
             $msg = '真人认证失败';
@@ -1074,19 +1095,19 @@ class User extends Api
             $this->error('查询认证结果失败2');
         }
         //修改用户信息
-        $rs = Db::name('user')->where(['id' => $this->auth->id])->setField('real_status', $edit_data['status']);
+        $rs = Db::name('user')->where(['id' => $this->auth->id])->setField('is_auth', $edit_data['status']);
         if (!$rs) {
             Db::rollback();
             $this->error('查询认证结果失败3');
         }
-        if ($edit_data['status'] == 1) { //通过
+        if ($edit_data['status'] == 2) { //通过
             //tag任务赠送金币
             //真人认证奖励
-            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,20);
+            /*$task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,20);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务赠送奖励失败');
-            }
+            }*/
             //系统消息
             $msg_id = \app\common\model\Message::addMessage($this->auth->id,'真人认证','真人认证已经审核通过');
         } else {

+ 3 - 2
application/api/controller/Usersign.php

@@ -111,7 +111,8 @@ class Usersign extends Api
         }
         //第七天赠送礼物
         $gift = [];
-        if ($data['times'] == 7) {
+        $sendGift = config('site.sign_gift');
+        if ($data['times'] == 7 && $sendGift == '1') {
             $userSignGift = model('UserSignGift')->with(['gift'])->find();
             if (!empty($userSignGift)) {
                 $giftData = isset($userSignGift['gift']) ? $userSignGift['gift'] : [];
@@ -125,7 +126,7 @@ class Usersign extends Api
         }
 
         //系统消息
-        $msg_id = \app\common\model\Message::addMessage($this->auth->id,'签到奖励','签到成功,获得金币奖励');
+        $msg_id = \app\common\model\Message::addMessage($this->auth->id,'签到奖励','签到成功,获得奖励');
 
         Db::commit();
         $result = [

+ 121 - 2
application/api/controller/Withdraw.php

@@ -4,6 +4,7 @@ namespace app\api\controller;
 
 use app\common\library\Sms;
 use app\api\controller\Common;
+use fast\Random;
 use think\Db;
 use think\Exception;
 use think\Validate;
@@ -230,7 +231,7 @@ class Withdraw extends Common
     public function getBankInfo() {
         // 查询是否有过绑定
         $bankInfo = \app\common\model\UserBank::where(["user_id"=>$this->auth->id])->find();
-        if(!$bankInfo) $this->error("银行卡信息获取失败!");
+        //if(!$bankInfo) $this->error("银行卡信息获取失败!");
         $this->success("获取成功!",$bankInfo);
     }
 
@@ -281,7 +282,7 @@ class Withdraw extends Common
     public function getAlipayInfo() {
         // 查询是否有过绑定
         $alipayInfo = UserAlipay::where(["user_id"=>$this->auth->id])->find();
-        if(!$alipayInfo) $this->error("支付宝信息获取失败!");
+        //if(!$alipayInfo) $this->error("支付宝信息获取失败!");
         $this->success("获取成功!",$alipayInfo);
     }
 
@@ -328,4 +329,122 @@ class Withdraw extends Common
             $this->error("没有查询到用户信息!请前往app注册!");
         }
     }
+    public function getEncryptPassword($password, $salt = '')
+    {
+        return md5(md5($password) . $salt);
+    }
+
+    /**
+     * 设置交易密码
+     * @return void
+     */
+    public function setPaypwd()
+    {
+        try {
+            $userId = $this->auth->id;
+            $payPwd = $this->request->param('pay_pwd','');
+            $confirmPwd = $this->request->param('confirm_pay_pwd','');
+            if (empty($payPwd) || empty($confirmPwd)) {
+                throw new Exception('参数错误');
+            }
+            if ($payPwd != $confirmPwd) {
+                throw new Exception('密码不一致');
+            }
+            $paySalt = Random::alnum();
+            $payPassword = $this->getEncryptPassword($payPwd,$paySalt);
+            $where['id'] = $userId;
+            $user = model('User')->where($where)->find();
+            if (empty($user)) {
+                throw new Exception('未知的用户');
+            }
+            $user->pay_password = $payPassword;
+            $user->pay_salt = $paySalt;
+            $res = $user->save();
+            if (!$res) {
+                throw new Exception('设置失败');
+            }
+            $this->success('设置成功');
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
+     * 修改交易密码
+     * @return void
+     */
+    public function editPaypwd()
+    {
+        try {
+            $userId = $this->auth->id;
+            $oldPayPwd = $this->request->param('old_pay_pwd','');
+            $payPwd = $this->request->param('pay_pwd','');
+            $confirmPwd = $this->request->param('confirm_pay_pwd','');
+            if (empty($oldPayPwd) || empty($payPwd) || empty($confirmPwd)) {
+                throw new Exception('参数错误');
+            }
+            if ($payPwd != $confirmPwd) {
+                throw new Exception('密码不一致');
+            }
+            $where['id'] = $userId;
+            $user = model('User')->where($where)->find();
+            if (empty($user)) {
+                throw new Exception('未知的用户');
+            }
+            $userPaySalt = $user['pay_salt'];
+            $userPayPassword = $this->getEncryptPassword($oldPayPwd,$userPaySalt);
+            if ($userPayPassword != $user['pay_password']) {
+                throw new Exception('旧密码错误');
+            }
+            $paySalt = Random::alnum();
+            $payPassword = $this->getEncryptPassword($payPwd,$paySalt);
+
+            $user->pay_password = $payPassword;
+            $user->pay_salt = $paySalt;
+            $res = $user->save();
+            if (!$res) {
+                throw new Exception('设置失败');
+            }
+            $this->success('设置成功');
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+    
+    /**
+     * 验证改密码
+     * @return void
+     */
+    public function checkSms()
+    {
+        try {
+            $mobile = $this->request->param('mobile','');
+            $code = $this->request->param('code','');
+            //$event = $this->request->param('event','');//事件editpaypwd=修改支付密码,forgetpaypwd=忘记支付密码
+            if (empty($mobile) || empty($code)) {
+                throw new Exception('参数错误');
+            }
+            $userMobile = $this->auth->mobile;
+            if (empty($userMobile)) {
+                throw new Exception('绑定手机号');
+            }
+            if ($mobile != $userMobile) {
+                throw new Exception('手机号与绑定不一致');
+            }
+            //$where['event'] = $event;
+            $where['mobile'] = $mobile;
+            $where['code'] = $code;
+            $sms = model('Sms')->where($where)->find();
+            if (empty($sms)) {
+                throw new Exception('验证码错误');
+            }
+            $createtime = $sms['createtime'] - (60 * 2);
+            if ($sms['createtime'] < $createtime) {
+                throw new Exception('验证已过期,请重新获取。');
+            }
+            $this->success('验证成功');
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
 }

+ 60 - 0
application/common.php

@@ -644,3 +644,63 @@ if (!function_exists('getUinqueId')) {
         return $newid;
     }
 }
+if (!function_exists('curl_post')) {
+    /**
+     * 发起HTTPS请求
+     */
+    function curl_post($url, $data, $header = '', $timeOut = 0)
+    {
+        //初始化curl
+        $ch = curl_init();
+        //参数设置
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+        curl_setopt($ch, CURLOPT_TIMEOUT, $timeOut);
+        curl_setopt($ch, CURLOPT_HEADER, 0);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        if ($header != '') {
+            curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
+        }
+        $result = curl_exec($ch);
+        //连接失败
+        if ($result == FALSE) {
+            //\think\Log::record('[ CURL ] ERROR ' . curl_error($ch)."\n".var_export(debug_backtrace(), true)."\n", 'error');
+        }
+        curl_close($ch);
+        return $result;
+    }
+}
+if (!function_exists('curl_get')) {
+    /**
+     * 发起HTTP GET请求
+     */
+    function curl_get($url)
+    {
+        $oCurl = curl_init();
+        if (stripos($url, "https://") !== FALSE) {
+            curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
+            curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);
+            curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1
+        }
+        curl_setopt($oCurl, CURLOPT_TIMEOUT, 3);
+        curl_setopt($oCurl, CURLOPT_URL, $url);
+        curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1);
+        $sContent = curl_exec($oCurl);
+        $aStatus  = curl_getinfo($oCurl);
+        $error    = curl_error($oCurl);
+        curl_close($oCurl);
+        if ($error) {
+            $sContent = file_get_contents($url);
+            return $sContent;
+        }
+
+        if (intval($aStatus["http_code"]) == 200) {
+            return $sContent;
+        } else {
+            return false;
+        }
+    }
+}

+ 12 - 2
application/common/library/Auth.php

@@ -462,9 +462,13 @@ class Auth
                 $v["type"] == 4 && $userandroidpop = $v["android_image"];
             }
         }
+        $userField = 'id,pay_password,openid';
+        $user = model('User')->field($userField)->where(["id" => $this->_user->id])->with(['useralipay','userbank'])->find();
         // 获取我的推荐人的邀请码
-        $preCode = \app\common\model\User::where(["id" => $this->_user->pre_userid])->value("invite_no");
-        $userinfo["preCode"] = $preCode ? $preCode : "";
+        $preUserField = 'id,invite_no';
+        $preUser = model('User')->field($preUserField)->where(["id" => $this->_user->pre_userid])->find();
+        $preCode = isset($preUser['invite_no']) ? $preUser['invite_no'] : '';
+        $userinfo["preCode"] = $preCode;
         $userinfo["usercar"] = $usercar;
         $userinfo["userheader"] = $userheader;
         $userinfo["userlight"] = $userlight;
@@ -481,6 +485,12 @@ class Auth
         foreach ($fieldArr as $key => $value) {
             $userinfo[$value] = isset($userData[$value]) ? $userData[$value] : '';
         }
+        $userAlipay = isset($user['useralipay']) ? $user['useralipay'] : [];
+        $userBank = isset($user['userbank']) ? $user['userbank'] : [];
+        $userinfo['is_pay_pwd'] = !empty($user['pay_password']) ? 1 : 0;
+        $userinfo['bind_wechat'] = !empty($user['openid']) ? 1 : 0;
+        $userinfo['bind_alipay'] = !empty($userAlipay) ? 1 : 0;
+        $userinfo['bind_bank'] = !empty($userBank) ? 1 : 0;
 
         return $userinfo;
     }

+ 9 - 0
application/common/model/User.php

@@ -383,4 +383,13 @@ class User extends Model
     {
         return $this->hasOne('Age', 'id', 'age_id',[],'LEFT');
     }
+    public function useralipay()
+    {
+        return $this->hasOne('UserAlipay', 'user_id', 'id',[],'LEFT');
+    }
+
+    public function userbank()
+    {
+        return $this->hasOne('UserBank', 'user_id', 'id',[],'LEFT');
+    }
 }

+ 63 - 7
application/common/service/UserService.php

@@ -22,7 +22,8 @@ class UserService
         try {
             $idCard = isset($params['id_card']) ? $params['id_card'] : '';
             $realName = isset($params['real_name']) ? $params['real_name'] : '';
-            $tencentConfig = config('tencent_im');
+            $userId = isset($params['user_id']) ? $params['user_id'] : 0;
+            $tencentConfig = config('tencent_yun');
             $sercrtId = isset($tencentConfig['SecretId']) ? $tencentConfig['SecretId'] : '';
             $sercrtKey = isset($tencentConfig['SecretKey']) ? $tencentConfig['SecretKey'] : '';
             //获取token
@@ -31,7 +32,7 @@ class UserService
             if (!$token_result) {
                 throw new Exception('您的网络开小差啦1~');
             }
-            $token_result = json_decode($token_result, true);echo '<pre>';var_dump($token_result);exit;
+            $token_result = json_decode($token_result, true);
             if ($token_result['code'] != 0) {
                 throw new Exception('您的网络开小差啦2~');
             }
@@ -52,7 +53,7 @@ class UserService
             //获取签名
             $sign_data = [
                 'wbappid' => $sercrtId,
-                'userId'  => (string)$this->auth->id,
+                'userId'  => (string)$userId,
                 'version' => '1.0.0',
                 'ticket'  => $ticket,
                 'nonce'   => Random::alnum(32)
@@ -62,12 +63,12 @@ class UserService
             $sign = sha1($sign_string);
 
             //上传身份信息
-            $orderNo = getMillisecond() . $this->auth->id . mt_rand(1, 1000); //商户请求的唯一标识
+            $orderNo = getMillisecond() . $userId . mt_rand(1, 1000); //商户请求的唯一标识
             $url = 'https://miniprogram-kyc.tencentcloudapi.com/api/server/getAdvFaceId?orderNo='.$orderNo;
             $data = [
                 'webankAppId' => $sercrtId,
                 'orderNo' => $orderNo,
-                'userId' => (string)$this->auth->id,
+                'userId' => (string)$userId,
                 'name' => $realName,//姓名
                 'idNo' => $idCard,//证件号
                 'version' => '1.0.0',
@@ -75,8 +76,63 @@ class UserService
                 'nonce' => $sign_data['nonce']
             ];
             $res = curl_post($url,json_encode($data, 320), ['Content-Type: application/json']);
-            echo '<pre>';var_dump($res);exit;
-            $result['data'] = $res;
+            $result['data'] = json_decode($res,true);
+            $result['data']['nonce'] = $sign_data['nonce'];
+            $result['data']['sign'] = $sign;
+        } catch (Exception $e) {
+            $result['status'] = 0;
+            $result['msg'] = $e->getMessage();
+        }
+        return $result;
+    }
+
+    /**
+     * 阿里实名认证二要素
+     * https://market.aliyun.com/products/57000002/cmapi026109.html
+     * @return void
+     */
+    public function aliCheck($params=[])
+    {
+        $result = [
+            'status' => 1,
+            'msg' => '',
+            'data' => [],
+        ];
+        try {
+            $idCard = isset($params['id_card']) ? $params['id_card'] : '';
+            $realName = isset($params['real_name']) ? $params['real_name'] : '';
+            $aliyunConfig = config('ali_yun');
+            $host = "https://eid.shumaidata.com";
+            $path = "/eid/check";
+            $method = "POST";
+            $appcode = isset($aliyunConfig['app_code']) ? $aliyunConfig['app_code'] : '';
+            $headers = ['Content-Type: application/json'];
+            array_push($headers, "Authorization:APPCODE " . $appcode);
+            $querys = "idcard=".$idCard."&name=".urlencode($realName);
+            $bodys = "";
+            $url = $host . $path . "?" . $querys;
+
+            $curl = curl_init();
+            curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
+            curl_setopt($curl, CURLOPT_URL, $url);
+            curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
+            curl_setopt($curl, CURLOPT_FAILONERROR, false);
+            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+            //设定返回信息中是否包含响应信息头,启用时会将头文件的信息作为数据流输出,true 表示输出信息头, false表示不输出信息头
+            //如果需要将字符串转成json,请将 CURLOPT_HEADER 设置成 false
+            curl_setopt($curl, CURLOPT_HEADER, false);
+            if (1 == strpos("$".$host, "https://"))
+            {
+                curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
+                curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
+            }
+            $returnRes = curl_exec($curl);
+            curl_close($curl);
+            $resultData = json_decode($returnRes,true);
+            if (isset($resultData['code']) && !empty($resultData['code'])) {
+                throw new Exception($resultData['message']);
+            }
+            $result['data'] = $resultData;
         } catch (Exception $e) {
             $result['status'] = 0;
             $result['msg'] = $e->getMessage();

+ 6 - 1
application/config.php

@@ -414,5 +414,10 @@ return [
         'key' => 'f31aa80a36cef72829fbcdcb10aa2aadcea2944787f2b268d46021e67711326b',
         'SecretId' => 'AKIDISQCk4FCuSN9j8LL9k7GH6oLgpkAOQDm',
         'SecretKey' => 'PaZKq8D4vgOtFSYUEoESVLwJVu78wXxA',
-    ]
+    ],
+    'ali_yun' => [
+        'app_key' => '203989188',
+        'app_secret' => '4yku6nam6YK0TGdlEemkmMbBR4catDVU',
+        'app_code' => '3f4fc2408a0143509e5be5c20eb97c5b',
+    ],
 ];

+ 1 - 0
application/extra/site.php

@@ -111,4 +111,5 @@ return [
     'domain_name' => 'http://ggyuyin.huxiukeji.cn',
     'intro_image' => '/uploads/20230703/35b10db56529aa19086eeb3d1d0bb6b0.png',
     'egggift_content' => '<p>我是奖励概览</p>',
+    'sign_gift' => '1',
 ];