提交 44f10579 作者: 方治民

fix: 替换 APP 打包 logo、引导页跳转逻辑错误等问题

上级 725577fa
# API 接口地址 # API 接口地址
# VITE_GLOB_API_URL=http://111.22.182.169:49600 VITE_GLOB_API_URL=http://111.22.182.169:49600
VITE_GLOB_API_URL=http://36.133.16.81:42111 # VITE_GLOB_API_URL=http://36.133.16.81:42111
# API 接口地址前缀 # API 接口地址前缀
# VITE_GLOB_API_URL_PREFIX=/jeecgboot VITE_GLOB_API_URL_PREFIX=/jeecgboot
VITE_GLOB_API_URL_PREFIX=/jeecg-boot # VITE_GLOB_API_URL_PREFIX=/jeecg-boot
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
}) })
onError((err) => { onError((err) => {
Message.toast(`App Error: ${err}`) // Message.toast(`App Error: ${err}`)
console.error('App Error:', err) console.error('App Error:', err)
}) })
......
...@@ -20,6 +20,8 @@ export function getUserInfo(params = {}) { ...@@ -20,6 +20,8 @@ export function getUserInfo(params = {}) {
return otherHttp.get({ return otherHttp.get({
url: Api.getUserInfo, url: Api.getUserInfo,
data: params, data: params,
}, {
errorMessageMode: null
}) })
} }
......
<script setup lang="ts"> <script setup lang="ts">
// import { PUSH_CLIENT_KEY } from '/@/enums/cacheEnum' // import { PUSH_CLIENT_KEY } from '/@/enums/cacheEnum'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { closeSplashscreenAndChechUpgrade } from '@/utils/upgrade' import { checkUpgrade } from '@/utils/upgrade'
import { isDevMode } from '@/utils/env' import { isDevMode } from '@/utils/env'
import Link from '@/utils/const/link' import Link from '@/utils/const/link'
import * as API from '/@/api/model/userInfo' import * as API from '/@/api/model/userInfo'
...@@ -9,25 +9,9 @@ ...@@ -9,25 +9,9 @@
const userStore = useUserStore() const userStore = useUserStore()
onShow(async () => { onShow(async () => {
// 获取推送标识并设置 PushClientId 缓存
// uni.getPushClientId({
// success: (res) => {
// uni.setStorageSync(PUSH_CLIENT_KEY, res.cid)
// },
// })
// 检查是否有 token // 检查是否有 token
const token = userStore.getToken const token = userStore.getToken
if (token) { if (token) {
// // 检查登录状态
// try {
// const valid = await Auth.valid.request()
// if (valid && userStore.getUserInfo) {
// model.isLogin = true
// }
// } catch (error) {
// console.log('error', error)
// }
model.isLogin = true model.isLogin = true
} }
...@@ -41,7 +25,7 @@ ...@@ -41,7 +25,7 @@
} else { } else {
// 关闭启动页并检查更新 // 关闭启动页并检查更新
try { try {
await closeSplashscreenAndChechUpgrade() await checkUpgrade()
} catch (error) { } catch (error) {
console.log('error', error) console.log('error', error)
} finally { } finally {
...@@ -319,14 +303,14 @@ ...@@ -319,14 +303,14 @@
@change="(e) => (model.form.data.read = e.checked)" @change="(e) => (model.form.data.read = e.checked)"
style="margin-right: 10rpx; width: 32rpx; height: 32rpx; margin-top: 2rpx" style="margin-right: 10rpx; width: 32rpx; height: 32rpx; margin-top: 2rpx"
/> />
<text style="color: #999999;;font-size:28rpx;">已阅读并同意</text> <text style="color: #999;;font-size:28rpx;">已阅读并同意</text>
</fui-label> </fui-label>
<fui-text <fui-text
@tap="Link.to(Link.services, '服务协议')" @tap="Link.to(Link.services, '服务协议')"
size="28rpx" size="28rpx"
text="《服务协议》" text="《服务协议》"
color="#4da25b" color="#4da25b"
/><text style="color: #999999;;font-size:28rpx;"></text> /><text style="color: #999;;font-size:28rpx;"></text>
<fui-text <fui-text
@tap="Link.to(Link.privacy, '隐私政策')" @tap="Link.to(Link.privacy, '隐私政策')"
size="28rpx" size="28rpx"
...@@ -381,6 +365,7 @@ ...@@ -381,6 +365,7 @@
height: calc(100vh); height: calc(100vh);
block-size: 100% 100%; block-size: 100% 100%;
background-color: #fafefc; background-color: #fafefc;
.login_top_bg{ .login_top_bg{
width:750rpx; width:750rpx;
height:1324rpx; height:1324rpx;
...@@ -388,23 +373,28 @@ ...@@ -388,23 +373,28 @@
left:0rpx; left:0rpx;
top:0rpx; top:0rpx;
} }
.login_top_warp{ .login_top_warp{
width:750rpx; width:750rpx;
height:482rpx; height:482rpx;
position: relative; position: relative;
.login_hello{ .login_hello{
position: absolute; position: absolute;
left: 50rpx; left: 50rpx;
top: 226rpx; top: 226rpx;
color: rgba(51, 51, 51, 1); color: rgb(51 51 51 / 100%);
.text_hello{ .text_hello{
font-size: 32rpx; font-size: 32rpx;
font-weight: 400; font-weight: 400;
letter-spacing: 0rpx; letter-spacing: 0rpx;
line-height: 40rpx; line-height: 40rpx;
} }
.login_server_name{ .login_server_name{
margin-top:32rpx; margin-top:32rpx;
.text_server_name{ .text_server_name{
font-size: 40rpx; font-size: 40rpx;
font-weight: 500; font-weight: 500;
...@@ -420,36 +410,43 @@ ...@@ -420,36 +410,43 @@
justify-content: center; justify-content: center;
flex-wrap:wrap; flex-wrap:wrap;
position: relative; position: relative;
.login-input-area{ .login-input-area{
width: 650rpx; width: 650rpx;
// border:1rpx red solid; // border:1rpx red solid;
.user_phone{ .user_phone{
display:flex; display:flex;
align-items: center; align-items: center;
.user_phone_img{ .user_phone_img{
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
} }
.user_text_view{ .user_text_view{
margin-left:12rpx; margin-left:12rpx;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
.view_text{ .view_text{
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
letter-spacing: 0rpx; letter-spacing: 0rpx;
color: rgba(51, 51, 51, 1); color: rgb(51 51 51 / 100%);
} }
} }
.input-bottom-border{ .input-bottom-border{
border-bottom: 2rpx #eeeeee solid; border-bottom: 2rpx #eee solid;
} }
.mt50{ .mt50{
margin-top:50rpx; margin-top:50rpx;
} }
} }
} }
.submit_btn_view{ .submit_btn_view{
margin-top:120rpx; margin-top:120rpx;
width:650rpx; width:650rpx;
......
<script setup lang="ts"> <script setup lang="ts">
// import { onMounted, onUnmounted, ref } from 'vue' // import { onMounted, onUnmounted, ref } from 'vue'
import { getQueryByType } from '/@/api/model/dict' import { getQueryByType } from '/@/api/model/dict'
import { useUserStore } from '@/store/modules/user'
const mediaUrl = ref('') const mediaUrl = ref('')
const seconds = ref(4) const seconds = ref(4)
let timer = null let timer = null
onLoad(() => {
getServiceItems() const userStore = useUserStore()
const model = reactive({
isLogin: false,
show: false,
})
onLoad(async () => {
try {
await getServiceItems()
} finally {
// #ifdef APP-PLUS
plus.navigator.closeSplashscreen()
// #endif
}
})
async function navigateToLogin() {
// 检查是否有 token
const token = userStore.getToken
if (token) {
model.isLogin = true
}
try {
if (model.isLogin) {
// 刷新用户信息
await userStore.refreshUserInfo()
// 跳转到登录页
goHome()
Message.toast(`欢迎回来~`)
} else {
// 跳转到登录页
toLogin()
}
} catch (error) {
// 跳转到登录页
toLogin()
}
}
/**
* 跳转到门户页
*/
function goHome() {
uni.reLaunch({
url: '/pages/shouye/shouye',
})
}
/**
* 跳转到登录页
*/
function toLogin() {
uni.reLaunch({
url: '/pages/login/login',
}) })
}
onMounted(() => { onMounted(() => {
countdown() countdown()
}) })
onUnmounted(() => { onUnmounted(() => {
clearTimerInterval() clearTimerInterval()
}) })
function clearTimerInterval() { function clearTimerInterval() {
clearInterval(timer) clearInterval(timer)
} }
function getServiceItems() { function getServiceItems() {
getQueryByType({ type: 2 }).then((res) => { return getQueryByType({ type: 2 }).then((res) => {
mediaUrl.value = res[0].mediaUrl mediaUrl.value = res[0].mediaUrl
}) })
} }
...@@ -32,11 +91,6 @@ ...@@ -32,11 +91,6 @@
} }
}, 1000) }, 1000)
} }
function navigateToLogin() {
uni.redirectTo({
url: '/pages/login/login',
})
}
</script> </script>
<template> <template>
...@@ -76,10 +130,12 @@ ...@@ -76,10 +130,12 @@
height: 100vh; height: 100vh;
width: 750rpx; width: 750rpx;
position: relative; position: relative;
.splash_bg { .splash_bg {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
} }
.middle_logo_content { .middle_logo_content {
position: absolute; position: absolute;
top: 250rpx; top: 250rpx;
...@@ -88,6 +144,7 @@ ...@@ -88,6 +144,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.logo_view { .logo_view {
width: 136rpx; width: 136rpx;
height: 136rpx; height: 136rpx;
...@@ -96,36 +153,43 @@ ...@@ -96,36 +153,43 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.splash_logo { .splash_logo {
width: 110rpx; width: 110rpx;
height: 110rpx; height: 110rpx;
} }
} }
.logo_text_bg { .logo_text_bg {
margin-top: 32rpx; margin-top: 32rpx;
width: 192rpx; width: 192rpx;
height: 64rpx; height: 64rpx;
} }
.server_text_bg { .server_text_bg {
width: 528rpx; width: 528rpx;
height: 116rpx; height: 116rpx;
} }
.outline_bg { .outline_bg {
margin-top: -36rpx; margin-top: -36rpx;
width: 464rpx; width: 464rpx;
height: 54rpx; height: 54rpx;
} }
} }
.countdown_view { .countdown_view {
position: absolute; position: absolute;
left: 612rpx; left: 612rpx;
top: 118rpx; top: 118rpx;
width: 108rpx; width: 108rpx;
height: 52rpx; height: 52rpx;
.shadow_img { .shadow_img {
width: 108rpx; width: 108rpx;
height: 52rpx; height: 52rpx;
} }
.countdown_val { .countdown_val {
width: 108rpx; width: 108rpx;
height: 52rpx; height: 52rpx;
......
unpackage/res/icons/1024x1024.png

180.3 KB | W: | H:

unpackage/res/icons/1024x1024.png

104.0 KB | W: | H:

unpackage/res/icons/1024x1024.png
unpackage/res/icons/1024x1024.png
unpackage/res/icons/1024x1024.png
unpackage/res/icons/1024x1024.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/120x120.png

12.3 KB | W: | H:

unpackage/res/icons/120x120.png

7.9 KB | W: | H:

unpackage/res/icons/120x120.png
unpackage/res/icons/120x120.png
unpackage/res/icons/120x120.png
unpackage/res/icons/120x120.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/144x144.png

16.8 KB | W: | H:

unpackage/res/icons/144x144.png

9.9 KB | W: | H:

unpackage/res/icons/144x144.png
unpackage/res/icons/144x144.png
unpackage/res/icons/144x144.png
unpackage/res/icons/144x144.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/152x152.png

18.4 KB | W: | H:

unpackage/res/icons/152x152.png

10.6 KB | W: | H:

unpackage/res/icons/152x152.png
unpackage/res/icons/152x152.png
unpackage/res/icons/152x152.png
unpackage/res/icons/152x152.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/167x167.png

21.6 KB | W: | H:

unpackage/res/icons/167x167.png

11.9 KB | W: | H:

unpackage/res/icons/167x167.png
unpackage/res/icons/167x167.png
unpackage/res/icons/167x167.png
unpackage/res/icons/167x167.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/180x180.png

24.4 KB | W: | H:

unpackage/res/icons/180x180.png

13.1 KB | W: | H:

unpackage/res/icons/180x180.png
unpackage/res/icons/180x180.png
unpackage/res/icons/180x180.png
unpackage/res/icons/180x180.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/192x192.png

27.3 KB | W: | H:

unpackage/res/icons/192x192.png

14.2 KB | W: | H:

unpackage/res/icons/192x192.png
unpackage/res/icons/192x192.png
unpackage/res/icons/192x192.png
unpackage/res/icons/192x192.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/20x20.png

851 Bytes | W: | H:

unpackage/res/icons/20x20.png

873 Bytes | W: | H:

unpackage/res/icons/20x20.png
unpackage/res/icons/20x20.png
unpackage/res/icons/20x20.png
unpackage/res/icons/20x20.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/29x29.png

1.4 KB | W: | H:

unpackage/res/icons/29x29.png

1.3 KB | W: | H:

unpackage/res/icons/29x29.png
unpackage/res/icons/29x29.png
unpackage/res/icons/29x29.png
unpackage/res/icons/29x29.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/40x40.png

2.2 KB | W: | H:

unpackage/res/icons/40x40.png

2.0 KB | W: | H:

unpackage/res/icons/40x40.png
unpackage/res/icons/40x40.png
unpackage/res/icons/40x40.png
unpackage/res/icons/40x40.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/58x58.png

3.8 KB | W: | H:

unpackage/res/icons/58x58.png

3.1 KB | W: | H:

unpackage/res/icons/58x58.png
unpackage/res/icons/58x58.png
unpackage/res/icons/58x58.png
unpackage/res/icons/58x58.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/60x60.png

4.0 KB | W: | H:

unpackage/res/icons/60x60.png

3.2 KB | W: | H:

unpackage/res/icons/60x60.png
unpackage/res/icons/60x60.png
unpackage/res/icons/60x60.png
unpackage/res/icons/60x60.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/72x72.png

5.4 KB | W: | H:

unpackage/res/icons/72x72.png

4.1 KB | W: | H:

unpackage/res/icons/72x72.png
unpackage/res/icons/72x72.png
unpackage/res/icons/72x72.png
unpackage/res/icons/72x72.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/76x76.png

5.8 KB | W: | H:

unpackage/res/icons/76x76.png

4.4 KB | W: | H:

unpackage/res/icons/76x76.png
unpackage/res/icons/76x76.png
unpackage/res/icons/76x76.png
unpackage/res/icons/76x76.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/80x80.png

6.4 KB | W: | H:

unpackage/res/icons/80x80.png

4.8 KB | W: | H:

unpackage/res/icons/80x80.png
unpackage/res/icons/80x80.png
unpackage/res/icons/80x80.png
unpackage/res/icons/80x80.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/87x87.png

7.3 KB | W: | H:

unpackage/res/icons/87x87.png

5.3 KB | W: | H:

unpackage/res/icons/87x87.png
unpackage/res/icons/87x87.png
unpackage/res/icons/87x87.png
unpackage/res/icons/87x87.png
  • 2-up
  • Swipe
  • Onion skin
unpackage/res/icons/96x96.png

8.6 KB | W: | H:

unpackage/res/icons/96x96.png

6.1 KB | W: | H:

unpackage/res/icons/96x96.png
unpackage/res/icons/96x96.png
unpackage/res/icons/96x96.png
unpackage/res/icons/96x96.png
  • 2-up
  • Swipe
  • Onion skin
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论