Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
ems3.3
Commits
e8807339
Commit
e8807339
authored
Dec 16, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1216
parent
2a4a0ab0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
26 deletions
+48
-26
proxy.js
config/proxy.js
+1
-1
app.jsx
src/app.jsx
+4
-2
index.jsx
src/components/ExtendField/index.jsx
+1
-2
index.jsx
src/pages/User/Login/index.jsx
+2
-2
columns.js
src/pages/setting/users/columns.js
+17
-4
index.jsx
src/pages/setting/users/index.jsx
+11
-14
columns.js
src/pages/system/dictionary/columns.js
+11
-1
columns.js
src/pages/system/rules/columns.js
+1
-0
No files found.
config/proxy.js
View file @
e8807339
...
...
@@ -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
,
},
...
...
src/app.jsx
View file @
e8807339
...
...
@@ -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
:
{
...
...
src/components/ExtendField/index.jsx
View file @
e8807339
...
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-29 14:03:07
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-1
4 14:08:31
* @Last Modified time: 2022-12-1
6 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
:
...
...
src/pages/User/Login/index.jsx
View file @
e8807339
...
...
@@ -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
}
`,
...
...
src/pages/setting/users/columns.js
View file @
e8807339
...
...
@@ -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',
},
],
set
d
rawer,
set
D
rawer,
row,
'1',
'/auth/sysUser/detail',
...
...
src/pages/setting/users/index.jsx
View file @
e8807339
...
...
@@ -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 1
1:18:33
* @Last Modified time: 2022-12-16 1
4: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
)
{
...
...
src/pages/system/dictionary/columns.js
View file @
e8807339
...
...
@@ -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
:
'描述'
,
...
...
src/pages/system/rules/columns.js
View file @
e8807339
...
...
@@ -26,6 +26,7 @@ function getcolumns(setdrawer) {
title
:
'规则配置'
,
dataIndex
:
'nrList'
,
hideInTable
:
true
,
search
:
true
,
valueType
:
'diyrules'
,
colProps
:
{
span
:
24
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment