Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
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
Administrator
bkunyun
Commits
2c758df2
Commit
2c758df2
authored
Jun 14, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 文件服务器指向配置完成
parent
88a07105
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
8 deletions
+32
-8
raysyncApi.ts
src/api/fileserver/raysyncApi.ts
+7
-2
useMyRouter.ts
src/components/MyRouter/useMyRouter.ts
+3
-1
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+2
-0
index.tsx
src/views/Project/components/CurrentProject/index.tsx
+2
-0
project.ts
src/views/Project/project.ts
+18
-5
No files found.
src/api/fileserver/raysyncApi.ts
View file @
2c758df2
...
...
@@ -34,8 +34,13 @@ const API = function () {
// 文件服务器指向
const
APIOPTION
=
function
()
{
// todo isPrivatization
const
raysyncAddr
=
getLoaclStorageOfKey
(
"raysyncAddr"
);
return
raysyncAddr
.
fileServerEndPoint
||
""
;
let
fileServerEndPoint
=
localStorage
.
getItem
(
"fileServerEndPoint"
);
if
(
fileServerEndPoint
)
{
return
fileServerEndPoint
;
}
else
{
const
raysyncAddr
=
getLoaclStorageOfKey
(
"raysyncAddr"
);
return
raysyncAddr
.
fileServerEndPoint
||
""
;
}
};
// api端口号
...
...
src/components/MyRouter/useMyRouter.ts
View file @
2c758df2
import
{
useStores
}
from
"@/store/index"
;
import
{
elements
}
from
"@/router"
;
import
{
current
,
}
from
"@/api/demo_api"
;
import
{
current
}
from
"@/api/demo_api"
;
import
{
product
}
from
"@/api/project_api"
;
import
localStorageKey
from
"@/utils/localStorageKey"
;
...
...
@@ -8,6 +8,7 @@ import NotFound from "@/views/404";
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
useEffect
}
from
"react"
;
import
{
menu
}
from
"@/api/routes_api"
;
import
{
setFileServerEndPointLocalStorage
}
from
"@/views/Project/project"
;
const
useMyRouter
=
()
=>
{
const
{
permissionStore
,
menuStore
,
currentProjectStore
}
=
useStores
();
...
...
@@ -51,6 +52,7 @@ const useMyRouter = () => {
}
else
{
currentProjectStore
.
setProjectList
(
list
);
currentProjectStore
.
changeProject
(
list
[
0
]);
setFileServerEndPointLocalStorage
(
list
[
0
].
zoneId
);
}
}
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
2c758df2
...
...
@@ -28,6 +28,7 @@ import Loading from "@/views/Loading";
import
MyDialog
from
"@/components/mui/MyDialog"
;
import
{
getProjectList
}
from
"../../project"
;
import
{
checkIsNumberLetterChinese
}
from
"@/utils/util"
;
import
{
setFileServerEndPointLocalStorage
}
from
"@/views/Project/project"
;
type
zoneIdOption
=
{
id
:
string
;
...
...
@@ -147,6 +148,7 @@ const BaseInfo = observer(() => {
const
projectList
=
await
getProjectList
();
currentProjectStore
.
setProjectList
(
projectList
);
currentProjectStore
.
changeProject
(
projectList
[
0
]);
setFileServerEndPointLocalStorage
(
projectList
[
0
].
zoneId
);
setProjectInfo
(
projectList
[
0
]);
},
}
...
...
src/views/Project/components/CurrentProject/index.tsx
View file @
2c758df2
...
...
@@ -7,6 +7,7 @@ import ProjectListPopper from "../ProjectListPopper";
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
AddProject
from
"../AddProject"
;
import
{
setFileServerEndPointLocalStorage
}
from
"@/views/Project/project"
;
const
CurrentProject
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
...
...
@@ -31,6 +32,7 @@ const CurrentProject = observer(() => {
const
id
=
canBeOpen
?
"spring-popper"
:
undefined
;
const
handleChangeCurrentProject
=
(
project
:
any
)
=>
{
currentProjectStore
.
changeProject
(
project
);
setFileServerEndPointLocalStorage
(
project
.
zoneId
);
setProjectListOpen
(
!
projectListOpen
);
};
...
...
src/views/Project/project.ts
View file @
2c758df2
import
{
product
}
from
"@/api/project_api"
import
{
product
,
hpczone
}
from
"@/api/project_api"
;
export
const
getProjectList
=
async
()
=>
{
const
res
=
await
product
({
product
:
"CADD"
,})
return
res
.
data
}
\ No newline at end of file
const
res
=
await
product
({
product
:
"CADD"
});
return
res
.
data
;
};
export
const
setFileServerEndPointLocalStorage
=
async
(
zoneId
:
string
)
=>
{
const
res
=
await
hpczone
();
console
.
log
(
res
);
let
fileServerEndPoint
=
""
;
if
(
Array
.
isArray
(
res
))
{
res
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
id
===
zoneId
)
{
fileServerEndPoint
=
item
.
storageConfig
.
fileServerEndPoint
;
}
});
localStorage
.
setItem
(
"fileServerEndPoint"
,
fileServerEndPoint
);
}
};
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