H5环境登录改造

This commit is contained in:
francis_fh
2026-01-14 18:46:13 +08:00
parent daa2ce254a
commit cc6da8adfd
2 changed files with 12 additions and 2 deletions

View File

@@ -19,10 +19,20 @@ import IndexOne from './components/index-one.vue';
// import IndexTwo from './components/index-two.vue';
import { storeToRefs } from 'pinia';
import { useReadMsg } from '@/stores/useReadMsg';
import useUserStore from '@/stores/useUserStore';
import { tabbarManager } from '@/utils/tabbarManager';
const { unreadCount } = storeToRefs(useReadMsg());
const userStore = useUserStore();
onLoad(() => {
onLoad((options) => {
// H5环境下从URL获取token并自动登录
// #ifdef H5
const token = options.token || '';
alert(token)
if (token) {
userStore.loginSetToken(token);
}
// #endif
// useReadMsg().fetchMessages();
});

View File

@@ -194,7 +194,7 @@ const handleLogin = async () => {
icon: 'success'
})
// window.location.assign('http://222.80.110.161:11111/mechine-dual-vue/login')
window.location.assign('https://www.xjksly.cn/mechine-single-vue/login')
// window.location.assign('https://www.xjksly.cn/mechine-single-vue/login')
// // 跳转到首页
// uni.reLaunch({
// url: '/pages/index/index'