Skip to content

Commit

Permalink
fix(server-client): update appid instead app._id
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Sep 2, 2021
1 parent c5d6bc0 commit 0aa9288
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/system-client/src/api/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ export function getMyApplications() {
method: 'get'
})
}

/**
* 根据 appid 获取应用
* @param {string} appid
* @returns { Application } 返回应用数据
*/
export async function getApplicationByAppid(appid) {
const res = await request({
url: `/apps/${appid}`,
method: 'get'
})

return res
}
40 changes: 40 additions & 0 deletions packages/system-client/src/api/func.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
import request from '@/utils/request'

/**
* 分页获取云函数列表
* @param {*} query
* @param {*} page
* @param {*} pageSize
*/
export function getFunctions(appid, query, page, pageSize) {
return request({
url: `/apps/${appid}/function`,
method: 'get',
params: {
...query,
page,
limit: pageSize
}
})
}

/**
* Create a cloud function
* @param {string} appid
* @param {object} function_data
* @returns
*/
export function createFunction(appid, function_data) {
return request({
url: `/apps/${appid}/function/create`,
method: 'post',
data: function_data
})
}

export function updateFunction(appid, function_data) {
return request({
url: `/apps/${appid}/function/create`,
method: 'post',
data: function_data
})
}

/**
* 运行云函数
*/
Expand Down

0 comments on commit 0aa9288

Please sign in to comment.