hookehuyr

🐞 fix: 处理首页不需要权限跳转问题

/*
* @Date: 2022-09-19 14:11:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-13 21:50:48
* @LastEditTime: 2022-11-01 11:49:42
* @FilePath: /swx/src/app.js
* @Description: 文件描述
*/
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import './app.less'
import '@/components/vant-weapp/common/index.wxss'
import request from './utils/request';
import Taro from '@tarojs/taro'
import { getCurrentPageUrl } from "@/utils/weapp";
const App = createApp({
// 可以使用所有的 Vue 生命周期方法
......@@ -19,9 +19,10 @@ const App = createApp({
},
// 对应 onLaunch
onLaunch() {
// 未授权状态跳转授权页面
if (!wx.getStorageSync("sessionid")) {
onLaunch(options) {
// 未授权状态跳转授权页面,首页不需要权限
const path = options.path;
if (path !== 'pages/index/index' && !wx.getStorageSync("sessionid")) {
wx.navigateTo({
url: './pages/auth/index'
})
......