修复已知问题
This commit is contained in:
@@ -6,9 +6,11 @@ import {Popup, Avatar, NavBar} from '@nutui/nutui-react-taro'
|
||||
import {getSiteInfo, getUserInfo, getWxOpenId} from "@/api/layout";
|
||||
import {TenantId} from "@/utils/config";
|
||||
import {getOrganization} from "@/api/system/organization";
|
||||
import {myUserVerify} from "@/api/system/userVerify";
|
||||
import {myTenantList, myUserVerify} from "@/api/system/userVerify";
|
||||
import {CmsWebsite} from "@/api/cms/cmsWebsite/model";
|
||||
import {User} from "@/api/system/user/model";
|
||||
import './Header.scss';
|
||||
import MySearch from "./MySearch";
|
||||
|
||||
const Header = () => {
|
||||
const [userInfo, setUserInfo] = useState<User>()
|
||||
@@ -33,7 +35,7 @@ const Header = () => {
|
||||
if (data) {
|
||||
setIsLogin(true);
|
||||
setUserInfo(data)
|
||||
console.log('用户信息>>>',data.phone)
|
||||
console.log('用户信息>>>', data.phone)
|
||||
// 保存userId
|
||||
Taro.setStorageSync('UserId', data.userId)
|
||||
// 获取openId
|
||||
@@ -46,27 +48,27 @@ const Header = () => {
|
||||
})
|
||||
}
|
||||
// 是否已认证
|
||||
if(data.certification){
|
||||
Taro.setStorageSync('Certification','1')
|
||||
if (data.certification) {
|
||||
Taro.setStorageSync('Certification', '1')
|
||||
}
|
||||
// 机构ID
|
||||
Taro.setStorageSync('OrganizationId',data.organizationId)
|
||||
Taro.setStorageSync('OrganizationId', data.organizationId)
|
||||
// 父级机构ID
|
||||
if(Number(data.organizationId) > 0){
|
||||
if (Number(data.organizationId) > 0) {
|
||||
getOrganization(Number(data.organizationId)).then(res => {
|
||||
Taro.setStorageSync('OrganizationParentId',res.parentId)
|
||||
Taro.setStorageSync('OrganizationParentId', res.parentId)
|
||||
})
|
||||
}
|
||||
// 管理员
|
||||
const isKdy = data.roles?.findIndex(item => item.roleCode == 'admin')
|
||||
if(isKdy != -1){
|
||||
if (isKdy != -1) {
|
||||
Taro.setStorageSync('RoleName', '管理')
|
||||
Taro.setStorageSync('RoleCode', 'admin')
|
||||
return false;
|
||||
}
|
||||
// 注册用户
|
||||
const isUser = data.roles?.findIndex(item => item.roleCode == 'user')
|
||||
if(isUser != -1){
|
||||
if (isUser != -1) {
|
||||
Taro.setStorageSync('RoleName', '注册用户')
|
||||
Taro.setStorageSync('RoleCode', 'user')
|
||||
return false;
|
||||
@@ -78,10 +80,14 @@ const Header = () => {
|
||||
});
|
||||
// 认证信息
|
||||
myUserVerify({status: 1}).then(data => {
|
||||
if(data?.realName){
|
||||
Taro.setStorageSync('RealName',data.realName)
|
||||
if (data?.realName) {
|
||||
Taro.setStorageSync('RealName', data.realName)
|
||||
}
|
||||
})
|
||||
//
|
||||
myTenantList({page: 2, page_size: 50}).then(res => {
|
||||
console.log(res, '...res...lei')
|
||||
})
|
||||
}
|
||||
|
||||
/* 获取用户手机号 */
|
||||
@@ -107,7 +113,7 @@ const Header = () => {
|
||||
TenantId
|
||||
},
|
||||
success: function (res) {
|
||||
if(res.data.code == 1){
|
||||
if (res.data.code == 1) {
|
||||
Taro.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'error',
|
||||
@@ -138,6 +144,9 @@ const Header = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={'fixed top-0 header-bg'}>
|
||||
<MySearch done={reload}/>
|
||||
</div>
|
||||
<NavBar
|
||||
style={{marginTop: `${statusBarHeight}px`, marginBottom: '0px', backgroundColor: 'transparent'}}
|
||||
onBackClick={() => {
|
||||
@@ -162,8 +171,8 @@ const Header = () => {
|
||||
size="22"
|
||||
src={config?.websiteLogo}
|
||||
/>
|
||||
{config?.websiteName}
|
||||
<TriangleDown size={9}/>
|
||||
<span className={'text-white'}>{config?.websiteName}</span>
|
||||
<TriangleDown className={'text-white'} size={9}/>
|
||||
</div>
|
||||
)}>
|
||||
</NavBar>
|
||||
|
||||
Reference in New Issue
Block a user