小程序微信后台和代理后台使用同一个域名
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
require_once dirname(dirname(dirname(__DIR__))) . '/env_config.php';
|
||||
define('USEDCHARSET', 'utf-8');
|
||||
$_api_base = env('SDK_API_URL');
|
||||
|
||||
/// 这里定义公共变量
|
||||
$app_id = '14992192722868'; /// appid
|
||||
@@ -244,7 +246,7 @@ function SendPost($url, $data)
|
||||
/// 判断是否有sid和scode, 什么数据都没有则先跳转到登录页面授权
|
||||
if (empty($sid) || empty($scode))
|
||||
{
|
||||
$url = "https://api.tscce.cn/source/login/login.php?app_id={$app_id}&dev_key={$dev_key}&market_key={$market_key}&redirect_uri=" . rawurlencode(getLocaleUrl());
|
||||
$url = "{$_api_base}/source/login/login.php?app_id={$app_id}&dev_key={$dev_key}&market_key={$market_key}&redirect_uri=" . rawurlencode(getLocaleUrl());
|
||||
header("Location: {$url}");
|
||||
exit;
|
||||
}
|
||||
@@ -293,7 +295,7 @@ EOL;
|
||||
);
|
||||
|
||||
$data['sign'] = SignParameter($data, $sign_key);
|
||||
$result = new ResultObject(rawurldecode(SendPost('https://api.tscce.cn/api/newpay/querylist', $data)));
|
||||
$result = new ResultObject(rawurldecode(SendPost($_api_base . '/api/newpay/querylist', $data)));
|
||||
|
||||
if (0 == $result->error && count($result->data) > 0) /// 成功
|
||||
{
|
||||
@@ -323,7 +325,7 @@ EOL;
|
||||
$data['sign'] = SignParameter($data, $sign_key);
|
||||
|
||||
$html = <<<EOF
|
||||
<form style="display:none;" id="frm" name="frm" method="post" action="https://api.tscce.cn/api/newpay/pay/online/">
|
||||
<form style="display:none;" id="frm" name="frm" method="post" action="{$_api_base}/api/newpay/pay/online/">
|
||||
<input name="appid" type="text" value="{$data['appid']}" />
|
||||
<input name="devkey" type="text" value="{$data['devkey']}" />
|
||||
<input name="sid" type="text" value="{$data['sid']}" />
|
||||
|
||||
Reference in New Issue
Block a user