Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
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
黄庭坚
jinfa-platform
Commits
f64ab8b4
Commit
f64ab8b4
authored
Jul 26, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
1fd98be8
2de77c37
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
30 deletions
+4
-30
app.tsx
src/app.tsx
+2
-29
api.ts
src/services/api.ts
+1
-1
request.ts
src/utils/request.ts
+1
-0
No files found.
src/app.tsx
View file @
f64ab8b4
...
...
@@ -86,8 +86,8 @@ export function render(oldRender: Function) {
PublicApi
.
getMemberLoginReget
().
then
(
res
=>
{
const
{
data
,
code
}
=
res
if
(
code
===
1000
)
{
setAuth
(
data
)
setRouters
(
data
.
urls
)
setAuth
(
data
as
any
)
setRouters
(
data
.
auth
as
any
)
}
else
{
removeAuth
()
removeRouters
()
...
...
@@ -113,7 +113,6 @@ export function render(oldRender: Function) {
* @param {*} { routes, matchedRoutes, location, action }
*/
export
function
onRouteChange
({
routes
,
matchedRoutes
,
location
,
action
})
{
console
.
log
(
'onRouteChange'
)
// 路由切换时, 自动回到顶部
document
.
body
.
scrollTop
=
document
.
documentElement
.
scrollTop
=
0
;
if
(
location
.
pathname
.
includes
(
"memberCenter"
))
{
...
...
@@ -183,31 +182,5 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
* @returns
*/
export
function
rootContainer
(
container
:
any
)
{
// return React.createElement(MobxProvider, null, container);
return
<
MobxProvider
>
{
container
}
</
MobxProvider
>
}
/**
* 用于个性化接口数据返回格式
* @todo 由于要开启useRequest hooks 目前没找到应用该请求的最佳实践,建议不用开启这个配置
*/
// export const request: RequestConfig = {
// errorConfig: {
// adaptor(resData) {
// return {
// ...resData,
// code: resData.ok,
// }
// }
// },
// middlewares: [
// async function printRequest(ctx, next) {
// console.log('发起了请求')
// console.log(ctx)
// await next()
// }
// ],
// requestInterceptors: [],
// responseInterceptors: []
// }
src/services/api.ts
View file @
f64ab8b4
import
*
as
LogisticsApi
from
'./LogisticsApi'
import
*
as
PassApi
from
'./PassApi'
import
*
as
WarehouseApi
from
'./WarehouseApi'
import
*
as
MemberApi
from
'./
m
emberApi'
import
*
as
MemberApi
from
'./
M
emberApi'
import
*
as
ProductApi
from
'./ProductApi'
import
*
as
TemplateApi
from
'./TemplateApi'
import
*
as
PayApi
from
'./PayApi'
...
...
src/utils/request.ts
View file @
f64ab8b4
...
...
@@ -16,6 +16,7 @@ export interface IApiRequest extends RequestOptionsInit {
// 可以用于扩展请求配置
extendsOptions
?:
RequestOptionsInit
}
/**
*
* umi-request文档 https://github.com/umijs/umi-request/blob/master/README_zh-CN.md
...
...
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