feat: require couple binding and refine miniapp settings
Gate record features and storage entry points with invitation guidance; enforce record access in the backend. Add homepage greetings, right-swipe profile dismissal, and move the smoking switch to settings. Simplify API base configuration and remove the unused legacy tab bar component.
This commit is contained in:
@@ -2,14 +2,14 @@ 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', () => {
|
||||
test('requests and file previews use the manually configured API base in every runtime', () => {
|
||||
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 configured = 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.deepEqual(Object.keys(configured),['API_BASE']);
|
||||
assert.equal(API_BASE,require('../config/env').API_BASE);
|
||||
assert.equal(getImageUrl('/api/files/6083e119-6b26-441b-8b70-44d224366238'),API_BASE+'/files/6083e119-6b26-441b-8b70-44d224366238');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user