You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
580 B
JavaScript

import {
$post
} from '@/lu/axios.js'
import $config from '@/config.js'
export const yo = async (data) => await $post({
url: `${$config.url}/api/yo`,
data
})
export const $image = (path) => {
const path_ret = ['http://', 'https://', ';base64,']
for (let i = 0; i < path_ret.length; i++) {
if (path.indexOf(path_ret[i]) !== -1) {
return path
}
}
return `${$config.url}${path}`
}
export const $response = (response, then, error = () => {}) => {
if (response) {
if (response.code != 200) {
uni.$lu.toast(response.message);
error()
return
}
then()
}
}