Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
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
fengzhaoyu
schedule
Commits
701c5b77
Commit
701c5b77
authored
Feb 11, 2020
by
liang ce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加api文件
parent
1f994fe3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
234 additions
and
0 deletions
+234
-0
http.js
api/http.js
+51
-0
login.js
api/login.js
+29
-0
request.js
api/request.js
+154
-0
No files found.
api/http.js
0 → 100644
View file @
701c5b77
import
{
login
}
from
'./login'
export
default
function
http
(
data
)
{
if
(
getApp
().
globalData
.
token
!==
''
)
{
return
new
Promise
((
resolve
,
rejects
)
=>
{
console
.
log
(
data
)
dd
.
httpRequest
({
headers
:
{
// "Content-Type": `${ data.method === 'POST' ? 'application/x-www-form-urlencoded' : 'application/json' }`,
"Content-Type"
:
'application/json;charset=UTF-8'
,
"Authorization"
:
`Bearer
${
getApp
().
globalData
.
token
}
`
},
url
:
`
${
getApp
().
globalData
.
globalUrl
}${
data
.
url
}
`
,
method
:
data
.
method
,
dataType
:
'json'
,
data
:
data
.
data
,
success
:
function
(
res
)
{
resolve
(
res
)
},
fail
:
function
(
res
)
{
console
.
log
(
res
)
}
})
})
}
else
{
return
new
Promise
((
resolve
,
rejects
)
=>
{
login
().
then
(
res
=>
{
getApp
().
globalData
.
token
=
res
.
data
.
data
.
accessToken
.
access_token
//'3a025eee-15ae-4805-9214-fe0599d47f17' //
getApp
().
globalData
.
name
=
res
.
data
.
data
.
oapiUser
.
name
getApp
().
globalData
.
userid
=
res
.
data
.
data
.
oapiUser
.
userid
getApp
().
globalData
.
avatar
=
res
.
data
.
data
.
oapiUser
.
avatar
dd
.
httpRequest
({
headers
:
{
"Content-Type"
:
"application/json"
,
"Authorization"
:
`Bearer
${
getApp
().
globalData
.
token
}
`
},
url
:
`
${
getApp
().
globalData
.
globalUrl
}${
data
.
url
}
`
,
method
:
data
.
method
,
data
:
data
.
data
,
dataType
:
'json'
,
success
:
function
(
res
)
{
resolve
(
res
)
},
fail
:
function
(
res
)
{
console
.
log
(
res
)
}
})
})
})
}
}
\ No newline at end of file
api/login.js
0 → 100644
View file @
701c5b77
export
function
login
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
dd
.
getAuthCode
({
success
:
function
(
res
){
// 获取用户信息
dd
.
httpRequest
({
headers
:
{
"Content-Type"
:
"application/json"
,
"Authorization"
:
`Basic bWVldGluZy13ZWI6bWVldGluZy13ZWI=`
},
url
:
`
${
getApp
().
globalData
.
globalUrl
}
/admin/skipAuth/getUserInfoByDingtalkCode?orgId=
${
dd
.
corpId
}
&projectName=MING_MEETING&code=
${
res
.
authCode
}
`
,
method
:
'POST'
,
dataType
:
'json'
,
success
:
function
(
res
)
{
resolve
(
res
)
},
fail
:
function
(
res
)
{
resolve
(
res
)
console
.
log
(
'err'
,
res
)
}
})
},
fail
:
function
(
err
)
{
console
.
log
(
err
)
}
})
})
}
\ No newline at end of file
api/request.js
0 → 100644
View file @
701c5b77
const
app
=
getApp
()
import
$http
from
'./http'
// 获取创建会议室的会议室列表
export
function
getMeetingRoom
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$http
({
method
:
'get'
,
data
:
data
,
url
:
'/meet/meeting-room/page'
,
}).
then
(
res
=>
{
resolve
(
res
)
}).
catch
(
err
=>
{
console
.
log
(
res
)
})
})
}
export
function
getMeetingGlobalSetting
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$http
({
method
:
'get'
,
data
:
data
,
url
:
'/meet/meeting-global-setting/get'
,
}).
then
(
res
=>
{
resolve
(
res
)
})
})
}
// 获取会议室分类
// 办公区域
// OFFICE_LOCATION(0,"meeting_room_location")
// 会议室设施
// OFFICE_FACILITY(1,"meeting_room_facility")
// 会议室分类
// OFFICE_CATEGORY(2,"meeting_room_category")
export
function
getLabelTree
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$http
({
method
:
'get'
,
data
:
data
,
url
:
'/admin/label/tree'
,
}).
then
(
res
=>
{
resolve
(
res
)
})
})
}
// 更新办公区域,设施,分类
export
function
getMettingRoomLabelUpdate
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$http
({
method
:
'POST'
,
data
:
JSON
.
stringify
(
data
),
url
:
'/admin/label/update'
,
}).
then
(
res
=>
{
resolve
(
res
)
})
})
}
// 添加办公区域、会议室分类、会议室设置
export
function
getMettingRoomLabelSave
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
$http
({
method
:
'POST'
,
data
:
JSON
.
stringify
(
data
),
url
:
'/admin/label/save'
,
}).
then
(
res
=>
{
resolve
(
res
)
})
})
}
// 删除办公区域、会议室分类、会议室设置
export
function
getMettingRoomLabelRemove
(
data
)
{
return
$http
({
method
:
'get'
,
data
:
data
,
url
:
`/admin/label/remove/
${
data
}
`
,
})
}
// 删除会议室
export
function
getRemoveMeetingRoom
(
data
)
{
return
$http
({
method
:
'get'
,
data
:
''
,
url
:
`/meet/meeting-room/remove/
${
data
}
`
,
})
}
// 创建会议室
export
function
saveMettingRoom
(
data
)
{
return
$http
({
method
:
'post'
,
data
:
JSON
.
stringify
(
data
),
url
:
'/meet/meeting-room/save'
,
})
}
// 修改会议室
export
function
mettingRoomUpdate
(
data
)
{
return
$http
({
method
:
'post'
,
data
:
JSON
.
stringify
(
data
),
url
:
'/meet/meeting-room/update'
,
})
}
// 获取会议室详情
export
function
getMeetingRoomVOByUuid
(
data
)
{
return
$http
({
method
:
'get'
,
data
:
''
,
url
:
`/meet/meeting-room/getMeetingRoomVOByUuid/
${
data
}
`
,
})
}
// 获取我的会议
export
function
myMeetingPage
(
data
)
{
return
$http
({
method
:
'post'
,
data
:
JSON
.
stringify
(
data
),
url
:
'/meet/meeting/myPage'
,
})
}
// 获取预定会议室列表
export
function
getReserveRoomList
(
data
)
{
return
$http
({
method
:
'post'
,
data
:
JSON
.
stringify
(
data
),
url
:
'/meet/meeting-room/queryMeetingRoomAndOccupyTimeSlot'
,
})
}
// 获取预定会议详情
export
function
getMyMeetingDetails
(
data
)
{
return
$http
({
method
:
'get'
,
data
:
''
,
url
:
`/meet/meeting/
${
data
}
`
,
})
}
// 修改预定时间设置
export
function
updateGlobalSetting
(
data
)
{
return
$http
({
method
:
'post'
,
data
:
JSON
.
stringify
(
data
),
url
:
`/meet/meeting-global-setting/update`
})
}
// 获取首页信息
export
function
getHomeUserSchedule
(
data
)
{
return
$http
({
method
:
'post'
,
data
:
'{}'
,
url
:
`/meet/schedule/getHomeUserSchedule `
})
}
\ No newline at end of file
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