This commit is contained in:
oneao committed 2026-03-18 21:22:57 +08:00
1 parent 46f6bcc5f8
commit 6c20d0c80d
10 files changed
+194 -17

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ import { useUserStore } from './store'
const userStore = useUserStore()
onLaunch(() => {
userStore.requireLogin()
// userStore.requireLogin()
})
onMounted(() => {
@@ -0,0 +1,49 @@
<script lang="ts" setup>
</script>
<template>
<view class="container">
<view class="item">
<sar-tag theme="primary" mark size="large">
1、集装箱照片
</sar-tag>
<view
style="padding: 32rpx;"
>
<sar-input
placeholder="请输入"
/>
<view />
</view>
</view>
<view class="item">
<sar-tag theme="primary" mark size="large">
2、装货照片
</sar-tag>
</view>
<view class="actions">
<sar-button round>
确定提交
</sar-button>
</view>
</view>
</template>
<style lang="scss" scoped>
.container {
display: flex;
flex-direction: column;
}
.item {
padding: 16rpx 0rpx;
}
.actions {
padding: 36rpx;
margin-top: 32rpx;
}
</style>
+9 -2
View File
@@ -2,8 +2,8 @@
"globalStyle": {
"navigationStyle": "default",
"navigationBarTitleText": "App",
"navigationBarBackgroundColor": "#4d80f0",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black",
"backgroundColor": "#FFFFFF"
},
"easycom": {
@@ -81,6 +81,13 @@
"navigationBarTitleText": "修改密码",
"navigationStyle": "default"
}
},
{
"path": "upload/index",
"style": {
"navigationBarTitleText": "集装箱装货采集",
"navigationStyle": "default"
}
}
]
}
@@ -5,7 +5,7 @@ import { useUserStore } from '@/store'
const userStore = useUserStore()
onShow(() => {
userStore.requireLogin()
// userStore.requireLogin()
})
function handleLoginOut() {
@@ -4,7 +4,7 @@ import { useUserStore } from '@/store'
const userStore = useUserStore()
onShow(() => {
userStore.requireLogin()
// userStore.requireLogin()
})
const swiperCurrent = ref(0)
@@ -8,21 +8,21 @@ export const navigateToInterceptor = {
invoke(args: UniApp.NavigateToOptions) {
const userStore = useUserStore()
// 白名单直接放行
if (whiteList.some(path => args.url.startsWith(path))) {
if (args.url === '/pages-sub/login/index') {
userStore.reset()
}
// // 白名单直接放行
// if (whiteList.some(path => args.url.startsWith(path))) {
// if (args.url === '/pages-sub/login/index') {
// userStore.reset()
// }
return args
}
// return args
// }
// 调用 requireLogin,如果未登录,会自动提示并跳转
const ok = userStore.requireLogin()
// // 调用 requireLogin,如果未登录,会自动提示并跳转
// const ok = userStore.requireLogin()
if (!ok) {
return false // 阻止路由跳转
}
// if (!ok) {
// return false // 阻止路由跳转
// }
return args // 已登录则放行
},