fix(mobile): recover direct channels after network failure

This commit is contained in:
key
2026-07-29 02:31:19 +08:00
parent 376a7c4b84
commit dc20b92061
6 changed files with 66 additions and 9 deletions
+13
View File
@@ -36,6 +36,19 @@ test('App 平台编译器已声明且与其他 uni 包同版本,避免 build:a
assert.equal(appPlus, pkg.devDependencies['@dcloudio/vite-plugin-uni']);
});
test('App 版本在 package、lockfile 与原生 manifest 间保持一致', async () => {
const [pkg, lockfile, manifest] = await Promise.all([
readJson('../package.json'),
readJson('../package-lock.json'),
readJson('../src/manifest.json')
]);
assert.equal(lockfile.version, pkg.version);
assert.equal(lockfile.packages?.['']?.version, pkg.version);
assert.equal(manifest.versionName, pkg.version);
assert.match(String(manifest.versionCode || ''), /^\d+$/);
});
test('Android 自定义基座显式面向 Android 15 权限模型', async () => {
const manifest = await readJson('../src/manifest.json');
const android = manifest['app-plus']?.distribute?.android;
+7
View File
@@ -19,6 +19,13 @@ test('员工端直通车包含固定五通道、业务匿名和本人回复闭
assert.match(page, /匿名提交/);
assert.match(page, /正式回复/);
assert.match(page, /requestId/);
assert.match(page, /v-else-if="channelsFailed"/);
assert.match(page, /重新加载直达对象/);
assert.match(page, /@click="loadChannels"/);
assert.match(page, /const channelsLoading = ref\(false\)/);
assert.match(page, /const channelsFailed = ref\(false\)/);
assert.match(page, /const loadChannels = async \(\) => \{[\s\S]*if \(channelsLoading\.value\) return;[\s\S]*channelsFailed\.value = false;[\s\S]*await listDirectChannels\(\)[\s\S]*catch \{[\s\S]*form\.channelCode = '';[\s\S]*channelsFailed\.value = true;[\s\S]*finally \{[\s\S]*channelsLoading\.value = false;/);
assert.match(page, /const canSubmit = computed\(\(\) =>[\s\S]*!channelsLoading\.value[\s\S]*!channelsFailed\.value/);
assert.match(broadcast, /openDirect/);
assert.ok(pages.includes('pages/user/direct/index'));
});