build(mobile): 📦 修改移动端文件的位置和配置

This commit is contained in:
Dawn
2025-02-05 10:56:04 +08:00
parent 2a857e349b
commit 12e81fd30f
7 changed files with 12 additions and 5 deletions

View File

@@ -30,7 +30,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import PullToRefresh from '@/components/mobile/PullToRefresh.vue'
import PullToRefresh from '#/components/PullToRefresh.vue'
const pullRefreshRef = ref()

View File

@@ -122,6 +122,8 @@ export default {
}),
/** 账号密码登录 */
login: (user: LoginUserReq, abort?: AbortController) => POST<string>(urls.login, user, abort),
/** 移动端登录 */
mobileLogin: (user: LoginUserReq, abort?: AbortController) => POST<string>(urls.mobileLogin, user, abort),
/** 退出登录 */
logout: (abort?: AbortController) => POST<string>(urls.logout, abort),
/** 注册 */

View File

@@ -51,6 +51,8 @@ export default {
register: `${prefix + URLEnum.TOKEN}/register`,
// 登录
login: `${prefix + URLEnum.TOKEN}/login`,
// 移动端登录
mobileLogin: `${prefix + URLEnum.TOKEN}/mobileLogin`,
// 退出登录
logout: `${prefix + URLEnum.TOKEN}/logout`,
// 检查token是否有效

View File

@@ -68,7 +68,7 @@ declare module 'vue' {
NTooltip: typeof import('naive-ui')['NTooltip']
NTransfer: typeof import('naive-ui')['NTransfer']
NVirtualList: typeof import('naive-ui')['NVirtualList']
PullToRefresh: typeof import('./../components/mobile/PullToRefresh.vue')['default']
PullToRefresh: typeof import('./../mobile/components/PullToRefresh.vue')['default']
RenderMessage: typeof import('./../components/rightBox/renderMessage/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']

View File

@@ -24,7 +24,8 @@
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"#/*": ["./src/mobile/*"]
},
"types": ["vitest/globals", "@vue/test-utils"],
"allowSyntheticDefaultImports": true,

View File

@@ -17,8 +17,10 @@ export default defineConfig(({ mode }: ConfigEnv) => {
return {
resolve: {
alias: {
// 配置路径别名@
// 配置路径别名@
'@': getSrcPath(),
// 配置移动端路径别名@
'#': getSrcPath('src/mobile'),
// 配置路径别名~(根路径)
'~': getRootPath()
}
@@ -49,7 +51,7 @@ export default defineConfig(({ mode }: ConfigEnv) => {
}),
/**自动导入组件但是不会自动导入jsx和tsx*/
Components({
dirs: ['src/components/**'], // 设置需要扫描的目录
dirs: ['src/components/**', 'src/mobile/components/**'], // 设置需要扫描的目录
resolvers: [NaiveUiResolver()],
dts: 'src/typings/components.d.ts'
}),