Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OKR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanfeng zhang
OKR
Commits
75dc9b12
Commit
75dc9b12
authored
Sep 04, 2021
by
hanfeng zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
321
parent
7f77054c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
8 deletions
+54
-8
base.ts
src/service/base.ts
+7
-2
index.ts
src/service/index.ts
+2
-0
Department.ts
src/service/moudles/Department.ts
+25
-0
Enterprise.ts
src/service/moudles/Enterprise.ts
+2
-2
service.dto.ts
src/service/moudles/service.dto.ts
+8
-2
index.ts
src/util/Sign/index.ts
+2
-2
team-frame.vue
src/views/team/team-frame.vue
+8
-0
No files found.
src/service/base.ts
View file @
75dc9b12
...
@@ -4,12 +4,17 @@ import axios, { AxiosInstance } from "axios"
...
@@ -4,12 +4,17 @@ import axios, { AxiosInstance } from "axios"
import
router
from
'@/router'
import
router
from
'@/router'
import
{
Toast
}
from
'vant'
import
{
Toast
}
from
'vant'
import
{
generateToken
}
from
"@/util/Sign"
;
const
Account
=
{
entId
:
'166910771849072640'
,
staffId
:
'1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR'
}
interface
RouterConfig
{
interface
RouterConfig
{
path
:
string
path
:
string
method
?:
string
method
?:
string
crediential
?:
boolean
crediential
?:
boolean
dataType
?:
string
headers
?:
string
[][]
headers
?:
string
[][]
}
}
export
default
class
BaseService
{
export
default
class
BaseService
{
...
@@ -32,7 +37,7 @@ export default class BaseService {
...
@@ -32,7 +37,7 @@ export default class BaseService {
let
token
;
let
token
;
let
headerItems
:{[
key
:
string
]:
string
|
number
}
=
{}
let
headerItems
:{[
key
:
string
]:
string
|
number
}
=
{}
if
(
!
routerConfig
.
method
)
routerConfig
.
method
=
'post'
if
(
!
routerConfig
.
method
)
routerConfig
.
method
=
'post'
if
(
routerConfig
.
crediential
)
token
=
'MOCK'
if
(
routerConfig
.
crediential
)
token
=
"MOCK"
switch
(
routerConfig
.
method
){
switch
(
routerConfig
.
method
){
case
'post'
:
case
'post'
:
routerConfig
.
crediential
&&
Object
.
assign
(
headerItems
,{
'FZM-SIGNATURE'
:
token
})
routerConfig
.
crediential
&&
Object
.
assign
(
headerItems
,{
'FZM-SIGNATURE'
:
token
})
...
...
src/service/index.ts
View file @
75dc9b12
import
Department
from
'./moudles/Department'
import
Enterprise
from
'./moudles/Enterprise'
import
Enterprise
from
'./moudles/Enterprise'
import
Staff
from
'./moudles/Staff'
import
Staff
from
'./moudles/Staff'
export
const
service
=
{
export
const
service
=
{
staff
:
new
Staff
(),
staff
:
new
Staff
(),
enterprise
:
new
Enterprise
(),
enterprise
:
new
Enterprise
(),
department
:
new
Department
(),
}
}
...
...
src/service/moudles/Department.ts
View file @
75dc9b12
import
BaseService
from
'../base'
import
{
AcceptJoinDTO
,
GetSub
}
from
'./service.dto'
export
default
class
Enterprise
extends
BaseService
{
router
=
{
getsub
:{
path
:
'/v1/department/get-sub-dep'
,
crediential
:
true
}
}
constructor
(){
super
()
}
/**
* @param {AcceptJoinDTO} data {AcceptJoinDTO}
* @returns
*/
async
getSub
(
data
:
GetSub
){
return
await
this
.
useService
(
this
.
router
.
getsub
,
data
)
}
}
src/service/moudles/Enterprise.ts
View file @
75dc9b12
import
BaseService
from
'../base'
import
BaseService
from
'../base'
import
{
AcceptJoinDTO
}
from
'./
Enterpris
e.dto'
import
{
AcceptJoinDTO
}
from
'./
servic
e.dto'
export
default
class
Enterprise
extends
BaseService
{
export
default
class
Enterprise
extends
BaseService
{
router
=
{
router
=
{
accept
:{
path
:
'/v1/enterprise/accept-join'
,
headers
:[[
'df'
,
'1'
]
,[
'sdfsdfl'
,
'dsfsd'
]
]},
accept
:{
path
:
'/v1/enterprise/accept-join'
,
headers
:[[
'df'
,
'1'
]]},
create
:{
path
:
'/v1/enterprise/create'
},
create
:{
path
:
'/v1/enterprise/create'
},
delete
:{
path
:
'/v1/enterprise/delete'
},
delete
:{
path
:
'/v1/enterprise/delete'
},
info
:{
path
:
'/v1/enterprise/info'
},
info
:{
path
:
'/v1/enterprise/info'
},
...
...
src/service/moudles/
Enterpris
e.dto.ts
→
src/service/moudles/
servic
e.dto.ts
View file @
75dc9b12
...
@@ -10,4 +10,11 @@ export interface AcceptJoinDTO{
...
@@ -10,4 +10,11 @@ export interface AcceptJoinDTO{
"phone"
:
string
,
"phone"
:
string
,
"position"
:
string
"position"
:
string
}
}
\ No newline at end of file
export
interface
GetSub
{
"entId"
:
string
,
"hasStaff"
?:
boolean
,
"isDirect"
?:
boolean
,
"parentId"
:
string
}
src/util/Sign/index.ts
View file @
75dc9b12
...
@@ -28,9 +28,9 @@ export interface Account {
...
@@ -28,9 +28,9 @@ export interface Account {
mnemonic
?:
string
mnemonic
?:
string
address
:
string
address
:
string
privateKey
:
Uint8Array
privateKey
:
Uint8Array
privateKeyHex
:
string
privateKeyHex
?
:
string
publicKey
:
Uint8Array
publicKey
:
Uint8Array
publicKeyHex
:
string
publicKeyHex
?
:
string
}
}
...
...
src/views/team/team-frame.vue
View file @
75dc9b12
...
@@ -61,6 +61,14 @@ export default Vue.extend({
...
@@ -61,6 +61,14 @@ export default Vue.extend({
// console.log(Mock, 'mock')
// console.log(Mock, 'mock')
this
.
showRadio
=
this
.
$route
.
query
.
transfer
===
'1'
this
.
showRadio
=
this
.
$route
.
query
.
transfer
===
'1'
},
},
mounted
(){
let
res
=
this
.
$service
.
department
.
getSub
({
entId
:
'166910771849072640'
,
parentId
:
'166910771849072641'
})
console
.
log
(
res
);
},
data
()
{
data
()
{
return
{
return
{
title
:
'导航'
,
title
:
'导航'
,
...
...
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