Replace virtual payments with WeChat Pay API v3 and verify callbacks and order polling. Cache WeChat access tokens in Redis and write structured Zap logs. Support configurable capacity plans across the API, admin and mini program, with purchase snapshots and quota enforcement. Allow personal albums before binding and share them with the current partner. Update deployment configuration and domain routing.
16 lines
915 B
JavaScript
16 lines
915 B
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const path = require('node:path');
|
|
const loader = require('./load-module.cjs');
|
|
test('development requests and file previews use local backend, trial and release use production', () => {
|
|
for (const version of ['develop','trial','release']) {
|
|
const wx = {getAccountInfoSync:()=>({miniProgram:{envVersion:version}})};
|
|
const load = loader({wx,console});
|
|
const env = load(path.join(__dirname,'../config/env.js'));
|
|
const {API_BASE,getImageUrl} = load(path.join(__dirname,'../utils/request.js'));
|
|
assert.equal(env.env, version === 'develop' ? 'dev' : version);
|
|
assert.equal(API_BASE, version === 'develop' ? 'http://127.0.0.1:8080/api' : 'https://we.sundynix.cn/api');
|
|
assert.equal(getImageUrl('/api/files/6083e119-6b26-441b-8b70-44d224366238'),API_BASE+'/files/6083e119-6b26-441b-8b70-44d224366238');
|
|
}
|
|
});
|