refactor: 确立独立子工程架构 (backend, admin, mpuniapp) 并同步更新 AGENTS.md 规范

这个提交包含在:
wikiboss
2026-09-20 17:05:22 +08:00
父节点 de3cf8b870
当前提交 9fa1d1fbd0
共有 1679 个文件被更改,包括 204798 次插入 和 16817 次删除

查看文件

@@ -0,0 +1,61 @@
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isIOS = platformInfo.startsWith('ios')
const PAGE_PATH = '/pages/API/get-app-base-info/get-app-base-info'
describe('ExtApi-GetAppBaseInfo', () => {
let page;
let res;
const stringProperties = [
'appId', 'appName', 'appVersion', 'appVersionCode', 'appLanguage',
'language', 'uniCompilerVersion', 'uniPlatform', 'uniRuntimeVersion',
]
// ios 暂不支持返回 packagename
if (!isIOS) {
stringProperties.push('packagename')
}
const numberProperties = [
'uniCompilerVersionCode', 'uniRuntimeVersionCode'
]
const booleanProperties = [
'isUniAppX'
]
const requiredProperties = [
'uniCompilerVersion',
'uniCompilerVersionCode',
'uniRuntimeVersion',
'uniRuntimeVersionCode',
'isUniAppX'
]
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600);
res = await uni.getAppBaseInfo();
});
it('Check properties', async () => {
for (const key in res) {
const value = res[key];
if (stringProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).not.toBe("");
}
if (numberProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(value).toBeGreaterThanOrEqual(3.90);
}
if (booleanProperties.indexOf(key) != -1) {
expect(value).not.toBeNull();
expect(typeof value).toBe('boolean');
}
if (key == "appTheme") {
expect(['light', 'dark', 'auto']).toContain(value);
}
}
});
it('Check GetSystemInfoSync required properties', async () => {
for (let i = 0; i < requiredProperties.length; i++) {
const key = requiredProperties[i]
expect(`${key} not null: ${res[key] != null}`).toBe(`${key} not null: true`)
}
})
});

查看文件

@@ -0,0 +1,65 @@
<template>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view class="uni-list">
<view class="uni-list-cell" v-for="(item, index) in data.items" :key="index" style="align-items: center;">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">{{item.label}}</view>
</view>
<view class="uni-list-cell-db">
<text class="uni-list-cell-db-text">{{ item.value == '' ? '未获取' : item.value }}</text>
</view>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button type="primary" @tap="getAppBaseInfo">获取App基础信息</button>
</view>
</view>
</view>
</template>
<script setup lang="uts">
type Item = {
label : string,
value : string,
}
type DataType = {
items: Item[];
}
const title = ref('getAppBaseInfo')
const data = reactive({
items: [] as Item[],
} as DataType)
const getAppBaseInfo = () => {
const res = uni.getAppBaseInfo();
const res_str = JSON.stringify(res);
const res_obj = JSON.parseObject(res_str);
const res_map = res_obj!.toMap();
let keys = [] as string[]
res_map.forEach((_, key) => {
keys.push(key);
});
data.items = [] as Item[];
keys.sort().forEach(key => {
const value = res[key];
if (value != null) {
const item = {
label: key,
value: "" + ((typeof value == "object") ? JSON.stringify(value) : value)
} as Item;
data.items.push(item);
}
});
}
</script>
<style>
.uni-pd {
padding-left: 15px;
}
</style>