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.
60 lines
1.2 KiB
JavaScript
60 lines
1.2 KiB
JavaScript
import {
|
|
$post
|
|
} from '@/lu/axios.js'
|
|
import $config from '@/config.js'
|
|
const app_path = 'App'
|
|
let url = ''
|
|
let gzh = {
|
|
id: '',
|
|
jump: '',
|
|
auth: ''
|
|
}
|
|
const urlPick = () => {
|
|
if ($config.config.length > 0) {
|
|
url = $config.config[0].url
|
|
gzh = $config.config[0].gzh
|
|
for (let i in $config.config) {
|
|
if (!!$config.config[i].active) {
|
|
url = $config.config[i].url
|
|
gzh = $config.config[i].gzh
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
urlPick()
|
|
|
|
export const GzhConfig = gzh
|
|
export const WeChatPayPayTestAction = async (data) => await $post({
|
|
url: `${url}/api/Test/WeChatPay/pay_test`,
|
|
data
|
|
})
|
|
export const WeChatLoginTestAction = async (data) => await $post({
|
|
url: `${url}/api/Test/WeChat/login_test`,
|
|
data
|
|
})
|
|
export const yo = async (data) => await $post({
|
|
url: `${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()
|
|
}
|
|
} |