feat: 艳姐对外展示

This commit is contained in:
kenny
2025-11-05 19:34:22 +08:00
parent fb2e1794ca
commit bc74352cd5
2 changed files with 16 additions and 2 deletions
+12 -1
View File
@@ -90,6 +90,9 @@
// import { saveUserInfo } from './api';
import {saveUserInfo} from '@/sheep/api/user'
import { onLoad } from '@dcloudio/uni-app';
import ReportApi from '@/sheep/api/report';
const { getToken } = ReportApi;
const form = ref({
// token: null,
@@ -103,7 +106,15 @@
const token = ref('');
onLoad((e) => {
onLoad(async (e) => {
if (!e.token) {
const res = await getToken();
window.location.href =
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
return;
}
token.value = e.token;
uni.setStorageSync('token', e.token);
});