From 2be70e8e6cc4469647b34bde12632f4334864d33 Mon Sep 17 00:00:00 2001 From: lapy Date: Sat, 25 Apr 2026 17:05:15 +0100 Subject: [PATCH] feat(manager-mobile): westernize H5 app, copy, and shared crypto - English locale defaults; remove duplicate zh-only locale files - SM2 utility sharing with the web client where applicable --- main/manager-mobile/README.md | 216 +++--- main/manager-mobile/env/.env | 11 +- main/manager-mobile/eslint.config.mjs | 8 +- main/manager-mobile/manifest.config.ts | 28 +- main/manager-mobile/package.json | 14 +- main/manager-mobile/pages.config.ts | 4 +- main/manager-mobile/pnpm-lock.yaml | 17 +- main/manager-mobile/scripts/postupgrade.js | 22 +- main/manager-mobile/src/App.vue | 59 +- main/manager-mobile/src/api/agent/agent.ts | 65 +- main/manager-mobile/src/api/agent/types.ts | 26 +- main/manager-mobile/src/api/auth.ts | 39 +- .../src/api/chat-history/chat-history.ts | 22 +- .../src/api/chat-history/types.ts | 14 +- main/manager-mobile/src/api/device/device.ts | 38 +- .../src/api/voiceprint/types.ts | 8 +- .../src/api/voiceprint/voiceprint.ts | 20 +- .../src/components/custom-tabs/index.vue | 2 +- main/manager-mobile/src/env.d.ts | 18 +- main/manager-mobile/src/hooks/usePageAuth.ts | 12 +- main/manager-mobile/src/hooks/useRequest.ts | 16 +- main/manager-mobile/src/hooks/useUpload.ts | 20 +- main/manager-mobile/src/http/README.md | 32 +- main/manager-mobile/src/http/request/alova.ts | 75 +-- main/manager-mobile/src/http/request/enum.ts | 62 +- main/manager-mobile/src/http/request/types.ts | 6 +- main/manager-mobile/src/i18n/index.ts | 34 +- main/manager-mobile/src/i18n/zh_CN.ts | 503 -------------- main/manager-mobile/src/i18n/zh_TW.ts | 503 -------------- .../src/layouts/fg-tabbar/fg-tabbar.vue | 4 +- .../src/layouts/fg-tabbar/tabbar.md | 26 +- .../src/layouts/fg-tabbar/tabbar.ts | 4 +- .../src/layouts/fg-tabbar/tabbarList.ts | 34 +- main/manager-mobile/src/main.ts | 7 - main/manager-mobile/src/manifest.json | 4 +- .../src/pages-sub/demo/index.vue | 4 +- main/manager-mobile/src/pages.json | 64 +- main/manager-mobile/src/pages/agent/edit.vue | 621 ++++-------------- main/manager-mobile/src/pages/agent/index.vue | 70 +- .../src/pages/agent/provider.vue | 18 +- .../src/pages/agent/speedPitch.vue | 14 +- main/manager-mobile/src/pages/agent/tools.vue | 208 +++--- .../src/pages/chat-history/detail.vue | 110 ++-- .../src/pages/chat-history/index.vue | 66 +- .../components/ultrasonic-config.vue | 282 ++++---- .../device-config/components/wifi-config.vue | 38 +- .../components/wifi-selector.vue | 90 +-- .../src/pages/device-config/index.vue | 71 +- .../manager-mobile/src/pages/device/index.vue | 434 ++---------- .../src/pages/forgot-password/index.vue | 122 ++-- main/manager-mobile/src/pages/index/index.vue | 144 ++-- main/manager-mobile/src/pages/login/index.vue | 407 ++++-------- .../src/pages/login/privacy-policy-zh.vue | 402 ------------ .../src/pages/login/user-agreement-zh.vue | 542 --------------- .../src/pages/register/index.vue | 331 +++++----- .../src/pages/settings/index.vue | 342 +++------- .../src/pages/voiceprint/index.vue | 381 ++++------- main/manager-mobile/src/router/interceptor.ts | 20 +- main/manager-mobile/src/static/logo.svg | 4 +- main/manager-mobile/src/store/config.ts | 15 +- main/manager-mobile/src/store/index.ts | 5 +- main/manager-mobile/src/store/lang.ts | 24 +- main/manager-mobile/src/store/plugin.ts | 18 +- main/manager-mobile/src/store/provider.ts | 12 +- main/manager-mobile/src/store/user.ts | 39 +- main/manager-mobile/src/style/index.scss | 8 +- main/manager-mobile/src/typings.d.ts | 8 +- main/manager-mobile/src/typings.ts | 4 +- main/manager-mobile/src/uni.scss | 52 +- main/manager-mobile/src/utils/index.ts | 110 ++-- main/manager-mobile/src/utils/platform.ts | 4 +- main/manager-mobile/src/utils/toast.ts | 12 +- main/manager-mobile/src/utils/uploadFile.ts | 185 +++--- main/manager-mobile/tsconfig.json | 6 +- main/manager-mobile/uno.config.ts | 14 +- main/manager-mobile/vite.config.ts | 68 +- 76 files changed, 2040 insertions(+), 5302 deletions(-) delete mode 100644 main/manager-mobile/src/i18n/zh_CN.ts delete mode 100644 main/manager-mobile/src/i18n/zh_TW.ts delete mode 100644 main/manager-mobile/src/pages/login/privacy-policy-zh.vue delete mode 100644 main/manager-mobile/src/pages/login/user-agreement-zh.vue diff --git a/main/manager-mobile/README.md b/main/manager-mobile/README.md index 3a4f33a38..121b595c6 100644 --- a/main/manager-mobile/README.md +++ b/main/manager-mobile/README.md @@ -1,51 +1,51 @@ -## 智控台移动版(manager-mobile) -基于 uni-app v3 + Vue 3 + Vite 的跨端移动管理端,支持 App(Android & iOS)和微信小程序。 +## Xiaozhi Control Panel Mobile Version (manager-mobile) +Cross-platform mobile management client based on uni-app v3 + Vue 3 + Vite, supporting App (Android & iOS) and WeChat Mini Program. -### 平台兼容性 +### Platform Compatibility -| H5 | iOS | Android | 微信小程序 | +| H5 | iOS | Android | WeChat Mini Program | | -- | --- | ------- | ---------- | | √ | √ | √ | √ | -提示:不同 UI 组件在不同平台的适配度略有差异,请以对应组件库文档为准。 +Note: Different UI components have slight differences in adaptation across platforms, please refer to the corresponding component library documentation. -### 开发环境要求 +### Development Environment Requirements - Node >= 18 -- pnpm >= 7.30(建议使用项目中声明的 `pnpm@10.x`) -- 可选:HBuilderX(App 调试/打包)、微信开发者工具(微信小程序) +- pnpm >= 7.30 (recommended to use `pnpm@10.x` declared in the project) +- Optional: HBuilderX (App debugging/packaging), WeChat Developer Tools (WeChat Mini Program) -### 快速开始 -1) 配置环境变量 - - 复制 `env/.env.example` 为 `env/.env.development` - - 根据实际情况修改配置项(特别是 `VITE_SERVER_BASEURL`、`VITE_UNI_APPID`、`VITE_WX_APPID`) +### Quick Start +1) Configure environment variables + - Copy `env/.env.example` to `env/.env.development` + - Modify configuration items according to actual situation (especially `VITE_SERVER_BASEURL`, `VITE_UNI_APPID`, `VITE_WX_APPID`) -2) 安装依赖 +2) Install dependencies ```bash pnpm i ``` -3) 本地开发(热更新) -- h5: `pnpm dev:h5`,然后观察启动日志显示的ip端口号 -- 微信小程序:`pnpm dev:mp` 或 `pnpm dev:mp-weixin`,然后用微信开发者工具导入 `dist/dev/mp-weixin` -- App:用 HBuilderX 导入 `manager-mobile`,然后参考下面的教程就能运行了 +3) Local development (hot reload) +- h5: `pnpm dev:h5`, then observe the ip port number displayed in the startup log +- WeChat Mini Program: `pnpm dev:mp` or `pnpm dev:mp-weixin`, then import `dist/dev/mp-weixin` with WeChat Developer Tools +- App: Import `manager-mobile` with HBuilderX, then follow the tutorial below to run -### 环境变量与配置 -项目使用自定义 `env` 目录存放环境文件,按 Vite 规范命名:`.env.development`、`.env.production` 等。 +### Environment Variables and Configuration +The project uses a custom `env` directory to store environment files, named according to Vite specifications: `.env.development`, `.env.production`, etc. -关键变量(部分): -- VITE_APP_TITLE:应用名称(写入 `manifest.config.ts`) -- VITE_UNI_APPID:uni-app 应用 appid(App) -- VITE_WX_APPID:微信小程序 appid(mp-weixin) -- VITE_FALLBACK_LOCALE:默认语言,如 `zh-Hans` -- VITE_SERVER_BASEURL:服务端基础地址(HTTP 请求 baseURL) -- VITE_DELETE_CONSOLE:构建时是否移除 console(`true`/`false`) -- VITE_SHOW_SOURCEMAP:是否生成 sourcemap(默认关闭) -- VITE_LOGIN_URL:未登录跳转的登录页路径(路由拦截器使用) +Key variables (partial): +- VITE_APP_TITLE: Application name (written to `manifest.config.ts`) +- VITE_UNI_APPID: uni-app application appid (App) +- VITE_WX_APPID: WeChat Mini Program appid (mp-weixin) +- VITE_FALLBACK_LOCALE: Default language, such as `zh-Hans` +- VITE_SERVER_BASEURL: Server base address (HTTP request baseURL) +- VITE_DELETE_CONSOLE: Whether to remove console during build (`true`/`false`) +- VITE_SHOW_SOURCEMAP: Whether to generate sourcemap (default off) +- VITE_LOGIN_URL: Login page path for unauthenticated redirect (used by route interceptor) -示例(`env/.env.development`): +Example (`env/.env.development`): ```env -VITE_APP_TITLE=小智 +VITE_APP_TITLE=Xiaozhi VITE_FALLBACK_LOCALE=zh-Hans VITE_UNI_APPID= VITE_WX_APPID= @@ -57,111 +57,111 @@ VITE_SHOW_SOURCEMAP=false VITE_LOGIN_URL=/pages/login/index ``` -说明: -- `manifest.config.ts` 会从 `env` 读取标题、appid、语言等配置。 +Note: +- `manifest.config.ts` will read title, appid, language and other configurations from `env`. -### 重要注意事项 -⚠️ **部署前必须修改的配置项:** +### Important Notes +⚠️ **Configuration items that must be modified before deployment:** -1. **应用 ID 配置** - - `VITE_UNI_APPID`:需要在 [DCloud 开发者中心](https://dev.dcloud.net.cn/) 创建应用并获取 AppID - - `VITE_WX_APPID`:需要在 [微信公众平台](https://mp.weixin.qq.com/) 注册小程序并获取 AppID +1. **Application ID Configuration** + - `VITE_UNI_APPID`: Need to create an application in [DCloud Developer Center](https://dev.dcloud.net.cn/) and get AppID + - `VITE_WX_APPID`: Need to register a mini program in [WeChat Public Platform](https://mp.weixin.qq.com/) and get AppID -2. **服务端地址** - - `VITE_SERVER_BASEURL`:修改为您的实际服务端地址 +2. **Server Address** + - `VITE_SERVER_BASEURL`: Modify to your actual server address -3. **应用信息** - - `VITE_APP_TITLE`:修改为您的应用名称 - - 更新 `src/static/logo.png` 等图标资源 +3. **Application Information** + - `VITE_APP_TITLE`: Modify to your application name + - Update icon resources such as `src/static/logo.png` -4. **其他配置** - - 检查 `manifest.config.ts` 中的应用配置信息 - - 根据需要修改 `src/layouts/fg-tabbar/tabbarList.ts` 中的 tabbar 配置 +4. **Other Configuration** + - Check application configuration information in `manifest.config.ts` + - Modify tabbar configuration in `src/layouts/fg-tabbar/tabbarList.ts` as needed -### 详细操作指南 +### Detailed Operation Guide -#### 1. 获取 uni-app AppID -![生成AppID](../../docs/images/manager-mobile/生成appid.png) -- 复制生成的 AppID 到环境变量 `VITE_UNI_APPID` 中 +#### 1. Get uni-app AppID +![Generate AppID](../../docs/images/manager-mobile/generate_appid.png) +- Copy the generated AppID to environment variable `VITE_UNI_APPID` -#### 2. 本地运行步骤 -![本地运行](../../docs/images/manager-mobile/本地运行.png) +#### 2. Local Running Steps +![Local Running](../../docs/images/manager-mobile/local_running.png) -**App 本地调试:** -1. 用 HBuilderX 导入 `manager-mobile` 目录 -2. 重新识别项目 -3. 连接手机或使用模拟器进行真机调试 +**App Local Debugging:** +1. Import `manager-mobile` directory with HBuilderX +2. Re-identify the project +3. Connect phone or use simulator for real device debugging -**项目识别问题解决:** -![重新识别项目](../../docs/images/manager-mobile/重新识别项目.png) +**Project Recognition Issue Resolution:** +![Re-identify Project](../../docs/images/manager-mobile/reidentify_project.png) -如果 HBuilderX 无法正确识别项目类型: -- 在项目根目录右键选择"重新识别项目类型" -- 确保项目被识别为 "uni-app" 项目 +If HBuilderX cannot correctly identify the project type: +- Right-click in the project root directory and select "Re-identify Project Type" +- Ensure the project is identified as a "uni-app" project -### 路由与鉴权 -- 在 `src/main.ts` 中注册了路由拦截插件 `routeInterceptor`。 -- 黑名单拦截:仅对配置为需要登录的页面进行校验(来源 `@/utils` 的 `getNeedLoginPages`)。 -- 登录判断:基于用户信息(`pinia` 的 `useUserStore`),未登录将跳转到 `VITE_LOGIN_URL`,并附带重定向回原页面的参数。 +### Routing and Authentication +- Route interceptor plugin `routeInterceptor` is registered in `src/main.ts`. +- Blacklist interception: Only validates pages configured to require login (from `getNeedLoginPages` in `@/utils`). +- Login determination: Based on user information (`useUserStore` from `pinia`), unauthenticated users will be redirected to `VITE_LOGIN_URL` with parameters to redirect back to the original page. -### 网络请求 -- 基于 `alova` + `@alova/adapter-uniapp`,统一在 `src/http/request/alova.ts` 创建实例。 -- `baseURL` 读取环境配置(`getEnvBaseUrl`),可通过 `method.config.meta.domain` 动态切换域名。 -- 认证:默认从本地 `token`(`uni.getStorageSync('token')`)注入 `Authorization` 头,缺失则重定向登录。 -- 响应:统一处理 `statusCode !== 200` 的 HTTP 错误与业务 `code !== 0` 的错误;`401` 会清除 token 并跳转登录。 +### Network Requests +- Based on `alova` + `@alova/adapter-uniapp`, unified instance creation in `src/http/request/alova.ts`. +- `baseURL` reads environment configuration (`getEnvBaseUrl`), can dynamically switch domains through `method.config.meta.domain`. +- Authentication: Default injection of `Authorization` header from local `token` (`uni.getStorageSync('token')`), redirect to login if missing. +- Response: Unified handling of HTTP errors with `statusCode !== 200` and business errors with `code !== 0`; `401` will clear token and redirect to login. -### 构建与发布 +### Build and Release -**微信小程序:** -1. 确保已配置正确的 `VITE_WX_APPID` -2. 运行 `pnpm build:mp`,产物在 `dist/build/mp-weixin` -3. 用微信开发者工具导入项目目录,并上传代码 -4. 在微信公众平台提交审核 +**WeChat Mini Program:** +1. Ensure correct `VITE_WX_APPID` is configured +2. Run `pnpm build:mp`, output in `dist/build/mp-weixin` +3. Import project directory with WeChat Developer Tools and upload code +4. Submit for review in WeChat Public Platform -**Android & iOS App:** +**Android & iOS App:** -#### 3. App 打包发行步骤 +#### 3. App Packaging and Release Steps -**步骤一:准备打包** -![打包发行步骤1](../../docs/images/manager-mobile/打包发行步骤1.png) +**Step 1: Prepare Packaging** +![Packaging Release Step 1](../../docs/images/manager-mobile/packaging_release_step1.png) -1. 确保已配置正确的 `VITE_UNI_APPID` -2. 运行 `pnpm build:app`,产物在 `dist/build/app` -3. 用 HBuilderX 导入项目目录 -4. 在 HBuilderX 中点击"发行" → "原生App-云打包" +1. Ensure correct `VITE_UNI_APPID` is configured +2. Run `pnpm build:app`, output in `dist/build/app` +3. Import project directory with HBuilderX +4. Click "Release" → "Native App-Cloud Packaging" in HBuilderX -**步骤二:配置打包参数** -![打包发行步骤2](../../docs/images/manager-mobile/打包发行步骤2.png) +**Step 2: Configure Packaging Parameters** +![Packaging Release Step 2](../../docs/images/manager-mobile/packaging_release_step2.png) -1. **应用图标和启动图**:上传应用图标和启动页面图片 -2. **应用版本号**:设置版本号和版本名称 -3. **签名证书**: - - Android:上传 keystore 证书文件 - - iOS:配置开发者证书和描述文件 -4. **包名配置**:设置应用的包名(Bundle ID) -5. **打包类型**:选择测试包或正式包 -6. 点击"打包"开始云打包流程 +1. **App Icon and Launch Screen**: Upload app icon and launch screen images +2. **App Version Number**: Set version number and version name +3. **Signature Certificate**: + - Android: Upload keystore certificate file + - iOS: Configure developer certificate and provisioning profile +4. **Package Name Configuration**: Set app package name (Bundle ID) +5. **Packaging Type**: Choose test package or release package +6. Click "Package" to start cloud packaging process -**发布到应用商店:** -- **Android**:将生成的 APK 文件上传到各大 Android 应用市场 -- **iOS**:将生成的 IPA 文件通过 App Store Connect 上传到 App Store(需要 Apple 开发者账号) +**Release to App Stores:** +- **Android**: Upload generated APK file to major Android app markets +- **iOS**: Upload generated IPA file to App Store through App Store Connect (requires Apple Developer account) -### 约定与工程化 -- 页面与分包:由 `@uni-helper/vite-plugin-uni-pages` 与 `pages.config.ts` 统一生成;tabbar 配置在 `src/layouts/fg-tabbar/tabbarList.ts`。 -- 组件与 hooks 自动导入:见 `vite.config.ts` 中 `unplugin-auto-import` 与 `@uni-helper/vite-plugin-uni-components`。 -- 样式:使用 UnoCSS 与 `src/style/index.scss`。 -- 状态管理:`pinia` + `pinia-plugin-persistedstate`。 -- 代码规范:内置 `eslint`、`husky`、`lint-staged`,提交前自动格式化(`lint-staged`)。 +### Conventions and Engineering +- Pages and sub-packages: Generated by `@uni-helper/vite-plugin-uni-pages` and `pages.config.ts`; tabbar configuration in `src/layouts/fg-tabbar/tabbarList.ts`. +- Component and hooks auto-import: See `unplugin-auto-import` and `@uni-helper/vite-plugin-uni-components` in `vite.config.ts`. +- Styling: Uses UnoCSS and `src/style/index.scss`. +- State management: `pinia` + `pinia-plugin-persistedstate`. +- Code standards: Built-in `eslint`, `husky`, `lint-staged`, auto-format before commit (`lint-staged`). -### 常用脚本 +### Common Scripts ```bash -# 开发 -pnpm dev:mp # 等价 dev:mp-weixin +# Development +pnpm dev:mp # Equivalent to dev:mp-weixin -# 构建 -pnpm build:mp # 等价 build:mp-weixin +# Build +pnpm build:mp # Equivalent to build:mp-weixin -# 其他 +# Others pnpm type-check pnpm lint && pnpm lint:fix ``` diff --git a/main/manager-mobile/env/.env b/main/manager-mobile/env/.env index e0f4eea67..f32b546ec 100644 --- a/main/manager-mobile/env/.env +++ b/main/manager-mobile/env/.env @@ -1,19 +1,20 @@ -VITE_APP_TITLE = '小智' +VITE_APP_TITLE = 'Xiao Zhi' VITE_APP_PORT = 9000 VITE_UNI_APPID = '__UNI__36A515E' VITE_WX_APPID = 'wxa2abb91f64032a2b' -# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base +# The base path for the H5 website deployment, configured in manifest.config.ts under h5.router.base VITE_APP_PUBLIC_BASE=/ -# 登录页面 +# Login Page VITE_LOGIN_URL = '/pages/login/index' -# 第一个请求地址 + +# Primary API endpoint URL VITE_SERVER_BASEURL = 'https://2662r3426b.vicp.fun/xiaozhi' VITE_UPLOAD_BASEURL = '/otaMag/upload' -# h5是否需要配置代理 +# Whether the H5 app requires proxy configuration VITE_APP_PROXY=true VITE_APP_PROXY_PREFIX = '/xiaozhi' \ No newline at end of file diff --git a/main/manager-mobile/eslint.config.mjs b/main/manager-mobile/eslint.config.mjs index 54ce246d6..0dd559164 100644 --- a/main/manager-mobile/eslint.config.mjs +++ b/main/manager-mobile/eslint.config.mjs @@ -7,14 +7,14 @@ export default uniHelper({ ignores: [ 'src/uni_modules/', 'dist', - // unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用 + // Type files generated by unplugin-auto-import, changes on every commit, so add them here to work with .gitignore 'auto-import.d.ts', - // vite-plugin-uni-pages 生成的类型文件,每次切换分支都一堆不同的,所以直接 .gitignore + // Type files generated by vite-plugin-uni-pages, many differences on every branch switch, so directly .gitignore 'uni-pages.d.ts', - // 插件生成的文件 + // Plugin generated files 'src/pages.json', 'src/manifest.json', - // 忽略自动生成文件 + // Ignore auto-generated files 'src/service/app/**', ], rules: { diff --git a/main/manager-mobile/manifest.config.ts b/main/manager-mobile/manifest.config.ts index d0429b861..3db19b38d 100644 --- a/main/manager-mobile/manifest.config.ts +++ b/main/manager-mobile/manifest.config.ts @@ -4,13 +4,13 @@ import process from 'node:process' import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest' import { loadEnv } from 'vite' -// 手动解析命令行参数获取 mode +// Manually parse command line arguments to get mode function getMode() { const args = process.argv.slice(2) const modeFlagIndex = args.findIndex(arg => arg === '--mode') - return modeFlagIndex !== -1 ? args[modeFlagIndex + 1] : args[0] === 'build' ? 'production' : 'development' // 默认 development + return modeFlagIndex !== -1 ? args[modeFlagIndex + 1] : args[0] === 'build' ? 'production' : 'development' // Default development } -// 获取环境变量的范例 +// Example of getting environment variables const env = loadEnv(getMode(), path.resolve(process.cwd(), 'env')) const { VITE_APP_TITLE, @@ -33,7 +33,7 @@ export default defineManifestConfig({ // base: VITE_APP_PUBLIC_BASE, }, }, - /* 5+App特有相关 */ + /* 5+App specific */ 'app-plus': { usingComponents: true, nvueStyleCompiler: 'uni-app', @@ -47,11 +47,11 @@ export default defineManifestConfig({ autoclose: true, delay: 0, }, - /* 模块配置 */ + /* Module configuration */ modules: {}, - /* 应用发布信息 */ + /* Application distribution information */ distribute: { - /* android打包配置 */ + /* Android packaging configuration */ android: { minSdkVersion: 30, targetSdkVersion: 30, @@ -76,11 +76,11 @@ export default defineManifestConfig({ '', ], }, - /* ios打包配置 */ + /* iOS packaging configuration */ ios: {}, - /* SDK配置 */ + /* SDK configuration */ sdkConfigs: {}, - /* 图标配置 */ + /* Icon configuration */ icons: { android: { hdpi: 'unpackage/res/icons/72x72.png', @@ -115,14 +115,14 @@ export default defineManifestConfig({ }, }, }, - /* 快应用特有相关 */ + /* Quick app specific */ 'quickapp': {}, - /* 小程序特有相关 */ + /* Mini program specific */ 'mp-weixin': { appid: VITE_WX_APPID, setting: { urlCheck: false, - // 是否启用 ES6 转 ES5 + // Whether to enable ES6 to ES5 conversion es6: true, minified: true, }, @@ -133,7 +133,7 @@ export default defineManifestConfig({ // __usePrivacyCheck__: true, permission: { 'scope.userLocation': { - desc: 'WiFi配网功能需要获取位置权限', + desc: 'WiFi configuration function requires location permission', }, }, requiredPrivateInfos: ['getLocation'], diff --git a/main/manager-mobile/package.json b/main/manager-mobile/package.json index 9c4ed55ff..19adec812 100644 --- a/main/manager-mobile/package.json +++ b/main/manager-mobile/package.json @@ -4,20 +4,20 @@ "version": "3.4.0", "unibest-version": "3.4.0", "packageManager": "pnpm@10.10.0", - "description": "xiaozhi-esp32-server的移动端管理后台", + "description": "Mobile management backend for xiaozhi-esp32-server", "generate-time": "2025-08-04", "author": { "name": "huangjunsen", - "zhName": "黄俊森", + "zhName": "Huang Junsen", "email": "huangjunsen@xiaozhi.com", "github": "https://github.com/huangjunsen0406", "gitee": "https://gitee.com/huang-jun-sen" }, "license": "MIT", - "homepage": "https://github.com/xinnan-tech/xiaozhi-esp32-server", - "repository": "https://github.com/xinnan-tech/xiaozhi-esp32-server", + "homepage": "https://github.com/lapy/xiaozhi-esp32-server", + "repository": "https://github.com/lapy/xiaozhi-esp32-server", "bugs": { - "url": "https://github.com/xinnan-tech/xiaozhi-esp32-server/issues" + "url": "https://github.com/lapy/xiaozhi-esp32-server/issues" }, "engines": { "node": ">=18", @@ -100,7 +100,7 @@ "js-cookie": "^3.0.5", "pinia": "2.0.36", "pinia-plugin-persistedstate": "3.2.1", - "sm-crypto": "^0.3.13", + "sm-crypto": "^0.4.0", "vue": "^3.4.21", "wot-design-uni": "^1.9.1", "z-paging": "2.8.7" @@ -154,7 +154,7 @@ "vue-tsc": "^2.2.10" }, "resolutions": { - "bin-wrapper": "npm:bin-wrapper-china" + "bin-wrapper": "npm:bin-wrapper" }, "lint-staged": { "*": "eslint --fix" diff --git a/main/manager-mobile/pages.config.ts b/main/manager-mobile/pages.config.ts index 4547919c2..fc2da42b9 100644 --- a/main/manager-mobile/pages.config.ts +++ b/main/manager-mobile/pages.config.ts @@ -4,7 +4,7 @@ import { tabBar } from './src/layouts/fg-tabbar/tabbarList' export default defineUniPages({ globalStyle: { navigationStyle: 'default', - navigationBarTitleText: '小智', + navigationBarTitleText: 'XiaoZhi', navigationBarBackgroundColor: '#f8f8f8', navigationBarTextStyle: 'black', backgroundColor: '#FFFFFF', @@ -18,6 +18,6 @@ export default defineUniPages({ 'z-paging/components/z-paging$1/z-paging$1.vue', }, }, - // tabbar 的配置统一在 "./src/layouts/fg-tabbar/tabbarList.ts" 文件中 + // tabbar configuration is unified in "./src/layouts/fg-tabbar/tabbarList.ts" file tabBar: tabBar as any, }) diff --git a/main/manager-mobile/pnpm-lock.yaml b/main/manager-mobile/pnpm-lock.yaml index 9faf80cdf..1116a7a94 100644 --- a/main/manager-mobile/pnpm-lock.yaml +++ b/main/manager-mobile/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - bin-wrapper: npm:bin-wrapper-china + bin-wrapper: npm:bin-wrapper patchedDependencies: '@dcloudio/uni-h5': @@ -91,6 +91,9 @@ importers: pinia-plugin-persistedstate: specifier: 3.2.1 version: 3.2.1(pinia@2.0.36(typescript@5.7.2)(vue@3.5.15(typescript@5.7.2))) + sm-crypto: + specifier: ^0.4.0 + version: 0.4.0 vue: specifier: ^3.4.21 version: 3.5.15(typescript@5.7.2) @@ -4719,6 +4722,9 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true + jsbn@1.1.0: + resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + jsdoc-type-pratt-parser@4.1.0: resolution: {integrity: sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==} engines: {node: '>=12.0.0'} @@ -6020,6 +6026,9 @@ packages: resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} engines: {node: '>=18'} + sm-crypto@0.4.0: + resolution: {integrity: sha512-OexH2V1EqmhXuOIPGoCl55OjMF0wwPUM/zhUjT0Q6vHBeopSRvTNRy76/1eRoFs3VBKt39hdFnxwpFmooHYa2A==} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -12652,6 +12661,8 @@ snapshots: dependencies: argparse: 2.0.1 + jsbn@1.1.0: {} + jsdoc-type-pratt-parser@4.1.0: {} jsdom@16.7.0: @@ -14145,6 +14156,10 @@ snapshots: ansi-styles: 6.2.1 is-fullwidth-code-point: 5.0.0 + sm-crypto@0.4.0: + dependencies: + jsbn: 1.1.0 + source-map-js@1.2.1: {} source-map-support@0.5.21: diff --git a/main/manager-mobile/scripts/postupgrade.js b/main/manager-mobile/scripts/postupgrade.js index 65e4e604e..f4679f197 100644 --- a/main/manager-mobile/scripts/postupgrade.js +++ b/main/manager-mobile/scripts/postupgrade.js @@ -1,13 +1,13 @@ -// # 执行 `pnpm upgrade` 后会升级 `uniapp` 相关依赖 -// # 在升级完后,会自动添加很多无用依赖,这需要删除以减小依赖包体积 -// # 只需要执行下面的命令即可 +// # After executing `pnpm upgrade`, uniapp related dependencies will be upgraded +// # After upgrade, many useless dependencies will be automatically added, which need to be deleted to reduce package size +// # Just execute the following command const { exec } = require('node:child_process') -// 定义要执行的命令 +// Define commands to execute const dependencies = [ '@dcloudio/uni-app-harmony', - // TODO: 如果不需要某个平台的小程序,请手动删除或注释掉 + // TODO: If you don't need mini programs for certain platforms, please manually delete or comment out '@dcloudio/uni-mp-alipay', '@dcloudio/uni-mp-baidu', '@dcloudio/uni-mp-jd', @@ -17,19 +17,19 @@ const dependencies = [ '@dcloudio/uni-mp-toutiao', '@dcloudio/uni-mp-xhs', '@dcloudio/uni-quickapp-webview', - // i18n模板要注释掉下面的 + // i18n template should comment out the following 'vue-i18n', ] -// 使用exec执行命令 +// Use exec to execute commands exec(`pnpm un ${dependencies.join(' ')}`, (error, stdout, stderr) => { if (error) { - // 如果有错误,打印错误信息 - console.error(`执行出错: ${error}`) + // If there is an error, print error information + console.error(`Execution error: ${error}`) return } - // 打印正常输出 + // Print normal output console.log(`stdout: ${stdout}`) - // 如果有错误输出,也打印出来 + // If there is error output, print it out too console.error(`stderr: ${stderr}`) }) diff --git a/main/manager-mobile/src/App.vue b/main/manager-mobile/src/App.vue index d31d32d79..275bbbda7 100644 --- a/main/manager-mobile/src/App.vue +++ b/main/manager-mobile/src/App.vue @@ -1,78 +1,23 @@