feat:将 pages 非 tabbar 页面,全部迁移到 pages-core,降低主包大小
This commit is contained in:
@@ -54,7 +54,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { useToast } from 'wot-design-uni'
|
import { useToast } from 'wot-design-uni'
|
||||||
import { Verify } from '@/components/verifition'
|
|
||||||
import { FORGET_PASSWORD_PAGE, LOGIN_PAGE } from '@/router/config'
|
import { FORGET_PASSWORD_PAGE, LOGIN_PAGE } from '@/router/config'
|
||||||
import { useTokenStore } from '@/store/token'
|
import { useTokenStore } from '@/store/token'
|
||||||
import { ensureDecodeURIComponent, redirectAfterLogin } from '@/utils'
|
import { ensureDecodeURIComponent, redirectAfterLogin } from '@/utils'
|
||||||
@@ -62,6 +61,7 @@ import { isMobile } from '@/utils/validator'
|
|||||||
import CodeInput from './components/code-input.vue'
|
import CodeInput from './components/code-input.vue'
|
||||||
import Header from './components/header.vue'
|
import Header from './components/header.vue'
|
||||||
import TenantPicker from './components/tenant-picker.vue'
|
import TenantPicker from './components/tenant-picker.vue'
|
||||||
|
import { Verify } from './components/verifition'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'SmsLoginPage',
|
name: 'SmsLoginPage',
|
||||||
@@ -82,7 +82,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { useToast } from 'wot-design-uni'
|
import { useToast } from 'wot-design-uni'
|
||||||
import { Verify } from '@/components/verifition'
|
|
||||||
import {
|
import {
|
||||||
CODE_LOGIN_PAGE,
|
CODE_LOGIN_PAGE,
|
||||||
FORGET_PASSWORD_PAGE,
|
FORGET_PASSWORD_PAGE,
|
||||||
@@ -92,6 +91,7 @@ import { useTokenStore } from '@/store/token'
|
|||||||
import { ensureDecodeURIComponent, redirectAfterLogin } from '@/utils'
|
import { ensureDecodeURIComponent, redirectAfterLogin } from '@/utils'
|
||||||
import Header from './components/header.vue'
|
import Header from './components/header.vue'
|
||||||
import TenantPicker from './components/tenant-picker.vue'
|
import TenantPicker from './components/tenant-picker.vue'
|
||||||
|
import { Verify } from './components/verifition'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'LoginPage',
|
name: 'LoginPage',
|
||||||
@@ -94,12 +94,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { useToast } from 'wot-design-uni'
|
import { useToast } from 'wot-design-uni'
|
||||||
import { Verify } from '@/components/verifition'
|
|
||||||
import { LOGIN_PAGE } from '@/router/config'
|
import { LOGIN_PAGE } from '@/router/config'
|
||||||
import { useTokenStore } from '@/store/token'
|
import { useTokenStore } from '@/store/token'
|
||||||
import { redirectAfterLogin } from '@/utils'
|
import { redirectAfterLogin } from '@/utils'
|
||||||
import Header from './components/header.vue'
|
import Header from './components/header.vue'
|
||||||
import TenantPicker from './components/tenant-picker.vue'
|
import TenantPicker from './components/tenant-picker.vue'
|
||||||
|
import { Verify } from './components/verifition'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'RegisterPage',
|
name: 'RegisterPage',
|
||||||
@@ -197,12 +197,12 @@ function goToLogin() {
|
|||||||
|
|
||||||
/** 跳转到用户协议 */
|
/** 跳转到用户协议 */
|
||||||
function goToUserAgreement() {
|
function goToUserAgreement() {
|
||||||
uni.navigateTo({ url: '/pages/user/settings/agreement/index' })
|
uni.navigateTo({ url: '/pages-core/user/settings/agreement/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到隐私政策 */
|
/** 跳转到隐私政策 */
|
||||||
function goToPrivacyPolicy() {
|
function goToPrivacyPolicy() {
|
||||||
uni.navigateTo({ url: '/pages/user/settings/privacy/index' })
|
uni.navigateTo({ url: '/pages-core/user/settings/privacy/index' })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useToast } from 'wot-design-uni'
|
import { useToast } from 'wot-design-uni'
|
||||||
import { navigateBackPlus } from '@/utils'
|
import { navigateBackPlus } from '@/utils'
|
||||||
import { saveImageToAlbum } from '@/utils/download'
|
import { saveImageToAlbum, staticUrl } from '@/utils/download'
|
||||||
|
|
||||||
definePage({
|
definePage({
|
||||||
style: {
|
style: {
|
||||||
@@ -66,7 +66,7 @@ definePage({
|
|||||||
|
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const qrCodeUrl = ref('/static/images/qrcode.png') // 客服二维码图片地址
|
const qrCodeUrl = ref(staticUrl('/static/qrcode.png')) // 客服二维码图片地址
|
||||||
const servicePhone = ref('18818818818') // 客服电话号码
|
const servicePhone = ref('18818818818') // 客服电话号码
|
||||||
|
|
||||||
/** 返回上一页 */
|
/** 返回上一页 */
|
||||||
@@ -78,7 +78,7 @@ function handleBack() {
|
|||||||
function handleCallPhone() {
|
function handleCallPhone() {
|
||||||
uni.makePhoneCall({
|
uni.makePhoneCall({
|
||||||
phoneNumber: servicePhone.value,
|
phoneNumber: servicePhone.value,
|
||||||
fail: (err) => {
|
fail: (_err) => {
|
||||||
toast.show('拨打失败')
|
toast.show('拨打失败')
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -125,12 +125,12 @@ function handleClearCache() {
|
|||||||
|
|
||||||
/** 跳转到用户协议 */
|
/** 跳转到用户协议 */
|
||||||
function handleGoAgreement() {
|
function handleGoAgreement() {
|
||||||
uni.navigateTo({ url: '/pages/user/settings/agreement/index' })
|
uni.navigateTo({ url: '/pages-core/user/settings/agreement/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到隐私协议 */
|
/** 跳转到隐私协议 */
|
||||||
function handleGoPrivacy() {
|
function handleGoPrivacy() {
|
||||||
uni.navigateTo({ url: '/pages/user/settings/privacy/index' })
|
uni.navigateTo({ url: '/pages-core/user/settings/privacy/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
@@ -102,32 +102,32 @@ onMounted(async () => {
|
|||||||
|
|
||||||
/** 跳转到个人资料 */
|
/** 跳转到个人资料 */
|
||||||
function handleGoProfile() {
|
function handleGoProfile() {
|
||||||
uni.navigateTo({ url: '/pages/user/profile/index' })
|
uni.navigateTo({ url: '/pages-core/user/profile/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到账号安全 */
|
/** 跳转到账号安全 */
|
||||||
function handleGoSecurity() {
|
function handleGoSecurity() {
|
||||||
uni.navigateTo({ url: '/pages/user/security/index' })
|
uni.navigateTo({ url: '/pages-core/user/security/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到常见问题 */
|
/** 跳转到常见问题 */
|
||||||
function handleGoFaq() {
|
function handleGoFaq() {
|
||||||
uni.navigateTo({ url: '/pages/user/faq/index' })
|
uni.navigateTo({ url: '/pages-core/user/faq/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到意见反馈 */
|
/** 跳转到意见反馈 */
|
||||||
function handleGoFeedback() {
|
function handleGoFeedback() {
|
||||||
uni.navigateTo({ url: '/pages/user/feedback/index' })
|
uni.navigateTo({ url: '/pages-core/user/feedback/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转联系客服 */
|
/** 跳转联系客服 */
|
||||||
function handleGoContact() {
|
function handleGoContact() {
|
||||||
uni.navigateTo({ url: '/pages/user/contact/index' })
|
uni.navigateTo({ url: '/pages-core/user/contact/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 跳转到应用设置 */
|
/** 跳转到应用设置 */
|
||||||
function handleGoSettings() {
|
function handleGoSettings() {
|
||||||
uni.navigateTo({ url: '/pages/user/settings/index' })
|
uni.navigateTo({ url: '/pages-core/user/settings/index' })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 退出登录 */
|
/** 退出登录 */
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ export const LOGIN_STRATEGY = LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN // edit by
|
|||||||
export const isNeedLoginMode
|
export const isNeedLoginMode
|
||||||
= LOGIN_STRATEGY === LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN
|
= LOGIN_STRATEGY === LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN
|
||||||
|
|
||||||
export const LOGIN_PAGE = '/pages/auth/login' // edit by 芋艿:自定义了登录页路径
|
export const LOGIN_PAGE = '/pages-core/auth/login' // edit by 芋艿:自定义了登录页路径
|
||||||
export const REGISTER_PAGE = '/pages/auth/register' // edit by 芋艿:自定义了注册页路径
|
export const REGISTER_PAGE = '/pages-core/auth/register' // edit by 芋艿:自定义了注册页路径
|
||||||
export const CODE_LOGIN_PAGE = '/pages/auth/code-login' // edit by 芋艿:自定义了短信登录页路径
|
export const CODE_LOGIN_PAGE = '/pages-core/auth/code-login' // edit by 芋艿:自定义了短信登录页路径
|
||||||
export const FORGET_PASSWORD_PAGE = '/pages/auth/forget-password' // edit by 芋艿:自定义了忘记密码页路径
|
export const FORGET_PASSWORD_PAGE = '/pages-core/auth/forget-password' // edit by 芋艿:自定义了忘记密码页路径
|
||||||
export const NOT_FOUND_PAGE = '/pages/error/404' // edit by 芋艿:调整 404 页面路径
|
export const NOT_FOUND_PAGE = '/pages-core/error/404' // edit by 芋艿:调整 404 页面路径
|
||||||
|
|
||||||
// TODO @芋艿:【优化】貌似 unibest 这个变量没用?!
|
// TODO @芋艿:【优化】貌似 unibest 这个变量没用?!
|
||||||
export const LOGIN_PAGE_LIST = [
|
export const LOGIN_PAGE_LIST = [
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB |
@@ -73,7 +73,7 @@ export default defineConfig(({ command, mode }) => {
|
|||||||
// pages 目录为 src/pages,分包目录不能配置在pages目录下!!
|
// pages 目录为 src/pages,分包目录不能配置在pages目录下!!
|
||||||
// 是个数组,可以配置多个,但是不能为pages里面的目录!!
|
// 是个数组,可以配置多个,但是不能为pages里面的目录!!
|
||||||
subPackages: [
|
subPackages: [
|
||||||
'src/pages-fg', // 这个是相对必要的路由,尽量留着(登录页、注册页、404页等)
|
'src/pages-core', // 这个是相对必要的路由,尽量留着(登录页、注册页、404页等)
|
||||||
'src/pages-system', // “系统管理”模块
|
'src/pages-system', // “系统管理”模块
|
||||||
'src/pages-infra', // “基础设施”模块
|
'src/pages-infra', // “基础设施”模块
|
||||||
'src/pages-bpm', // “工作流程”模块
|
'src/pages-bpm', // “工作流程”模块
|
||||||
|
|||||||
Reference in New Issue
Block a user