feat:将 pages 非 tabbar 页面,全部迁移到 pages-core,降低主包大小

This commit is contained in:
YunaiV
2025-12-22 20:15:24 +08:00
parent 555806f3da
commit 54585c4cde
30 changed files with 22 additions and 22 deletions

View File

@@ -54,7 +54,6 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue'
import { useToast } from 'wot-design-uni'
import { Verify } from '@/components/verifition'
import { FORGET_PASSWORD_PAGE, LOGIN_PAGE } from '@/router/config'
import { useTokenStore } from '@/store/token'
import { ensureDecodeURIComponent, redirectAfterLogin } from '@/utils'
@@ -62,6 +61,7 @@ import { isMobile } from '@/utils/validator'
import CodeInput from './components/code-input.vue'
import Header from './components/header.vue'
import TenantPicker from './components/tenant-picker.vue'
import { Verify } from './components/verifition'
defineOptions({
name: 'SmsLoginPage',

View File

@@ -82,7 +82,6 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue'
import { useToast } from 'wot-design-uni'
import { Verify } from '@/components/verifition'
import {
CODE_LOGIN_PAGE,
FORGET_PASSWORD_PAGE,
@@ -92,6 +91,7 @@ import { useTokenStore } from '@/store/token'
import { ensureDecodeURIComponent, redirectAfterLogin } from '@/utils'
import Header from './components/header.vue'
import TenantPicker from './components/tenant-picker.vue'
import { Verify } from './components/verifition'
defineOptions({
name: 'LoginPage',

View File

@@ -94,12 +94,12 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue'
import { useToast } from 'wot-design-uni'
import { Verify } from '@/components/verifition'
import { LOGIN_PAGE } from '@/router/config'
import { useTokenStore } from '@/store/token'
import { redirectAfterLogin } from '@/utils'
import Header from './components/header.vue'
import TenantPicker from './components/tenant-picker.vue'
import { Verify } from './components/verifition'
defineOptions({
name: 'RegisterPage',
@@ -197,12 +197,12 @@ function goToLogin() {
/** 跳转到用户协议 */
function goToUserAgreement() {
uni.navigateTo({ url: '/pages/user/settings/agreement/index' })
uni.navigateTo({ url: '/pages-core/user/settings/agreement/index' })
}
/** 跳转到隐私政策 */
function goToPrivacyPolicy() {
uni.navigateTo({ url: '/pages/user/settings/privacy/index' })
uni.navigateTo({ url: '/pages-core/user/settings/privacy/index' })
}
</script>

View File

@@ -55,7 +55,7 @@
import { ref } from 'vue'
import { useToast } from 'wot-design-uni'
import { navigateBackPlus } from '@/utils'
import { saveImageToAlbum } from '@/utils/download'
import { saveImageToAlbum, staticUrl } from '@/utils/download'
definePage({
style: {
@@ -66,7 +66,7 @@ definePage({
const toast = useToast()
const qrCodeUrl = ref('/static/images/qrcode.png') //
const qrCodeUrl = ref(staticUrl('/static/qrcode.png')) //
const servicePhone = ref('18818818818') //
/** 返回上一页 */
@@ -78,7 +78,7 @@ function handleBack() {
function handleCallPhone() {
uni.makePhoneCall({
phoneNumber: servicePhone.value,
fail: (err) => {
fail: (_err) => {
toast.show('拨打失败')
},
})

View File

@@ -125,12 +125,12 @@ function handleClearCache() {
/** 跳转到用户协议 */
function handleGoAgreement() {
uni.navigateTo({ url: '/pages/user/settings/agreement/index' })
uni.navigateTo({ url: '/pages-core/user/settings/agreement/index' })
}
/** 跳转到隐私协议 */
function handleGoPrivacy() {
uni.navigateTo({ url: '/pages/user/settings/privacy/index' })
uni.navigateTo({ url: '/pages-core/user/settings/privacy/index' })
}
/** 初始化 */

View File

@@ -102,32 +102,32 @@ onMounted(async () => {
/** 跳转到个人资料 */
function handleGoProfile() {
uni.navigateTo({ url: '/pages/user/profile/index' })
uni.navigateTo({ url: '/pages-core/user/profile/index' })
}
/** 跳转到账号安全 */
function handleGoSecurity() {
uni.navigateTo({ url: '/pages/user/security/index' })
uni.navigateTo({ url: '/pages-core/user/security/index' })
}
/** 跳转到常见问题 */
function handleGoFaq() {
uni.navigateTo({ url: '/pages/user/faq/index' })
uni.navigateTo({ url: '/pages-core/user/faq/index' })
}
/** 跳转到意见反馈 */
function handleGoFeedback() {
uni.navigateTo({ url: '/pages/user/feedback/index' })
uni.navigateTo({ url: '/pages-core/user/feedback/index' })
}
/** 跳转联系客服 */
function handleGoContact() {
uni.navigateTo({ url: '/pages/user/contact/index' })
uni.navigateTo({ url: '/pages-core/user/contact/index' })
}
/** 跳转到应用设置 */
function handleGoSettings() {
uni.navigateTo({ url: '/pages/user/settings/index' })
uni.navigateTo({ url: '/pages-core/user/settings/index' })
}
/** 退出登录 */

View File

@@ -9,11 +9,11 @@ export const LOGIN_STRATEGY = LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN // edit by
export const isNeedLoginMode
= LOGIN_STRATEGY === LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN
export const LOGIN_PAGE = '/pages/auth/login' // edit by 芋艿:自定义了登录页路径
export const REGISTER_PAGE = '/pages/auth/register' // edit by 芋艿:自定义了注册页路径
export const CODE_LOGIN_PAGE = '/pages/auth/code-login' // edit by 芋艿:自定义了短信登录页路径
export const FORGET_PASSWORD_PAGE = '/pages/auth/forget-password' // edit by 芋艿:自定义了忘记密码页路径
export const NOT_FOUND_PAGE = '/pages/error/404' // edit by 芋艿:调整 404 页面路径
export const LOGIN_PAGE = '/pages-core/auth/login' // edit by 芋艿:自定义了登录页路径
export const REGISTER_PAGE = '/pages-core/auth/register' // edit by 芋艿:自定义了注册页路径
export const CODE_LOGIN_PAGE = '/pages-core/auth/code-login' // edit by 芋艿:自定义了短信登录页路径
export const FORGET_PASSWORD_PAGE = '/pages-core/auth/forget-password' // edit by 芋艿:自定义了忘记密码页路径
export const NOT_FOUND_PAGE = '/pages-core/error/404' // edit by 芋艿:调整 404 页面路径
// TODO @芋艿:【优化】貌似 unibest 这个变量没用?!
export const LOGIN_PAGE_LIST = [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -73,7 +73,7 @@ export default defineConfig(({ command, mode }) => {
// pages 目录为 src/pages分包目录不能配置在pages目录下
// 是个数组可以配置多个但是不能为pages里面的目录
subPackages: [
'src/pages-fg', // 这个是相对必要的路由尽量留着登录页、注册页、404页等
'src/pages-core', // 这个是相对必要的路由尽量留着登录页、注册页、404页等
'src/pages-system', // “系统管理”模块
'src/pages-infra', // “基础设施”模块
'src/pages-bpm', // “工作流程”模块