Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
蒋秀川
/
miniProject
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 56a312e4
authored
Jun 12, 2023
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
用户类型判断权限
1 parent
43e02ce5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
miniProject/custom-tab-bar/index.js
miniProject/pages/login/index.js
miniProject/custom-tab-bar/index.js
View file @
56a312e
...
...
@@ -28,7 +28,29 @@ Component({
}
]
},
attached
:
function
(){
let
userType
=
wx
.
getStorageSync
(
'userrole_type'
);
if
(
userType
==
3
){
this
.
setData
({
curClick
:
2
,
list
:[
{
"pagePath"
:
"/pages/home/index"
,
"iconPath"
:
"../images/cong.png"
,
"selectedIconPath"
:
"../images/cong-b.png"
,
"text"
:
"工作台"
,
"curr"
:
2
},
{
"pagePath"
:
"/pages/me/index"
,
"iconPath"
:
"../images/me.png"
,
"selectedIconPath"
:
"../images/me-b.png"
,
"text"
:
"我的"
,
"curr"
:
3
}]
})
}
},
methods
:
{
NavChange
(
e
)
{
// 获取穿过来的参数
...
...
miniProject/pages/login/index.js
View file @
56a312e
...
...
@@ -131,7 +131,12 @@ Page({
wx
.
setStorageSync
({
data
:
datas
[
0
].
id
,
key
:
'accountId'
})
//wx.setStorage({ data: datas, key: 'accountList' })
wx
.
setStorage
({
data
:
datas
[
0
].
name
,
key
:
'accountName'
})
wx
.
reLaunch
({
url
:
'/pages/index/index'
})
if
(
res
.
data
.
user
.
type
==
3
){
wx
.
reLaunch
({
url
:
'/pages/home/index'
})
}
else
{
wx
.
reLaunch
({
url
:
'/pages/index/index'
})
}
}
})
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment