完成:黄家明项目的开发并存档
This commit is contained in:
@@ -5,6 +5,7 @@ import {TriangleDown} from '@nutui/icons-react-taro'
|
||||
import {Popup, Avatar, NavBar} from '@nutui/nutui-react-taro'
|
||||
import {getUserInfo} from "@/api/layout";
|
||||
import {TenantId} from "@/utils/config";
|
||||
import {getOrganization} from "@/api/system/organization";
|
||||
|
||||
const Header = (props: any) => {
|
||||
const [IsLogin, setIsLogin] = useState<boolean>(true)
|
||||
@@ -31,11 +32,22 @@ const Header = (props: any) => {
|
||||
if (data) {
|
||||
setIsLogin(true);
|
||||
Taro.setStorageSync('UserId', data.userId)
|
||||
// 安装人员
|
||||
// 机构ID
|
||||
Taro.setStorageSync('OrganizationId',data.organizationId)
|
||||
// 父级机构ID
|
||||
getOrganization(Number(data.organizationId)).then(res => {
|
||||
Taro.setStorageSync('OrganizationParentId',res.parentId)
|
||||
})
|
||||
// 是否已认证
|
||||
if(data.certification){
|
||||
Taro.setStorageSync('Certification','1')
|
||||
}
|
||||
// 管理员
|
||||
const isKdy = data.roles?.findIndex(item => item.roleCode == 'admin')
|
||||
if(isKdy != -1){
|
||||
setRoleName('安装人员')
|
||||
Taro.setStorageSync('RoleName', '安装人员')
|
||||
setRoleName('管理员')
|
||||
Taro.setStorageSync('RoleName', '管理')
|
||||
Taro.setStorageSync('RoleCode', 'admin')
|
||||
return false;
|
||||
}
|
||||
// 交警
|
||||
@@ -43,6 +55,7 @@ const Header = (props: any) => {
|
||||
if(isJj != -1){
|
||||
setRoleName('交警')
|
||||
Taro.setStorageSync('RoleName', '交警')
|
||||
Taro.setStorageSync('RoleCode', 'jiaojing')
|
||||
return false;
|
||||
}
|
||||
// 邮政协会/管局
|
||||
@@ -50,6 +63,7 @@ const Header = (props: any) => {
|
||||
if(isYz != -1){
|
||||
setRoleName('邮政协会/管局')
|
||||
Taro.setStorageSync('RoleName', '邮政协会/管局')
|
||||
Taro.setStorageSync('RoleCode', 'youzheng')
|
||||
return false;
|
||||
}
|
||||
// 快递公司
|
||||
@@ -57,13 +71,21 @@ const Header = (props: any) => {
|
||||
if(isKd != -1){
|
||||
setRoleName('快递公司')
|
||||
Taro.setStorageSync('RoleName', '快递公司')
|
||||
Taro.setStorageSync('RoleCode', 'kuaidi')
|
||||
return false;
|
||||
}
|
||||
const isZD = data.roles?.findIndex(item => item.roleCode == 'zhandian')
|
||||
if(isZD != -1){
|
||||
setRoleName('快递站点')
|
||||
Taro.setStorageSync('RoleName', '快递站点')
|
||||
Taro.setStorageSync('RoleCode', 'zhandian')
|
||||
}
|
||||
// 快递员
|
||||
const isKdyy = data.roles?.findIndex(item => item.roleCode == 'kuaidiyuan')
|
||||
if(isKdyy != -1){
|
||||
setRoleName('快递员')
|
||||
Taro.setStorageSync('RoleName', '快递员')
|
||||
Taro.setStorageSync('RoleCode', 'kuaidiyuan')
|
||||
return false;
|
||||
}
|
||||
// 注册用户
|
||||
@@ -71,6 +93,7 @@ const Header = (props: any) => {
|
||||
if(isUser != -1){
|
||||
setRoleName('注册用户')
|
||||
Taro.setStorageSync('RoleName', '注册用户')
|
||||
Taro.setStorageSync('RoleCode', 'user')
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user