无感登录修改
This commit is contained in:
1 parent
91ecc48fdd
commit
44627cdc55
5 files changed
+85
-63
No files matched your search
@@ -12,7 +12,7 @@
|
||||
<view class="m-l-30rpx" v-if="state.userInfo?.sysUser?.userId">
|
||||
<view class="flex-row items-center">
|
||||
<text class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</text>
|
||||
<text class="iconfont icon-youjiantou color-#666666 m-l-20rpx"></text>
|
||||
<!-- <text class="iconfont icon-youjiantou color-#666666 m-l-20rpx"></text> -->
|
||||
</view>
|
||||
<text class="sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</text>
|
||||
</view>
|
||||
@@ -202,7 +202,8 @@ onLoad(() => {
|
||||
icon: "/static/icon/login.png",
|
||||
router: "/pages/test/login",
|
||||
})
|
||||
: checkAppInfo()
|
||||
: ""
|
||||
// checkAppInfo()
|
||||
})
|
||||
onShow(() => {
|
||||
getStorageUserInfo()
|
||||
|
||||
@@ -145,8 +145,10 @@ const doRefund = (v: any) => {
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="['5', '10'].includes(v.orderStatus)" class="flex-row items-center justify-end p-t-20rpx">
|
||||
<view v-if="v.orderStatus == 5 && v.orderType == 2" class="botder_btn" @tap.stop="doRefund(v)">退款 </view>
|
||||
<view v-if="v.orderStatus == 5 && v.orderType == 2" class="m-l-20rpx botder_btn" @tap.stop="doToDetail(v)"> 核销码 </view>
|
||||
<view v-if="false && v.orderStatus == 5 && v.orderType == 2" class="botder_btn" @tap.stop="doRefund(v)">退款</view>
|
||||
<view v-if="false && v.orderStatus == 5 && v.orderType == 2" class="m-l-20rpx botder_btn" @tap.stop="doToDetail(v)">
|
||||
核销码
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</z-paging>
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
<script setup>
|
||||
import { defineProps, computed } from 'vue'
|
||||
import { router } from '@@/index'
|
||||
import { defineProps, computed } from "vue"
|
||||
import { router } from "@@/index"
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题'
|
||||
},
|
||||
titleColor: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: 'white'
|
||||
},
|
||||
showLeft: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
title: {
|
||||
type: String,
|
||||
default: "标题",
|
||||
},
|
||||
titleColor: {
|
||||
type: String,
|
||||
default: "#333",
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: "white",
|
||||
},
|
||||
showLeft: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
||||
const isHistiry = computed(() => {
|
||||
return router.hasHistory()
|
||||
return router.hasHistory()
|
||||
})
|
||||
|
||||
const isTabbar = computed(() => {
|
||||
return router.hasTabbar()
|
||||
return router.hasTabbar()
|
||||
})
|
||||
|
||||
function doBackClick() {
|
||||
router.back()
|
||||
router.back()
|
||||
}
|
||||
|
||||
function getNavTop() {
|
||||
const { statusBarHeight } = uni.getSystemInfoSync();
|
||||
return `${statusBarHeight}px`
|
||||
const { statusBarHeight } = uni.getSystemInfoSync()
|
||||
return `${statusBarHeight}px`
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="navbar" :style="{ top: getNavTop() }">
|
||||
<view class="navbar_center" v-if="showLeft && !isTabbar" @tap="doBackClick">
|
||||
<text class="sicon-back icon" v-if="isHistiry" />
|
||||
<text class="sicon-home icon" v-else />
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="false" class="navbar" :style="{ top: getNavTop() }">
|
||||
<view class="navbar_center" v-if="showLeft && !isTabbar" @tap="doBackClick">
|
||||
<text class="sicon-back icon" v-if="isHistiry" />
|
||||
<text class="sicon-home icon" v-else />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
left: 20rpx;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&_center {
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08), 0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12);
|
||||
border-radius: 28rpx;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 100;
|
||||
&_center {
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 4rpx rgba(51, 51, 51, 0.08), 0px 4rpx 6rpx 2rpx rgba(102, 102, 102, 0.12);
|
||||
border-radius: 28rpx;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 100;
|
||||
|
||||
&>.icon {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
& > .icon {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,24 +1,24 @@
|
||||
<script setup>
|
||||
import { defineProps, computed } from 'vue'
|
||||
import { router } from '@@/index'
|
||||
import { defineProps, computed } from "vue"
|
||||
import { router } from "@@/index"
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题'
|
||||
default: "标题",
|
||||
},
|
||||
titleColor: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
default: "#333",
|
||||
},
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: 'white'
|
||||
default: "white",
|
||||
},
|
||||
showLeft: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
||||
const isHistiry = computed(() => {
|
||||
@@ -32,11 +32,10 @@ const isTabbar = computed(() => {
|
||||
function doBackClick() {
|
||||
router.back()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="navbar" :style="{ backgroundColor: bgColor, height: '44px' }">
|
||||
<view v-if="false" class="navbar" :style="{ backgroundColor: bgColor, height: '44px' }">
|
||||
<view class="navbar_left" v-if="showLeft && !isTabbar" @tap="doBackClick">
|
||||
<text class="sicon-back icon" v-if="isHistiry" />
|
||||
<text class="sicon-home icon" v-else />
|
||||
|
||||
@@ -250,6 +250,26 @@ http.interceptors.response.use(
|
||||
// 成功提示
|
||||
responseHelpers.handleSuccessMessage(response)
|
||||
|
||||
if (isEmpty(uni.getStorageSync(TOKEN_KEY))) {
|
||||
const params = new URL(window.location.href).searchParams
|
||||
const token = params.get("uabaseToken")
|
||||
if (token) {
|
||||
try {
|
||||
userApi.auth(token).then(async (res) => {
|
||||
if (res?.code === 0) {
|
||||
uni.setStorageSync(TOKEN_KEY, res.data)
|
||||
const { data: userData } = await userApi.userInfo()
|
||||
uni.setStorageSync(USER_INFO_KEY, userData)
|
||||
} else {
|
||||
uni.showToast({ title: "获取浙政钉用户信息失败", icon: "none" })
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
uni.showToast({ title: "错误", icon: "none" })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 登录过期处理
|
||||
if (response.data.code === 1) {
|
||||
responseHelpers.handleLoginExpired()
|
||||
|
||||
Reference in new issue
Block a user