Commit 6cf70c5e authored by Bill's avatar Bill
parents 6c43376a 78d3cadf
......@@ -71,7 +71,7 @@
"@linkseeks/design-core": "^1.0.0",
"@linkseeks/design-react": "^1.0.0",
"@linkseeks/design-react-web": "^1.0.0",
"@linkseeks/design-ui": "1.0.5",
"@linkseeks/design-ui": "^1.0.9",
"@linkseeks/god": "^1.0.0",
"@linkseeks/umi-plugin-yapi": "1.0.1",
"@turf/turf": "^6.4.0",
......
import React, { useState, useEffect } from 'react';
import { Dropdown, Space, Menu, message } from 'antd';
import { CaretDownOutlined } from '@ant-design/icons';
import { getAuth, setAuth, setRouters } from '@/utils/auth';
import { getAuth, getCookieAuth, setAuth, setRouters } from '@/utils/auth';
import { postMemberLoginSwitchrole } from '@/services/MemberV2Api';
import { useIntl } from 'umi'
......@@ -17,12 +17,13 @@ const Roles: React.FC = () => {
const [roles, setRoles] = useState<MemberRole[]>([]);
useEffect(() => {
const userInfo = getAuth() || {};
const userInfo: any = getAuth() || {};
const cookieUserInfo: any = getCookieAuth() || {}
console.log(userInfo, 10086)
setRoles(userInfo.roles || []);
if (userInfo.roles && userInfo.roles.length) {
const current = userInfo.roles.find(item => item.memberRoleId === userInfo.memberRoleId);
const current = userInfo.roles.find(item => item.memberRoleId === cookieUserInfo.memberRoleId);
setCurRole(current);
}
}, []);
......
......@@ -6,6 +6,9 @@ import { GlobalConfig } from '@/global/config';
import queryString from 'query-string'
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd'
import { getIntl } from 'umi';
const intl = getIntl();
function isArray(arr: any) {
return Array.isArray(arr)
......@@ -418,7 +421,7 @@ export const getFieldType = (field) => {
maxLength: field.fieldLength,
"x-component-props": {
help: field.fieldRemark,
placeholder: `请输入${field.fieldLocalName || field.fieldCNName}`,
placeholder: `${intl.formatMessage({ id: 'common.form.input.placeholder' })}${field.fieldLocalName || field.fieldCNName}`,
size: 'large',
...field.attr
}
......@@ -486,7 +489,7 @@ export const getQueryStringParams = (url?: string) => {
// 填充必填的schema message提示
export const padRequiredMessage = (originSchema: ISchema) => {
const messageSwich = (type) => {
return type ? '请选择' : '请输入'
return type ? intl.formatMessage({ id: 'common.text.pleaseSelect' }) : intl.formatMessage({ id: 'common.form.input.placeholder' })
}
const todoFn = (targetSchema) => {
......@@ -576,9 +579,9 @@ export const isJSONStr = str => {
* @param {array} item 需要赋值的值
*/
export const coverColFiltersItem = (
data: Array<{[key: string]: any}>,
data: Array<{ [key: string]: any }>,
dataIndex: string,
item: {[key: string]: any}
item: { [key: string]: any }
) => {
const index = data.findIndex(i => i.dataIndex === dataIndex);
......@@ -642,7 +645,7 @@ export const getIChannelInfo = () => {
* @param url 链接
* @returns
*/
export const getTopDomainByHost = (url: string, isPort = false): string => {
export const getTopDomainByHost = (url: string, isPort = false): string => {
if (!url) return ''
// 如果后缀带有端口号, 可通过第二个参数把端口去掉
const splitUrl = url.replace(/(http|https)\:\/\//, '').split(':')
......@@ -659,7 +662,7 @@ export const getIChannelInfo = () => {
export const clearModalParams = () => {
const currentState = JSON.parse(sessionStorage.getItem("currentState"))
const result = {...currentState, queryParams: {}, current: 1}
const result = { ...currentState, queryParams: {}, current: 1 }
sessionStorage.setItem("currentState", JSON.stringify(result))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment