token打印测试

This commit is contained in:
francis_fh
2026-01-14 22:02:07 +08:00
parent cc6da8adfd
commit d2653c8394
2 changed files with 13 additions and 10 deletions

View File

@@ -81,9 +81,10 @@
<view class="h5-action-btn press-button" @click="handleServiceClick('resume-creation')"> <view class="h5-action-btn press-button" @click="handleServiceClick('resume-creation')">
<view class="btn-text">简历指导</view> <view class="btn-text">简历指导</view>
</view> </view>
</view> </view>
<!-- #endif --> <!-- #endif -->
<view style="margin-top: 20rpx;padding:0 20px">token:{{myToken}}</view>
<!-- 服务功能网格 --> <!-- 服务功能网格 -->
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
<view class="service-grid" v-if="shouldShowJobSeekerContent"> <view class="service-grid" v-if="shouldShowJobSeekerContent">
@@ -746,6 +747,17 @@ const handleLoginSuccess = () => {
//四级联动单点及权限 //四级联动单点及权限
getIsFourLevelLinkagePurview() getIsFourLevelLinkagePurview()
}; };
const myToken = ref('');
// H5环境下从URL获取token并自动登录
onLoad((options) => {
// #ifdef H5
const token = options.token || '';
myToken.value = token;
if (token) {
useUserStore().loginSetToken(token);
}
// #endif
});
// 处理附近工作点击 // 处理附近工作点击
const handleNearbyClick = () => { const handleNearbyClick = () => {

View File

@@ -23,16 +23,7 @@ import useUserStore from '@/stores/useUserStore';
import { tabbarManager } from '@/utils/tabbarManager'; import { tabbarManager } from '@/utils/tabbarManager';
const { unreadCount } = storeToRefs(useReadMsg()); const { unreadCount } = storeToRefs(useReadMsg());
const userStore = useUserStore(); const userStore = useUserStore();
onLoad((options) => { onLoad((options) => {
// H5环境下从URL获取token并自动登录
// #ifdef H5
const token = options.token || '';
alert(token)
if (token) {
userStore.loginSetToken(token);
}
// #endif
// useReadMsg().fetchMessages(); // useReadMsg().fetchMessages();
}); });