Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
胡锦波
/
org-manager-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e9b06f58
authored
Apr 11, 2022
by
胡锦波
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1. init companyservice 替换
parent
579d89ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
2 deletions
src/api/company-service.ts
src/api/core.ts
src/views/pages/employ-management/address-book/address-book.vue
vue.config.js
src/api/company-service.ts
0 → 100644
View file @
e9b06f58
import
BaseService
from
"@/api/core"
;
class
CompanyService
extends
BaseService
{
public
constructor
()
{
super
();
}
public
getDepartment
(
comid
:
string
)
{
this
.
getWithCompanyToken
(
`/v1/companies/
${
comid
}
/departments/all`
);
}
}
const
companyService
=
new
CompanyService
();
export
default
companyService
;
src/api/core.ts
View file @
e9b06f58
import
EnterpriseHost
from
"@/views/service/enterprise-host"
;
import
Axios
,
{
AxiosRequestConfig
}
from
"axios"
;
import
qs
from
'qs'
;
import
{
getAuditorInfo
}
from
'./auditor'
;
...
...
@@ -194,11 +195,11 @@ export default abstract class BaseService {
}
protected
async
buildCompanyToken2Config
(
config
?:
AxiosRequestConfig
)
{
const
comid
=
EnterpriseHost
.
getPoid
();
config
=
this
.
buildRequestConfig
(
config
);
if
(
config
.
headers
)
{
config
.
headers
[
this
.
authKey
]
=
await
TokenManager
.
getCompanyToken
(
this
.
onceCompanyI
d
);
config
.
headers
[
this
.
teammixAuthKey
]
=
await
TokenManager
.
getCompanyToken
(
comi
d
);
}
this
.
onceCompanyId
=
0
;
return
this
.
checkContentType
(
config
);
}
...
...
src/views/pages/employ-management/address-book/address-book.vue
View file @
e9b06f58
...
...
@@ -11,6 +11,7 @@
import
{
TokenManager
}
from
"@/api/token"
;
import
EnterpriseHost
from
"@/views/service/enterprise-host"
;
import
{
sdkService
}
from
"@/api/sdk-service"
;
import
companyService
from
"@/api/company-service"
;
@
Component
({
components
:
{}
})
export
default
class
AddressBook
extends
Vue
{
...
...
@@ -18,6 +19,7 @@
sdkService
.
getJoinedList
();
const
comid
=
EnterpriseHost
.
getPoid
();
TokenManager
.
getCompanyToken
(
comid
);
companyService
.
getDepartment
(
comid
);
}
}
</
script
>
...
...
vue.config.js
View file @
e9b06f58
...
...
@@ -14,6 +14,15 @@ module.exports = {
port
:
8080
,
https
:
false
,
hotOnly
:
false
,
proxy
:
{
"/v1/companies"
:
{
target
:
"http://106.120.107.150:7771"
,
changeOrigin
:
true
,
},
},
headers
:
{
"Access-Control-Allow-Origin"
:
"*"
}
},
chainWebpack
:
config
=>
{
...
...
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