chengkun
2025-05-23 a6f7b382623096b6a00924f418447cf5204e825e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
 
 
class admin_xcx_baidu_controller extends adminCommon
{
 
    function index_action()
    {
 
        if ($_POST['pay_config']) {
 
            $_POST  =   $this->post_trim($_POST);
 
            $str    =   str_replace("\r\n", '', $_POST['sy_privateKey']);
 
            $baidu  =   array(
 
                'sy_appKey'     =>  $_POST['sy_appKey'],
                'sy_dealId'     =>  $_POST['sy_dealId'],
                'sy_privateKey' =>  str_replace(PHP_EOL, '', $str),
                'sy_publicKey'  =>  $_POST['sy_publicKey'],
                'sy_baidu_iospay' => isset($_POST['sy_baidu_iospay']) ? 1 : 2
            );
            foreach ($baidu as $v) {
                if (empty($v)) {
                    $this->ACT_layer_msg('请将参数配置齐', 8);
                }
            }
            $baidu['sy_bdlogin_appKey'] =  $_POST['sy_bdlogin_appKey'];
            $baidu['sy_bdlogin_appSecret'] =  $_POST['sy_bdlogin_appSecret'];
 
            made_web(DATA_PATH . 'api/baidu/baidu_data.php', ArrayToString($baidu), 'baiduData');
 
            unset($baidu['sy_weburl']);
 
            $configM    =   $this->MODEL('config');
            $configM->setConfig($baidu);
 
            $this->web_config();
 
            $this->ACT_layer_msg('百度小程序配置成功!', 9, $_SERVER['HTTP_REFERER'], 2, 1);
        }
 
        @include(DATA_PATH . 'api/baidu/baidu_data.php');
        if (isset($baiduData)) {
 
            $this->yunset('baiduData', $baiduData);
        }
 
        $this->yuntpl(array('admin/admin_xcx_baidu'));
    }
 
    function makeCache_action()
    {
 
        $wxAppM =   $this->MODEL('wxapp');
        $wxAppM->makeBaiduCache();
    }
}
 
?>