本次提交主要实现微信小程序虚拟支付提审防审机制,包括: 1. 后台配置虚拟支付防审开关,支持开启/关闭模式 2. 前端根据开关状态及设备类型,iOS设备自动触发合规提示 3. 分销模块调整提现规则,无门槛即时提现 4. 登录页面优化,增加返回和暂不登录入口,符合微信审核规范 5. 新增提现记录页面,优化分销中心界面布局 该功能确保微信提审期间能顺利通过审核,审核通过后可一键切换为正常运营模式,无需重新发布小程序代码。
21 行
803 B
JavaScript
21 行
803 B
JavaScript
const fs = require('fs');
|
|
let file = 'application/api/controller/Setting.php';
|
|
let content = fs.readFileSync(file, 'utf8');
|
|
|
|
let target = `'virtualPayAudit' => (int)$this->cfg('pay.virtualPayAudit', 1) === 1,`;
|
|
let replacement = `'virtualPayAudit' => (function() {
|
|
$sysVal = \\think\\Db::name('config')->where('name', 'virtual_pay_audit')->value('value');
|
|
if ($sysVal !== null && $sysVal !== '') {
|
|
return (int)$sysVal === 1;
|
|
}
|
|
return (int)$this->cfg('pay.virtualPayAudit', 1) === 1;
|
|
})(),`;
|
|
|
|
if (content.includes(target)) {
|
|
content = content.replace(target, replacement);
|
|
fs.writeFileSync(file, content, 'utf8');
|
|
console.log('REPLACED_OK');
|
|
} else {
|
|
console.log('TARGET_NOT_FOUND');
|
|
}
|