fix: use onShow lifecycle to refresh login state in member center
1. member.vue: added onShow to refresh login state when returning from login page 2. manifest.json: bump to v1.0.15 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "宇之然AI磁场",
|
"name": "宇之然AI磁场",
|
||||||
"appid": "__UNI__DEV__",
|
"appid": "__UNI__DEV__",
|
||||||
"versionName": "1.0.14",
|
"versionName": "1.0.15",
|
||||||
"versionCode": "114",
|
"versionCode": "115",
|
||||||
"description": "职引 - 宇之然AI磁场旗下AI模拟面试平台,提供AI面试官模拟练习、简历智能优化、大厂面经题库,助你轻松应对校招面试。",
|
"description": "职引 - 宇之然AI磁场旗下AI模拟面试平台,提供AI面试官模拟练习、简历智能优化、大厂面经题库,助你轻松应对校招面试。",
|
||||||
"h5": {
|
"h5": {
|
||||||
"title": "职引 - AI模拟面试 | 宇之然AI磁场",
|
"title": "职引 - AI模拟面试 | 宇之然AI磁场",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick } from 'vue'
|
import { ref, onMounted, nextTick } from 'vue'
|
||||||
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
import { api } from '../../config'
|
import { api } from '../../config'
|
||||||
import UQRCode from 'uqrcodejs'
|
import UQRCode from 'uqrcodejs'
|
||||||
|
|
||||||
@@ -112,13 +113,16 @@ const sprintFeatures = ref(['成长版全部权益', 'AI 语音分析(语气
|
|||||||
|
|
||||||
const token = () => uni.getStorageSync('token') || ''
|
const token = () => uni.getStorageSync('token') || ''
|
||||||
|
|
||||||
onMounted(async () => {
|
const refreshState = async () => {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
isMp.value = true
|
isMp.value = true
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
const t = token()
|
const t = token()
|
||||||
if (!t) return
|
if (!t) {
|
||||||
|
isLoggedIn.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
isLoggedIn.value = true
|
isLoggedIn.value = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -146,7 +150,10 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) { /* ignore */ }
|
} catch (e) { /* ignore */ }
|
||||||
})
|
}
|
||||||
|
|
||||||
|
onMounted(() => { refreshState() })
|
||||||
|
onShow(() => { refreshState() })
|
||||||
|
|
||||||
const goLogin = () => uni.navigateTo({ url: '/pages/login/login' })
|
const goLogin = () => uni.navigateTo({ url: '/pages/login/login' })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user