Commit e8807339 authored by TZW's avatar TZW

1216

parent 2a4a0ab0
......@@ -13,7 +13,7 @@ export default {
dev: {
[defaultSetting.proxypath]: {
// 要代理的地址
target: 'http://ems-test.nangaoyun.com/', //jf哥
target: 'http://192.168.40.64:28001', //jf哥
// target: 'http://192.168.40.203:8000', //dj哥
changeOrigin: true,
},
......
......@@ -26,7 +26,8 @@ function strToHump(str) {
}
export async function getInitialState() {
let token = true;
console.log(history);
let token = localStorage.getItem('TOKENES');
const fetchUserInfo = async () => {
try {
const msg = await queryCurrentUser();
......@@ -48,6 +49,7 @@ export async function getInitialState() {
}; // 如果是登录页面,不执行
if (history.location.pathname !== loginPath && token) {
console.log(3);
const currentUserData = await fetchUserInfo();
let menuData;
if (currentUserData?.data?.username) {
......@@ -73,7 +75,7 @@ export async function getInitialState() {
// ProLayout 支持的api https://procomponents.ant.design/components/layout
export const layout = ({ initialState, setInitialState }) => {
let token = true;
let token = localStorage.getItem('TOKENES');
return {
disableContentMargin: false,
waterMarkProps: {
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-29 14:03:07
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-14 14:08:31
* @Last Modified time: 2022-12-16 11:38:33
*/
import { doFetch } from '@/utils/doFetch';
......@@ -22,7 +22,6 @@ const App = ({
}) => {
const [value, setValue] = useState('');
const [fieldscolumns, setfieldscolumns] = useState(columns);
console.log(123123);
const selectValueType = (type, options) => {
switch (type) {
case 1:
......
......@@ -77,8 +77,8 @@ const Login = () => {
password: values.password,
};
try {
history.push('/');
return;
// history.push('/');
// return;
// 登录
const res = await doFetch({
url: `/token/oauth/token?grant_type=password&client_id=NGEMS3&client_secret=ems_Nangao@2022&username=${values?.userName}&password=${values?.password}`,
......
......@@ -2,12 +2,12 @@ import { doFetch } from '@/utils/doFetch';
import { Image } from 'antd';
import fieldsDetail from '@/utils/fieldsDetail';
import { useState, useEffect } from 'react';
function getcolumns(setdrawer, usermsg) {
console.log(usermsg);
function getcolumns(setDrawer, usermsg) {
const options = usermsg?.map((it) => ({
label: `${it?.username}-${it?.fullName}`,
value: it?.id,
}));
console.log(options);
return [
{
title: '用户名',
......@@ -19,7 +19,20 @@ function getcolumns(setdrawer, usermsg) {
options,
fieldProps: {
onChange: (e) => {
console.log(e);
let item = usermsg?.filter((it) => {
return it?.id == e;
});
console.log(item);
setDrawer((s) => ({
...s,
item: {
mailNo: item?.mailbox,
telephone: item?.phone,
status: item?.enabled,
fullName: item?.fullName,
username: item?.username,
},
}));
},
},
},
......@@ -98,7 +111,7 @@ function getcolumns(setdrawer, usermsg) {
key: 'status',
},
],
setdrawer,
setDrawer,
row,
'1',
'/auth/sysUser/detail',
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-16 11:18:33
* @Last Modified time: 2022-12-16 14:09:32
*/
import * as React from 'react';
......@@ -20,7 +20,15 @@ import { useRequest } from 'ahooks';
function User(props) {
const { initialState, loading, error, refresh, setInitialState } = useModel('@@initialState');
console.log('usermsg:', initialState);
const [username, setusername] = useState(null);
const { data } = useRequest(async () => {
let res = await doFetch({
url: '/auth/sysUser/queryLikeIotUsername',
params: { username: initialState?.currentUser?.username },
});
return res?.data?.dataList;
});
console.log(data);
const actionRef = useRef(),
formRef = useRef();
const [drawer, setDrawer] = useState({
......@@ -140,17 +148,6 @@ function User(props) {
);
};
const [username, setusername] = useState(null);
const { data } = useRequest(async () => {
let res = await doFetch({
url: '/auth/sysUser/queryLikeIotUsername',
params: { username: initialState?.currentUser?.username },
});
return res?.data?.dataList;
});
console.log(data);
const columns = useMemo(() => {
let defcolumn = getcolumns(setDrawer, data);
return defcolumn.concat({
......@@ -159,7 +156,7 @@ function User(props) {
width: 150,
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)],
});
}, []);
}, [data, drawer?.item]);
function selectType(type) {
switch (type) {
......
......@@ -31,7 +31,6 @@ function getcolumns(setdrawer) {
title: '数据类型',
dataIndex: 'dataTypeName',
key: 'dataType',
valueType: 'input',
hideInForm: false,
fieldProps: {
disabled: true,
......@@ -45,6 +44,17 @@ function getcolumns(setdrawer) {
valueType: 'input',
hideInForm: true,
hideInTable: true,
valueType: 'select',
options: [
{
label: '初始化',
value: '1',
},
{
label: '自定义',
value: '2',
},
],
},
{
title: '描述',
......
......@@ -26,6 +26,7 @@ function getcolumns(setdrawer) {
title: '规则配置',
dataIndex: 'nrList',
hideInTable: true,
search: true,
valueType: 'diyrules',
colProps: {
span: 24,
......
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