diff --git a/components.d.ts b/components.d.ts index 8048365..2162b4d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -19,6 +19,7 @@ declare module 'vue' { VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup'] VanCol: typeof import('vant/es')['Col'] VanDivider: typeof import('vant/es')['Divider'] + VanFeild: typeof import('vant/es')['Feild'] VanField: typeof import('vant/es')['Field'] VanGrid: typeof import('vant/es')['Grid'] VanGridItem: typeof import('vant/es')['GridItem'] 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/main.ts b/src/main.ts index f25e063..579f87d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,9 +6,18 @@ import App from './App.vue'; import 'vant/lib/index.css'; import router from './router'; +import utils from '@/assets/js/common'; // 2. 引入组件样式 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/Home/Index.vue b/src/views/Home/Index.vue index 37dbd11..b97b9a4 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -9,7 +9,7 @@ import { onMounted, ref } from 'vue'; 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;