Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
周志凯
/
auth-manage
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 88c50f9d
authored
Jun 03, 2020
by
周志凯
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: add other api
1 parent
c9673388
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
8 deletions
src/api/app.api.ts
src/api/menu.api.ts
src/layouts/PageLayout.tsx
src/pages/SystemSetting/index.tsx
src/setupProxy.js
src/api/app.api.ts
0 → 100644
View file @
88c50f9
import
request
from
'./request'
;
const
SystemApiUrl
=
'/oauthSystems/'
;
interface
queryParameter
{
page
?:
number
pageSize
?:
number
}
interface
createData
{
name
:
string
description
:
string
}
/**
* 获取系统列表
*/
export
const
getSystemList
=
(
query
?:
queryParameter
)
=>
{
return
request
({
url
:
SystemApiUrl
,
method
:
'get'
,
params
:
query
})
}
/**
* 添加系统列表
*/
export
const
createSystem
=
(
data
:
createData
)
=>
{
return
request
({
url
:
SystemApiUrl
,
method
:
'post'
,
data
})
}
/**
* 删除系统
*/
export
const
deleteSystem
=
(
id
:
string
)
=>
{
return
request
({
url
:
SystemApiUrl
,
method
:
'delete'
})
}
src/api/menu.api.ts
0 → 100644
View file @
88c50f9
import
request
from
'./request'
;
const
MenuApiUrl
=
'/oauthMenus/'
;
interface
SystemQueryProp
{
systemId
:
string
}
interface
AppQueryProp
{
serviceId
:
string
}
interface
UserQueryProp
{}
interface
createData
{
systemId
:
string
parentId
?:
string
name
:
string
note
:
string
path
:
string
icon
:
string
type
:
number
}
/**
* 获取系统菜单列表
*/
export
const
getSystemMenuList
=
(
query
:
SystemQueryProp
)
=>
{
return
request
({
url
:
`
${
MenuApiUrl
}
/getMenusBySystemId`
,
method
:
'get'
,
params
:
query
})
}
/**
* 获取应用菜单列表
*/
export
const
getAppMenuList
=
(
query
:
AppQueryProp
)
=>
{
return
request
({
url
:
`
${
MenuApiUrl
}
/getMenusByServiceId`
,
method
:
'get'
,
params
:
query
})
}
/**
* 获取用户菜单列表
*/
export
const
getUserMenuList
=
(
query
:
UserQueryProp
)
=>
{
return
request
({
url
:
`
${
MenuApiUrl
}
/getMenusByUser`
,
method
:
'get'
,
params
:
query
})
}
/**
* 添加菜单
*/
export
const
createMenu
=
(
data
:
createData
)
=>
{
return
request
({
url
:
MenuApiUrl
,
method
:
'post'
,
data
})
}
/**
* 删除系统
*/
export
const
deleteMenu
=
(
id
:
string
)
=>
{
return
request
({
url
:
`
${
MenuApiUrl
}
/
${
id
}
`
,
method
:
'delete'
})
}
src/layouts/PageLayout.tsx
View file @
88c50f9
import React, { FC } from 'react';
import { Layout, Menu
, Breadcrumb
} from 'antd';
import { Layout, Menu } from 'antd';
import {
Link,
Switch,
...
...
@@ -36,12 +36,12 @@ const PageLayout:FC<PageLayoutProp & RouteComponentProps> = () => (
))}
</Menu>
</Sider>
<Layout style={{ padding: '
0
24px 24px' }}>
<Breadcrumb style={{ margin: '16px 0' }}>
<Layout style={{ padding: '24px 24px' }}>
{/*
<Breadcrumb style={{ margin: '16px 0' }}>
<Breadcrumb.Item>Home</Breadcrumb.Item>
<Breadcrumb.Item>List</Breadcrumb.Item>
<Breadcrumb.Item>App</Breadcrumb.Item>
</Breadcrumb>
</Breadcrumb>
*/}
<Content
className="site-layout-background"
style={{
...
...
src/pages/SystemSetting/index.tsx
View file @
88c50f9
...
...
@@ -58,8 +58,8 @@ interface SystemSettingProp {}
const SystemSetting: FC<SystemSettingProp> = () => {
const initData = useCallback(async () => {
try {
const
data
= await getSystemList()
console.log('initData',
data
)
const
result
= await getSystemList()
console.log('initData',
result
)
} catch (error) {
console.error(error)
}
...
...
src/setupProxy.js
View file @
88c50f9
const
{
createProxyMiddleware
}
=
require
(
'http-proxy-middleware'
);
module
.
exports
=
(
app
)
=>
{
module
.
exports
=
function
(
app
)
{
app
.
use
(
createProxyMiddleware
(
'/api'
,
{
target
:
`http://192.168.9.115:8080`
,
changeOrigin
:
true
changeOrigin
:
true
,
pathRewrite
:
{
'^/api'
:
''
}
})
)
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment