From e08f9d4b8e3ae61b3c3d0323a6ea3c93c379c371 Mon Sep 17 00:00:00 2001 From: "liu.huiying@ebiz-digits.com" Date: Fri, 14 Mar 2025 13:26:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:app=E5=B5=8C=E5=A5=97h5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/App.vue | 4 ++-- src/layouts/index.vue | 8 ++++---- src/main.ts | 9 +++++++++ .../components/Questions/MartrixQuestion.vue | 16 ++++++++-------- src/views/Home/Index.vue | 6 +++--- src/views/Survey/views/Publish/Index.vue | 6 +++++- 7 files changed, 32 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 3353ec6..35fa21a 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "sortablejs": "^1.15.6", "uuid": "^11.1.0", "vant": "^4.9.17", + "vconsole": "^3.15.1", "vite-plugin-vue": "^0.0.1", "vue": "^3.4.29", "vue-router": "^4.3.3", diff --git a/src/App.vue b/src/App.vue index 5bb4f10..9ff630b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,9 +5,9 @@ import appBridge from '@/assets/js/appBridge'; import utils from '@/assets/js/common'; onMounted(async() => { - if (utils.getParameter('digitalYiliToken')) { + if (utils.getSessionStorage('xToken')) { // 隐藏/显示 header - appBridge.setHeaderShown(false); + appBridge.setHeaderShown(true); // 设置系统状态栏明暗主题 appBridge.setStatusBarStyle('light'); // 设置禁止原生返回 diff --git a/src/layouts/index.vue b/src/layouts/index.vue index 84ba231..8248987 100644 --- a/src/layouts/index.vue +++ b/src/layouts/index.vue @@ -55,10 +55,10 @@ const table = [ ]; function tabPath(path) { router.push({ - path - }); - // if (utils.getParameter('digitalYiliToken')) { - // const appToken = utils.getParameter('digitalYiliToken'); + path + }); + // if (utils.getSessionStorage('xToken')) + // const appToken = utils.getSessionStorage('xToken') // getUserInfo(appToken).then((res) => { // if (res.data) { // utils.setSessionStorage('userInfo', res.data.data); diff --git a/src/main.ts b/src/main.ts index d400568..154de2b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,10 +4,19 @@ import { createApp } from 'vue'; import { createPinia } from 'pinia'; import App from './App.vue'; import router from './router'; +import utils from '@/assets/js/common'; // 2. 引入组件样式 import 'vant/lib/index.css'; import appBridge from '@/assets/js/appBridge'; +import VConsole from 'vconsole'; +let vconsole; +if (import.meta.env.VITE_APP_ENV !== 'production') { + vconsole = new VConsole(); +} router.beforeEach((to, from, next) => { + if (to.query.digitalYiliToken) { + utils.setSessionStorage('xToken', to.query.digitalYiliToken); + } appBridge.setTitle(to.meta.title as string); next(); }); diff --git a/src/views/Design/components/Questions/MartrixQuestion.vue b/src/views/Design/components/Questions/MartrixQuestion.vue index 45e068e..8687663 100644 --- a/src/views/Design/components/Questions/MartrixQuestion.vue +++ b/src/views/Design/components/Questions/MartrixQuestion.vue @@ -21,14 +21,14 @@ const { element } = toRefs(props); */ const tableInputTypeMapping = (/** regx?: any */) => { switch (element.value.question_type) { - case 8: - return 'text'; - case 9: - return 'radio'; - case 10: - return 'checkbox'; - default: - return 'radio'; + case 8: + return 'text'; + case 9: + return 'radio'; + case 10: + return 'checkbox'; + default: + return 'radio'; } }; diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index d2906f9..639603c 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -9,7 +9,7 @@ import { showFailToast } from 'vant'; const contentShow = ref(false); onMounted(async() => { contentShow.value = true; - // if (utils.getParameter('digitalYiliToken')) { + // if (utils.getSessionStorage('xToken')){ // const appToken = utils.getParameter('digitalYiliToken'); // getUserInfo(appToken).then((res) => { // if (res.data) { @@ -46,13 +46,13 @@ onMounted(async() => { padding: 0 10px 60px; background: linear-gradient(0deg, #f5f5f5 0%, #f5f5f5 84%, #a5d380 100%); - & > :first-child { + &> :first-child { display: flex; justify-content: space-around; border-radius: 6px; background-color: white; - & > div { + &>div { display: flex; flex-direction: column; width: 50px; diff --git a/src/views/Survey/views/Publish/Index.vue b/src/views/Survey/views/Publish/Index.vue index 957f686..69589a1 100644 --- a/src/views/Survey/views/Publish/Index.vue +++ b/src/views/Survey/views/Publish/Index.vue @@ -112,8 +112,12 @@ async function openPublishModal() { function getCode() { console.log(56, configUrl.proxyUrl); + const _idp_session = 'MTE3LjEzLjEyMi4xODQ=|Y2UxNmU4ZGRhYmMyYjQyNDc3Y2NhOWY4Y2I0YTdlNjVkOGVmNWZiYWVkODMzYTQyNGQyMGZiNTczMzJkMzZmZQ==|Mgmh5RuZwDM0b+nFyErOse3lNz8='; publishInfo.value.img_url = 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png'; - publishInfo.value.url = `${configUrl.proxyUrl}publish?sn=${sn && sn != undefined ? sn : ''}`; + publishInfo.value.url = `${import.meta.env.VITE_APP_BASEURL}/publish?_idp_session=${_idp_session}&sn=${sn && sn != undefined ? sn : ''}`; + console.log(567, import.meta.env, publishInfo.value.url); + // https://yls-api-uat.dctest.digitalyili.com/publish?_idp_session=MTE3LjEzLjEyMi4xODQ=|Y2UxNmU4ZGRhYmMyYjQyNDc3Y2NhOWY4Y2I0YTdlNjVkOGVmNWZiYWVkODMzYTQyNGQyMGZiNTczMzJkMzZmZQ==|Mgmh5RuZwDM0b+nFyErOse3lNz8=&sn= + // https://ylst-h5-uat.dctest.digitalyili.com/publish?_idp_session=MTE3LjEzLjEyMi4xODQ=|Y2UxNmU4ZGRhYmMyYjQyNDc3Y2NhOWY4Y2I0YTdlNjVkOGVmNWZiYWVkODMzYTQyNGQyMGZiNTczMzJkMzZmZQ==|Mgmh5RuZwDM0b+nFyErOse3lNz8=&sn= publishInfo.value.download_url = { title: '问卷下载', url: 'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png'