diff --git a/api/index.js b/api/index.js index 07aefdf..7517c3a 100644 --- a/api/index.js +++ b/api/index.js @@ -6,3 +6,18 @@ export const yo = async (data) => await $post({ url: 'YO', data }) + +export const $image = (path) => { + return `${url_}${path}` +} + +export const $response = (response, then, error = () => {}) => { + if (response) { + if (response.code != 200) { + uni.$lu.toast(response.message); + error() + return + } + then() + } +}