pushdeer/quickapp/src/helper/apis/example.js

21 lines
589 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import $ajax from '../ajax'
/**
* @desc 在实际开发中,您可以将 baseUrl 替换为您的请求地址前缀;
*
* 已将 $apis 挂载在 global您可以通过如下方式进行调用
* $apis.example.getApi().then().catch().finally()
*
* 备注:如果您不需要发起请求,删除 apis 目录,以及 app.ux 中引用即可;
*/
const baseUrl = 'https://api.exampel.com/'
export default {
getApi(data) {
return $ajax.get(`${baseUrl}your-project-api`, data)
},
postOtherApi(data) {
return $ajax.post(`${baseUrl}your-project-api`, data)
}
}