Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
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
wms
Commits
5f64d2dc
Commit
5f64d2dc
authored
Aug 16, 2023
by
krysent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jicheng
parent
777f6d43
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
536 additions
and
287 deletions
+536
-287
proxy.js
config/proxy.js
+5
-3
app.jsx
src/app.jsx
+35
-25
index.jsx
src/components/Autocomplete/index.jsx
+60
-0
index.jsx
src/components/InitForm/index.jsx
+20
-0
AvatarDropdown.jsx
src/components/RightContent/AvatarDropdown.jsx
+67
-18
fields.jsx
src/pages/system/Staff/fields.jsx
+44
-30
index.jsx
src/pages/user/Login/index.jsx
+204
-159
login.js
src/services/login.js
+14
-6
system.js
src/services/system.js
+34
-34
doFetch.js
src/utils/doFetch.js
+1
-1
request.js
src/utils/request.js
+52
-11
No files found.
config/proxy.js
View file @
5f64d2dc
...
@@ -9,12 +9,14 @@
...
@@ -9,12 +9,14 @@
export
default
{
export
default
{
dev
:
{
dev
:
{
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/wms/"
:
{
"/wms
pro
/"
:
{
// 要代理的地址
// 要代理的地址
target
:
"http://192.168.40.18/wms/"
,
//39:28040 18/wms/
target
:
"http://192.168.40.203:8000"
,
//39:28040 18/wms/
// target: "http://192.168.40.18/wms/", //39:28040 18/wms/
// target: "http://192.168.40.18/wms/", //39:28040 18/wms/
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
"^/wms"
:
""
,
"^/wms
pro
"
:
""
,
},
},
},
},
"/staticfile/"
:
{
"/staticfile/"
:
{
...
...
src/app.jsx
View file @
5f64d2dc
...
@@ -24,7 +24,7 @@ export async function getInitialState() {
...
@@ -24,7 +24,7 @@ export async function getInitialState() {
const
msg
=
await
queryCurrentUser
();
const
msg
=
await
queryCurrentUser
();
return
msg
.
data
;
return
msg
.
data
;
}
catch
(
error
)
{
}
catch
(
error
)
{
history
.
push
(
loginPath
);
//
history.push(loginPath);
}
}
return
undefined
;
return
undefined
;
};
// 如果是登录页面,不执行
};
// 如果是登录页面,不执行
...
@@ -51,7 +51,7 @@ export async function getInitialState() {
...
@@ -51,7 +51,7 @@ export async function getInitialState() {
settings
:
defaultSettings
,
settings
:
defaultSettings
,
newMenu
:
menuData
,
newMenu
:
menuData
,
getmenuData
,
getmenuData
,
collapsed
:
false
collapsed
:
false
,
};
};
}
}
return
{
return
{
...
@@ -59,7 +59,7 @@ export async function getInitialState() {
...
@@ -59,7 +59,7 @@ export async function getInitialState() {
settings
:
defaultSettings
,
settings
:
defaultSettings
,
getmenuData
,
getmenuData
,
collapsed
:
false
,
collapsed
:
false
,
tagList
:
[]
tagList
:
[]
,
};
};
}
// ProLayout 支持的api https://procomponents.ant.design/components/layout
}
// ProLayout 支持的api https://procomponents.ant.design/components/layout
export
const
layout
=
async
(
props
)
=>
{
export
const
layout
=
async
(
props
)
=>
{
...
@@ -74,25 +74,36 @@ export const layout = async (props) => {
...
@@ -74,25 +74,36 @@ export const layout = async (props) => {
},
},
collapsed
:
initialState
.
collapsed
,
collapsed
:
initialState
.
collapsed
,
onCollapse
:
(
cols
)
=>
{
onCollapse
:
(
cols
)
=>
{
setInitialState
(
s
=>
({
...
s
,
collapsed
:
cols
}))
setInitialState
(
(
s
)
=>
({
...
s
,
collapsed
:
cols
}));
},
},
onPageChange
:
()
=>
{
onPageChange
:
async
()
=>
{
// const { location } = history; // 如果没有登录,重定向到 login
// if (location.pathname != "/user/logon") {
// if (
// (!initialState?.currentUser && location.pathname !== loginPath) ||
// !token
// ) {
// setInitialState((s) => {
// return { ...s, currentUser: undefined, newMenu: [] };
// });
// history.replace(loginPath);
// }
// }
// if (location.pathname == loginPath) {
// setInitialState((s) => {
// return { ...s, currentUser: undefined, newMenu: [] };
// });
// }
const
{
location
}
=
history
;
// 如果没有登录,重定向到 login
const
{
location
}
=
history
;
// 如果没有登录,重定向到 login
if
(
location
.
pathname
!=
"/user/logon"
)
{
let
Token
=
localStorage
.
getItem
(
"TOKEN_MES"
);
if
(
if
(
!
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
)
{
(
!
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
)
||
let
userInfo
=
await
initialState
.
fetchUserInfo
();
!
token
let
menuData
=
await
initialState
.
getmenuData
();
)
{
setInitialState
((
s
)
=>
({
setInitialState
((
s
)
=>
{
...
s
,
return
{
...
s
,
currentUser
:
undefined
,
newMenu
:
[]
};
currentUser
:
userInfo
?.
data
,
});
newMenu
:
menuData
,
history
.
replace
(
loginPath
);
}));
}
}
if
(
location
.
pathname
==
loginPath
)
{
setInitialState
((
s
)
=>
{
return
{
...
s
,
currentUser
:
undefined
,
newMenu
:
[]
};
});
}
}
},
},
contentStyle
:
{
contentStyle
:
{
...
@@ -107,10 +118,10 @@ export const layout = async (props) => {
...
@@ -107,10 +118,10 @@ export const layout = async (props) => {
},
},
request
:
(
params
,
defaultMenuData
)
=>
{
request
:
(
params
,
defaultMenuData
)
=>
{
let
lastArr
=
initialState
?.
newMenu
?.
userHavePermList
let
lastArr
=
initialState
?.
newMenu
?.
userHavePermList
?
JSON
.
parse
(
?
JSON
.
parse
(
JSON
.
stringify
(
initialState
?.
newMenu
?.
userHavePermList
)
JSON
.
stringify
(
initialState
?.
newMenu
?.
userHavePermList
)
)
)
:
[],
:
[],
newArr
=
[
newArr
=
[
{
{
path
:
"/welcome"
,
path
:
"/welcome"
,
...
@@ -138,7 +149,6 @@ export const layout = async (props) => {
...
@@ -138,7 +149,6 @@ export const layout = async (props) => {
}
}
},
},
// 自定义 403 页面
// 自定义 403 页面
// unAccessible: <div>unAccessible</div>,
// unAccessible: <div>unAccessible</div>,
// 增加一个 loading 的状态
// 增加一个 loading 的状态
...
...
src/components/Autocomplete/index.jsx
0 → 100644
View file @
5f64d2dc
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
AutoComplete
,
Input
}
from
"antd"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
useRequest
}
from
"ahooks"
;
export
default
(
item
)
=>
{
const
{
requestOptions
,
name
,
value
,
onChange
}
=
item
;
const
[
options
,
setoptions
]
=
useState
([]);
const
[
username
,
setusername
]
=
useState
();
// const [value, setvalue] = useState();
const
{
data
,
run
,
runAsync
}
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
requestOptions
?.
url
??
""
,
// params: { [requestOptions.params]: username },
params
:
requestOptions
.
params
&&
{
[
requestOptions
.
params
]:
username
},
});
return
res
?.
data
?.
dataList
;
},
{
manual
:
true
,
debounceWait
:
300
,
}
);
useEffect
(()
=>
{
runAsync
()
.
then
((
data
)
=>
{
const
options
=
data
?.
map
((
it
)
=>
({
...
it
,
label
:
`
${
it
?.
username
}
-
$
{
it
?.
fullName
}
-
$
{
it
?.
phone
}
-
$
{
it
?.
mailbox
}
`,
value: `
$
{
it
?.
username
}
-
$
{
it
?.
fullName
}
-
$
{
it
?.
phone
}
-
$
{
it
?.
mailbox
}
`,
}));
setoptions(options);
})
.catch((error) => {
console.log(error);
});
}, [username]);
const onChangeHandle = (val) => {
setusername(val)
onChange(val)
// setvalue(val);
};
const selectValue = (val) => {
onChange(val)
};
return (
<AutoComplete
allowClear
placeholder={item.title}
disabled={item.disabled}
options={options}
onChange={onChangeHandle}
onSelect={selectValue}
value={value}
/>
);
};
src/components/InitForm/index.jsx
View file @
5f64d2dc
...
@@ -28,6 +28,7 @@ import Editor from "../Editor";
...
@@ -28,6 +28,7 @@ import Editor from "../Editor";
import
mockfile
from
"./mockfile.js"
;
import
mockfile
from
"./mockfile.js"
;
import
zhCN
from
"antd/lib/locale/zh_CN"
;
import
zhCN
from
"antd/lib/locale/zh_CN"
;
import
Diyrule
from
"../Diyrule"
;
import
Diyrule
from
"../Diyrule"
;
import
Autocomplete
from
"../Autocomplete"
;
moment
.
locale
(
"zh-cn"
);
moment
.
locale
(
"zh-cn"
);
const
{
TreeNode
}
=
TreeSelect
;
const
{
TreeNode
}
=
TreeSelect
;
...
@@ -729,6 +730,25 @@ let InitForm = ({
...
@@ -729,6 +730,25 @@ let InitForm = ({
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
)
:
null
;
)
:
null
;
}
else
if
(
item
.
type
==
"autocompleteinput"
)
{
return
!
extraprops
.
hides
?
(
<
Col
key=
{
i
}
{
...
getCol
(
item
.
col
)}
>
<
Form
.
Item
style=
{
{}
}
label=
{
item
.
title
}
name=
{
item
.
name
[
0
]
}
rules=
{
[
{
required
:
item
.
required
,
message
:
`请输入${item.title}`
,
},
]
}
>
<
Autocomplete
{
...
item
}
/>
{
/* <span style={{position:'relative',fontSize:"12px",color:'#c0c0c0c0'}}>登录账号为"用户名",登录密码为IoT设置的密码</span> */
}
</
Form
.
Item
>
</
Col
>
)
:
null
;
}
else
if
(
item
.
type
==
"textarea"
)
{
}
else
if
(
item
.
type
==
"textarea"
)
{
return
!
extraprops
.
hides
?
(
return
!
extraprops
.
hides
?
(
<
Col
key=
{
i
}
{
...
getCol
(
item
.
col
)}
>
<
Col
key=
{
i
}
{
...
getCol
(
item
.
col
)}
>
...
...
src/components/RightContent/AvatarDropdown.jsx
View file @
5f64d2dc
import
React
,
{
useCallback
,
useState
,
useMemo
}
from
"react"
;
import
React
,
{
useCallback
,
useState
,
useMemo
}
from
"react"
;
import
{
LogoutOutlined
,
LockOutlined
}
from
"@ant-design/icons"
;
import
{
import
{
Menu
,
Spin
,
Form
,
Modal
,
message
,
Avatar
}
from
"antd"
;
LogoutOutlined
,
import
{
history
,
useModel
,
useRequest
}
from
"umi"
;
LockOutlined
,
import
{
stringify
}
from
"querystring"
;
UserOutlined
,
DownOutlined
,
}
from
"@ant-design/icons"
;
import
{
Menu
,
Spin
,
Form
,
Modal
,
message
,
Select
}
from
"antd"
;
import
{
history
,
useModel
}
from
"umi"
;
import
{
useRequest
}
from
"ahooks"
;
import
HeaderDropdown
from
"../HeaderDropdown"
;
import
HeaderDropdown
from
"../HeaderDropdown"
;
import
styles
from
"./index.less"
;
import
styles
from
"./index.less"
;
import
{
fakeAccountLoginOut
,
changePwd
}
from
"@/services/login"
;
import
{
fakeAccountLoginOut
,
changePwd
}
from
"@/services/login"
;
...
@@ -13,17 +18,19 @@ import ECB from "crypto-js/mode-ecb";
...
@@ -13,17 +18,19 @@ import ECB from "crypto-js/mode-ecb";
import
Pkcs7
from
"crypto-js/pad-pkcs7"
;
import
Pkcs7
from
"crypto-js/pad-pkcs7"
;
import
Utf8
from
"crypto-js/enc-utf8"
;
import
Utf8
from
"crypto-js/enc-utf8"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
const
{
Option
}
=
Select
;
/**
/**
* 退出登录,并且将当前的 url 保存
* 退出登录,并且将当前的 url 保存
*/
*/
const
loginOut
=
async
()
=>
{
const
loginOut
=
async
()
=>
{
await
fakeAccountLoginOut
();
const
{
logoutRedirectUrl
}
=
await
fakeAccountLoginOut
();
const
{
query
=
{}
}
=
history
.
location
;
const
{
redirect
}
=
query
;
// Note: There may be security issues, please note
const
{
query
=
{}
}
=
history
.
location
;
const
{
redirect
}
=
query
;
// Note: There may be security issues, please not
if
(
window
.
location
.
pathname
!==
"/user/login"
&&
!
redirect
)
{
if
(
window
.
location
.
pathname
!==
"/user/login"
&&
!
redirect
)
{
localStorage
.
clear
();
localStorage
.
clear
();
history
.
replace
(
"/user/login"
);
// history.replace("/user/login");
window
.
location
.
replace
(
logoutRedirectUrl
);
}
}
};
};
...
@@ -33,7 +40,6 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -33,7 +40,6 @@ const AvatarDropdown = ({ menu }) => {
[
formRef
]
=
Form
.
useForm
(),
[
formRef
]
=
Form
.
useForm
(),
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
{
run
,
loading
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
manual
:
true
,
formatResult
:
(
res
)
=>
res
,
onSuccess
:
(
result
,
params
)
=>
{
onSuccess
:
(
result
,
params
)
=>
{
if
(
result
.
code
==
"0000"
)
{
if
(
result
.
code
==
"0000"
)
{
cv
(
false
);
cv
(
false
);
...
@@ -47,6 +53,13 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -47,6 +53,13 @@ const AvatarDropdown = ({ menu }) => {
});
});
}
}
},
},
}),
getUserApp
=
useRequest
(
async
()
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-auth/sysUser/userApp/selection"
,
params
:
{},
});
return
res
?.
data
??
{};
});
});
const
fields
=
useMemo
(()
=>
{
const
fields
=
useMemo
(()
=>
{
return
{
return
{
...
@@ -130,9 +143,9 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -130,9 +143,9 @@ const AvatarDropdown = ({ menu }) => {
padding
:
Pkcs7
,
padding
:
Pkcs7
,
}).
toString
();
}).
toString
();
let
newPassword
=
AES
.
encrypt
(
values
.
newPassword
,
Utf8
.
parse
(
timestamp
),
{
let
newPassword
=
AES
.
encrypt
(
values
.
newPassword
,
Utf8
.
parse
(
timestamp
),
{
mode
:
ECB
,
mode
:
ECB
,
padding
:
Pkcs7
,
padding
:
Pkcs7
,
}).
toString
(),
}).
toString
(),
password
=
AES
.
encrypt
(
values
.
password
,
Utf8
.
parse
(
timestamp
),
{
password
=
AES
.
encrypt
(
values
.
password
,
Utf8
.
parse
(
timestamp
),
{
mode
:
ECB
,
mode
:
ECB
,
padding
:
Pkcs7
,
padding
:
Pkcs7
,
...
@@ -160,7 +173,7 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -160,7 +173,7 @@ const AvatarDropdown = ({ menu }) => {
</
Menu
>
</
Menu
>
);
);
return
(
return
(
<
div
>
<
div
className=
"center"
>
<
Modal
<
Modal
title=
"修改密码"
title=
"修改密码"
visible=
{
visible
}
visible=
{
visible
}
...
@@ -175,21 +188,57 @@ const AvatarDropdown = ({ menu }) => {
...
@@ -175,21 +188,57 @@ const AvatarDropdown = ({ menu }) => {
formRef=
{
formRef
}
formRef=
{
formRef
}
fields=
{
fields
}
fields=
{
fields
}
col=
{
{
span
:
24
}
}
col=
{
{
span
:
24
}
}
onChange=
{
(
changedValues
,
allValues
)
=>
{
}
}
onChange=
{
(
changedValues
,
allValues
)
=>
{}
}
submitData=
{
(
values
,
fn
)
=>
{
submitData=
{
(
values
,
fn
)
=>
{
saveData
(
values
,
fn
);
saveData
(
values
,
fn
);
}
}
}
}
submitting=
{
loading
||
!
visible
}
submitting=
{
loading
||
!
visible
}
>
></
InitForm
>
</
InitForm
>
</
Modal
>
</
Modal
>
<
Select
style=
{
{
width
:
200
,
}
}
onChange=
{
(
value
)
=>
{
window
.
open
(
value
,
"_self"
);
}
}
value=
{
getUserApp
?.
data
?.
dataList
?.
filter
(
(
it
)
=>
it
.
appId
==
getUserApp
?.
data
?.
appId
)?.[
0
]?.
value
}
tagRender=
{
(
props
)
=>
{}
}
>
{
getUserApp
?.
data
?.
dataList
?.
map
((
it
)
=>
{
return
(
<
Option
value=
{
it
.
value
}
label=
{
it
.
label
}
key=
{
it
.
value
}
>
<
div
style=
{
{
display
:
"flex"
,
alignItems
:
"center"
}
}
>
{
it
?.
appImgList
?.
length
>
0
&&
(
<
img
src=
{
it
?.
appImgList
?.[
0
]?.
url
}
style=
{
{
width
:
26
,
height
:
26
,
objectFit
:
"cover"
,
marginRight
:
6
,
}
}
/>
)
}
<
span
>
{
it
.
label
}
</
span
>
</
div
>
</
Option
>
);
})
}
</
Select
>
<
HeaderDropdown
overlay=
{
menuHeaderDropdown
}
>
<
HeaderDropdown
overlay=
{
menuHeaderDropdown
}
>
<
span
className=
{
`${styles.action} ${styles.account}`
}
>
<
span
className=
{
`${styles.action} ${styles.account}`
}
>
<
Avatar
style=
{
{
marginRight
:
12
,
backgroundColor
:
"#1890ff"
}
}
>
{
currentUser
.
userName
.
substr
(
0
,
1
)
}
</
Avatar
>
<
UserOutlined
style=
{
{
color
:
"#57b9c6"
,
fontSize
:
20
,
margin
:
"0 4px"
}
}
/>
<
span
className=
{
`${styles.name} anticon`
}
>
<
span
className=
{
`${styles.name} anticon`
}
>
{
currentUser
.
userName
}
{
currentUser
.
userName
}
</
span
>
</
span
>
<
DownOutlined
style=
{
{
fontSize
:
14
,
marginLeft
:
4
}
}
/>
</
span
>
</
span
>
</
HeaderDropdown
>
</
HeaderDropdown
>
</
div
>
</
div
>
...
...
src/pages/system/Staff/fields.jsx
View file @
5f64d2dc
...
@@ -9,27 +9,37 @@ import {
...
@@ -9,27 +9,37 @@ import {
}
from
"@/services/system"
;
}
from
"@/services/system"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
import
{
doFetch
}
from
"@/utils/doFetch"
;
export
default
{
export
default
{
// accountName: {
// value: null,
// type: "input",
// title: "用户名",
// name: ["accountName"],
// required: true,
// },
// userName: {
// value: null,
// type: "input",
// title: "姓名",
// name: ["userName"],
// required: true,
// },
accountName
:
{
accountName
:
{
value
:
null
,
type
:
"autocompleteinput"
,
type
:
"input"
,
title
:
"用户名-姓名-联系电话-邮箱"
,
title
:
"用户名"
,
name
:
[
"accountName"
],
name
:
[
"accountName"
],
required
:
true
,
required
:
true
,
requestOptions
:
{
url
:
"/ngic-auth/sysUser/queryLikeIotUsername"
,
params
:
"userName"
,
},
},
},
userName
:
{
// telephone: {
value
:
null
,
// value: null,
type
:
"input"
,
// type: "input",
title
:
"姓名"
,
// title: "联系电话",
name
:
[
"userName"
],
// name: ["telephone"],
required
:
true
,
// required: false,
},
// },
telephone
:
{
value
:
null
,
type
:
"input"
,
title
:
"联系电话"
,
name
:
[
"telephone"
],
required
:
false
,
},
departmentId
:
{
departmentId
:
{
value
:
null
,
value
:
null
,
type
:
"treeselect"
,
type
:
"treeselect"
,
...
@@ -63,10 +73,14 @@ export default {
...
@@ -63,10 +73,14 @@ export default {
required
:
false
,
required
:
false
,
belinked
:
{
belinked
:
{
options
:
{
options
:
{
database
:
(
params
)
=>
doFetch
({
url
:
"/ngic-auth/sysStore/selectionBox"
,
params
:
{
...
params
}
}),
database
:
(
params
)
=>
doFetch
({
url
:
"/wmspro/ngic-auth/sysStore/selectionBox"
,
params
:
{
...
params
},
}),
params
:
{
params
:
{
factoryIdList
:
"linked"
factoryIdList
:
"linked"
,
}
}
,
},
},
},
},
multiple
:
true
,
multiple
:
true
,
...
@@ -98,16 +112,16 @@ export default {
...
@@ -98,16 +112,16 @@ export default {
},
},
},
},
},
},
mailNo
:
{
//
mailNo: {
value
:
null
,
//
value: null,
type
:
"input"
,
//
type: "input",
title
:
"邮箱"
,
//
title: "邮箱",
name
:
[
"mailNo"
],
//
name: ["mailNo"],
required
:
false
,
//
required: false,
col
:
{
//
col: {
span
:
12
,
//
span: 12,
},
//
},
},
//
},
remark
:
{
remark
:
{
value
:
null
,
value
:
null
,
type
:
"textarea"
,
type
:
"textarea"
,
...
...
src/pages/user/Login/index.jsx
View file @
5f64d2dc
This diff is collapsed.
Click to expand it.
src/services/login.js
View file @
5f64d2dc
...
@@ -10,7 +10,7 @@ export async function fakeAccountLogin(params) {
...
@@ -10,7 +10,7 @@ export async function fakeAccountLogin(params) {
//登出
//登出
export
async
function
fakeAccountLoginOut
(
params
)
{
export
async
function
fakeAccountLoginOut
(
params
)
{
return
request
(
`/
wms/ngic-auth/sysAccount
/logout`
,
{
return
request
(
`/
mespro
/logout`
,
{
method
:
"POST"
,
method
:
"POST"
,
body
:
params
,
body
:
params
,
});
});
...
@@ -27,15 +27,23 @@ export async function saveForRegister(params) {
...
@@ -27,15 +27,23 @@ export async function saveForRegister(params) {
//个人信息
//个人信息
export
async
function
queryCurrentUser
(
params
)
{
export
async
function
queryCurrentUser
(
params
)
{
return
request
(
"/wms
/ngic-auth/sysUser/query
"
,
{
return
request
(
"/wms
pro/ngic-auth/sysUser/me
"
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
// //获取菜单/权限/菜单/公司类型
// export async function getMenu(params) {
// return request(`/wms/ngic-auth/sysPermission/queryMenu`, {
// method: "POST",
// data: params,
// });
// }
//获取菜单/权限/菜单/公司类型
//获取菜单/权限/菜单/公司类型
export
async
function
getMenu
(
params
)
{
export
async
function
getMenu
(
params
)
{
return
request
(
`/wms/ngic-auth/sysPermission/queryMenu`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysPermission/queryMenu`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -43,7 +51,7 @@ export async function getMenu(params) {
...
@@ -43,7 +51,7 @@ export async function getMenu(params) {
/*---------------菜单收藏-------------------*/
/*---------------菜单收藏-------------------*/
export
async
function
collectPerms
(
params
)
{
export
async
function
collectPerms
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUserPermission/collectPerm`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysUserPermission/collectPerm`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -51,14 +59,14 @@ export async function collectPerms(params) {
...
@@ -51,14 +59,14 @@ export async function collectPerms(params) {
/*---------------取消菜单收藏-------------------*/
/*---------------取消菜单收藏-------------------*/
export
async
function
cancelCollectPerms
(
params
)
{
export
async
function
cancelCollectPerms
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUserPermission/cancelCollectPerm`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysUserPermission/cancelCollectPerm`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
/*---------------菜单历史记录-------------------*/
/*---------------菜单历史记录-------------------*/
export
async
function
mtosave
(
params
)
{
export
async
function
mtosave
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUserVisitPermission/save`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysUserVisitPermission/save`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
...
src/services/system.js
View file @
5f64d2dc
...
@@ -2,21 +2,21 @@ import request from "@/utils/request";
...
@@ -2,21 +2,21 @@ import request from "@/utils/request";
//工厂下拉框
//工厂下拉框
export
async
function
factorySelect
(
params
)
{
export
async
function
factorySelect
(
params
)
{
return
request
(
`/wms/ngic-auth/sysFactory/selectionBox`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysFactory/selectionBox`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//查询个人所属工厂下拉框
//查询个人所属工厂下拉框
export
async
function
factorySelectByuser
(
params
)
{
export
async
function
factorySelectByuser
(
params
)
{
return
request
(
`/wms/ngic-auth/sysFactory/selectionBoxU`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysFactory/selectionBoxU`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//查询工厂下拉框---注册
//查询工厂下拉框---注册
export
async
function
factorySelectRegister
(
params
)
{
export
async
function
factorySelectRegister
(
params
)
{
return
request
(
`/wms/ngic-auth/sysFactory/selectionBoxAll`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysFactory/selectionBoxAll`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -24,28 +24,28 @@ export async function factorySelectRegister(params) {
...
@@ -24,28 +24,28 @@ export async function factorySelectRegister(params) {
//全部车间下拉框
//全部车间下拉框
export
async
function
shopSelect
(
params
)
{
export
async
function
shopSelect
(
params
)
{
return
request
(
`/wms/ngic-auth/sysShop/selectionBox`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysShop/selectionBox`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//仓库下拉
//仓库下拉
export
async
function
storeselectionBoxAll
(
params
)
{
export
async
function
storeselectionBoxAll
(
params
)
{
return
request
(
`/wms/ngic-auth/sysStore/selectionBox`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysStore/selectionBox`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据工厂id查询车间下拉
//根据工厂id查询车间下拉
export
async
function
storeselectionBox
(
params
)
{
export
async
function
storeselectionBox
(
params
)
{
return
request
(
`/wms/ngic-auth/sysStore/selectionBox`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysStore/selectionBox`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//全部组织下拉
//全部组织下拉
export
async
function
allDepartment
(
params
)
{
export
async
function
allDepartment
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/selectbox/depart`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysDepartment/query/selectbox/depart`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -53,77 +53,77 @@ export async function allDepartment(params) {
...
@@ -53,77 +53,77 @@ export async function allDepartment(params) {
//根据工厂id查询车间下拉
//根据工厂id查询车间下拉
export
async
function
shopSelectByFactory
(
params
)
{
export
async
function
shopSelectByFactory
(
params
)
{
return
request
(
`/wms/ngic-auth/sysShop/query/selectbox/factory`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysShop/query/selectbox/factory`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据车间id查询产线下拉
//根据车间id查询产线下拉
export
async
function
productionLineSelectByShop
(
params
)
{
export
async
function
productionLineSelectByShop
(
params
)
{
return
request
(
`/wms/ngic-auth/sysProductionLine/query/selectbox/shopId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysProductionLine/query/selectbox/shopId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据车间id集合查询产线下拉
//根据车间id集合查询产线下拉
export
async
function
productionLineSelectByShops
(
params
)
{
export
async
function
productionLineSelectByShops
(
params
)
{
return
request
(
`/wms/ngic-auth/sysProductionLine/query/selectbox/shopIds`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysProductionLine/query/selectbox/shopIds`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据车间id查询工段下拉
//根据车间id查询工段下拉
export
async
function
sectionSelectByShop
(
params
)
{
export
async
function
sectionSelectByShop
(
params
)
{
return
request
(
`/wms/ngic-auth/sysSection/query/selectbox/shopId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysSection/query/selectbox/shopId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据车间id集合查询工段下拉
//根据车间id集合查询工段下拉
export
async
function
sectionSelectByShops
(
params
)
{
export
async
function
sectionSelectByShops
(
params
)
{
return
request
(
`/wms/ngic-auth/sysSection/query/selectbox/shopIds`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysSection/query/selectbox/shopIds`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//授权前查询权限树
//授权前查询权限树
export
async
function
roleTree
(
params
)
{
export
async
function
roleTree
(
params
)
{
return
request
(
`/wms/ngic-auth/sysRolePermission/queryAll`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysRolePermission/queryAll`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//角色下权限数据
//角色下权限数据
export
async
function
adminDataqueryAll
(
params
)
{
export
async
function
adminDataqueryAll
(
params
)
{
return
request
(
`/wms/ngic-auth/sysRoleDataPermission/queryAll`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysRoleDataPermission/queryAll`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//不包含自己在内的全部用户下拉框
//不包含自己在内的全部用户下拉框
export
async
function
userSelect
(
params
)
{
export
async
function
userSelect
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUser/queryParentSelectionByUserId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysUser/queryParentSelectionByUserId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//全部用户下拉框
//全部用户下拉框
export
async
function
allUserSelect
(
params
)
{
export
async
function
allUserSelect
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUser/query/selectbox/company`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysUser/query/selectbox/company`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//根据工厂id查询树结构
//根据工厂id查询树结构
export
async
function
departmentTree
(
params
)
{
export
async
function
departmentTree
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/tree`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysDepartment/query/tree`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//查询角色下拉框
//查询角色下拉框
export
async
function
roleSelect
(
params
)
{
export
async
function
roleSelect
(
params
)
{
return
request
(
`/wms/ngic-auth/sysRole/queryAllSelectList`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysRole/queryAllSelectList`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -131,14 +131,14 @@ export async function roleSelect(params) {
...
@@ -131,14 +131,14 @@ export async function roleSelect(params) {
//查询角色下拉框---注册
//查询角色下拉框---注册
export
async
function
roleSelectRegister
(
params
)
{
export
async
function
roleSelectRegister
(
params
)
{
return
request
(
`/wms/ngic-auth/sysRole/queryAllSelectByComId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysRole/queryAllSelectByComId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//查询全部编号类型下拉框(登录人公司)
//查询全部编号类型下拉框(登录人公司)
export
async
function
bmNoRule
(
params
)
{
export
async
function
bmNoRule
(
params
)
{
return
request
(
`/wms/ngic-base-business/bmNoRule/querySelect`
,
{
return
request
(
`/wms
pro
/ngic-base-business/bmNoRule/querySelect`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -146,7 +146,7 @@ export async function bmNoRule(params) {
...
@@ -146,7 +146,7 @@ export async function bmNoRule(params) {
//根据物料查询产线下拉框
//根据物料查询产线下拉框
export
async
function
productionLineSelectByMaterieId
(
params
)
{
export
async
function
productionLineSelectByMaterieId
(
params
)
{
return
request
(
`/wms/ngic-auth/sysProductionLine/query/selectbox/materieId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysProductionLine/query/selectbox/materieId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -154,7 +154,7 @@ export async function productionLineSelectByMaterieId(params) {
...
@@ -154,7 +154,7 @@ export async function productionLineSelectByMaterieId(params) {
//根据物料查询班组下拉框
//根据物料查询班组下拉框
export
async
function
groupSelectByMaterieId
(
params
)
{
export
async
function
groupSelectByMaterieId
(
params
)
{
return
request
(
`/wms/ngic-auth/sysGroup/query/selectbox/materieId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysGroup/query/selectbox/materieId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -162,7 +162,7 @@ export async function groupSelectByMaterieId(params) {
...
@@ -162,7 +162,7 @@ export async function groupSelectByMaterieId(params) {
//根据物料查询班次下拉框
//根据物料查询班次下拉框
export
async
function
shiftSelectByMaterieId
(
params
)
{
export
async
function
shiftSelectByMaterieId
(
params
)
{
return
request
(
`/wms/ngic-auth/sysShift/query/selectbox/materieId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysShift/query/selectbox/materieId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
@@ -170,21 +170,21 @@ export async function shiftSelectByMaterieId(params) {
...
@@ -170,21 +170,21 @@ export async function shiftSelectByMaterieId(params) {
//根据车间id查询班次下拉框
//根据车间id查询班次下拉框
export
async
function
shiftSelectByShopId
(
params
)
{
export
async
function
shiftSelectByShopId
(
params
)
{
return
request
(
`/wms/ngic-auth/sysShift/query/selectbox/shopId`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysShift/query/selectbox/shopId`
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
}
}
//角色下拉框
//角色下拉框
export
async
function
roleList
(
params
)
{
export
async
function
roleList
(
params
)
{
return
request
(
`/wms/ngic-auth/sysRole/queryAllSelectList`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysRole/queryAllSelectList`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//集团下拉框
//集团下拉框
export
async
function
factory
(
params
)
{
export
async
function
factory
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/selectbox/factory`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysDepartment/query/selectbox/factory`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -193,21 +193,21 @@ export async function factory(params) {
...
@@ -193,21 +193,21 @@ export async function factory(params) {
// 4 :
// 4 :
//集团下拉框
//集团下拉框
export
async
function
zuzhi
(
params
)
{
export
async
function
zuzhi
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/tree`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysDepartment/query/tree`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//集团下拉框
//集团下拉框
export
async
function
depart
(
params
)
{
export
async
function
depart
(
params
)
{
return
request
(
`/wms/ngic-auth/sysDepartment/query/selectbox/depart`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysDepartment/query/selectbox/depart`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//集团下拉框
//集团下拉框
export
async
function
selectionBoxAll
(
params
)
{
export
async
function
selectionBoxAll
(
params
)
{
return
request
(
`/wms/ngic-auth/sysStore/selectionBoxAll`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysStore/selectionBoxAll`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -216,21 +216,21 @@ export async function selectionBoxAll(params) {
...
@@ -216,21 +216,21 @@ export async function selectionBoxAll(params) {
//下拉框---当前公司下
//下拉框---当前公司下
export
async
function
currentUserList
(
params
)
{
export
async
function
currentUserList
(
params
)
{
return
request
(
`/wms/ngic-auth/sysUser/query/selectbox/current/company`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysUser/query/selectbox/current/company`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//当前公司所有工厂下拉
//当前公司所有工厂下拉
export
async
function
allShop
(
params
)
{
export
async
function
allShop
(
params
)
{
return
request
(
`/wms/ngic-auth/sysShop/query/selectbox/current/company`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysShop/query/selectbox/current/company`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
}
}
//当前公司所有车间下拉
//当前公司所有车间下拉
export
async
function
allSection
(
params
)
{
export
async
function
allSection
(
params
)
{
return
request
(
`/wms/ngic-auth/sysSection/query/selectbox`
,
{
return
request
(
`/wms
pro
/ngic-auth/sysSection/query/selectbox`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -238,7 +238,7 @@ export async function allSection(params) {
...
@@ -238,7 +238,7 @@ export async function allSection(params) {
//查询全部编号类型下拉框(登录人公司)
//查询全部编号类型下拉框(登录人公司)
export
async
function
bmNoTypeadd
(
params
)
{
export
async
function
bmNoTypeadd
(
params
)
{
return
request
(
`/wms/ngic-base-business/bmNoType/querySelect`
,
{
return
request
(
`/wms
pro
/ngic-base-business/bmNoType/querySelect`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
@@ -246,7 +246,7 @@ export async function bmNoTypeadd(params) {
...
@@ -246,7 +246,7 @@ export async function bmNoTypeadd(params) {
//查询全部编号类型下拉框(登录人公司)
//查询全部编号类型下拉框(登录人公司)
export
async
function
bmNoType
(
params
)
{
export
async
function
bmNoType
(
params
)
{
return
request
(
`/wms/ngic-base-business/bmNoType/queryAllSelect`
,
{
return
request
(
`/wms
pro
/ngic-base-business/bmNoType/queryAllSelect`
,
{
method
:
'POST'
,
method
:
'POST'
,
data
:
params
,
data
:
params
,
});
});
...
...
src/utils/doFetch.js
View file @
5f64d2dc
...
@@ -11,7 +11,7 @@ export async function doFetch({ url, params }) {
...
@@ -11,7 +11,7 @@ export async function doFetch({ url, params }) {
if
(
!
url
){
if
(
!
url
){
return
return
}
}
return
request
(
"/wms"
+
url
,
{
return
request
(
"/wms
pro
"
+
url
,
{
method
:
"POST"
,
method
:
"POST"
,
data
:
params
,
data
:
params
,
});
});
...
...
src/utils/request.js
View file @
5f64d2dc
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
import
{
extend
}
from
"umi-request"
;
import
{
extend
}
from
"umi-request"
;
import
{
message
,
notification
,
Modal
}
from
"antd"
;
import
{
message
,
notification
,
Modal
}
from
"antd"
;
import
{
history
}
from
"umi"
;
import
{
history
}
from
"umi"
;
const
{
NODE_ENV
}
=
process
.
env
;
const
baseUrl
=
NODE_ENV
==
"development"
?
"/wmspro"
:
""
;
const
codeMessage
=
{
const
codeMessage
=
{
200
:
"服务器成功返回请求的数据。"
,
200
:
"服务器成功返回请求的数据。"
,
201
:
"新建或修改数据成功。"
,
201
:
"新建或修改数据成功。"
,
...
@@ -61,28 +62,67 @@ const request = extend({
...
@@ -61,28 +62,67 @@ const request = extend({
// request拦截器, 改变url 或 options.
// request拦截器, 改变url 或 options.
request
.
interceptors
.
request
.
use
(
async
(
url
,
options
)
=>
{
request
.
interceptors
.
request
.
use
(
async
(
url
,
options
)
=>
{
let
token
=
let
token
=
localStorage
.
getItem
(
"TOKEN_MES"
)
??
""
,
localStorage
.
getItem
(
"TOKEN_MES"
)
??
"9410b3f7de5d63f2be42d80ec8241d2d"
;
headers
=
{};
if
(
token
)
{
const
headers
=
if
(
NODE_ENV
==
"development"
&&
token
)
{
headers
=
options
.
type
==
"form"
options
.
type
==
"form"
?
{
?
{
token
:
token
,
Authorization
:
"Bearer "
+
token
,
}
}
:
{
:
{
"Content-Type"
:
"application/json"
,
"Content-Type"
:
"application/json"
,
Accept
:
"application/json"
,
Accept
:
"application/json"
,
token
:
token
,
Authorization
:
"Bearer "
+
token
,
};
}
else
{
headers
=
options
.
type
==
"form"
?
{}
:
{
"Content-Type"
:
"application/json"
,
Accept
:
"application/json"
,
};
};
return
{
url
:
url
,
options
:
{
...
options
,
headers
:
headers
},
};
}
}
return
{
url
:
baseUrl
+
url
,
options
:
{
...
options
,
headers
},
};
});
});
// response拦截器, 处理response
// response拦截器, 处理response
request
.
interceptors
.
response
.
use
(
async
(
response
,
options
)
=>
{
request
.
interceptors
.
response
.
use
(
async
(
response
,
options
)
=>
{
if
(
response
&&
response
.
status
)
{
const
errorText
=
codeMessage
[
response
.
status
]
||
response
.
statusText
;
const
{
status
,
url
}
=
response
;
if
(
response
?.
url
.
indexOf
(
"api/user_token"
)
==
-
1
&&
Object
.
keys
(
codeMessage
).
indexOf
(
String
(
response
.
status
))
>
-
1
)
{
notification
.
error
({
// message: `请求错误 ${status}: ${url}`,
description
:
errorText
,
});
}
if
(
status
==
"401"
)
{
clearCookie
();
}
if
(
status
==
"401"
||
status
==
"302"
||
status
==
"400"
)
{
if
(
NODE_ENV
==
"development"
)
{
}
else
{
window
.
location
.
href
=
"/"
;
}
}
}
else
if
(
!
response
)
{
if
(
response
?.
url
.
indexOf
(
"api/user_token"
)
==
-
1
)
{
notification
.
error
({
description
:
"您的网络发生异常,无法连接服务器"
,
message
:
"网络异常"
,
});
}
}
if
(
options
.
responseType
==
"blob"
)
{
if
(
options
.
responseType
==
"blob"
)
{
const
data
=
await
response
.
clone
().
blob
();
const
data
=
await
response
.
clone
().
blob
();
let
blobUrl
=
window
.
URL
.
createObjectURL
(
data
);
let
blobUrl
=
window
.
URL
.
createObjectURL
(
data
);
...
@@ -102,6 +142,7 @@ request.interceptors.response.use(async (response, options) => {
...
@@ -102,6 +142,7 @@ request.interceptors.response.use(async (response, options) => {
}
else
{
}
else
{
const
data
=
await
response
.
clone
().
json
();
const
data
=
await
response
.
clone
().
json
();
// 详情返回的response处理
// 详情返回的response处理
if
(
data
?.
code
!=
"0000"
)
{
if
(
data
?.
code
!=
"0000"
)
{
message
.
destroy
();
message
.
destroy
();
message
.
warn
(
data
?.
msg
);
message
.
warn
(
data
?.
msg
);
...
...
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