From bc74352cd5f682b70ce2e1af668ce6317998e4b9 Mon Sep 17 00:00:00 2001 From: kenny <879464294@qq.com> Date: Wed, 5 Nov 2025 19:34:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=89=B3=E5=A7=90=E5=AF=B9=E5=A4=96?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/base-info/index.vue | 13 ++++++++++++- sheep/store/fittingRoom.js | 5 ++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pages/base-info/index.vue b/pages/base-info/index.vue index 71374d5..dfa520e 100644 --- a/pages/base-info/index.vue +++ b/pages/base-info/index.vue @@ -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); }); diff --git a/sheep/store/fittingRoom.js b/sheep/store/fittingRoom.js index 08f5343..46d426b 100644 --- a/sheep/store/fittingRoom.js +++ b/sheep/store/fittingRoom.js @@ -5,6 +5,9 @@ import sheep from '@/sheep'; const _tabsMap = [undefined, 'topCloth', 'bottomCloth', 'dress', 'suit', 'hair', 'hair']; +const isOpened = window.location.href.includes('open=1'); +console.log('isOpened: ', isOpened); + export const pattern = [ { value: 'body', label: '胸' }, { value: 'waist', label: '腰' }, @@ -27,7 +30,7 @@ const fittingRoom = defineStore({ modelList: [], // 模特列表 currentModel: {}, type: false, // true: 我的衣橱, false: 衣服库 - tab: 6, // 对应下面tabs的序号 + tab: isOpened ? 6: 0, // 对应下面tabs的序号 tabs: ['全部', '上衣', '下装', '连衣裙', '外套', '套装', '发型'], tabsMap: _tabsMap, disableTabs: [6], // 不允许上传图的tab索引