Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-11-01 11:51:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9c716a78478acc33042ab19fe6590132c55cb7cd
9c716a78
1 parent
53451e7a
🐞 fix: 处理首页不需要权限跳转问题
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
src/app.js
src/app.js
View file @
9c716a7
/*
* @Date: 2022-09-19 14:11:05
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-1
0-13 21:50:48
* @LastEditTime: 2022-1
1-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'
})
...
...
Please
register
or
login
to post a comment