add make_bgurl(image)
This commit is contained in:
parent
5c1b5a05b1
commit
80fc62e602
17
unitool.js
17
unitool.js
@ -154,6 +154,10 @@ export default {
|
|||||||
return `${protocol}://${hostname}${port ? ':' : ''}${port}/${route}`
|
return `${protocol}://${hostname}${port ? ':' : ''}${port}/${route}`
|
||||||
},
|
},
|
||||||
|
|
||||||
|
make_bgurl (image) {
|
||||||
|
return image ? `url(${this.make_server_url(image)})` : ''
|
||||||
|
},
|
||||||
|
|
||||||
/** 统一 uni.request 和 uniCloud.callFunction 的调用方法,提供统一、透明的后台调用
|
/** 统一 uni.request 和 uniCloud.callFunction 的调用方法,提供统一、透明的后台调用
|
||||||
* 返回值:{ _state, 成功结果或错误结果 },其中 _state 除了后台返回的,还可以是
|
* 返回值:{ _state, 成功结果或错误结果 },其中 _state 除了后台返回的,还可以是
|
||||||
* - CLIENT_WOBASE_BROKEN: 前端发现后台断线
|
* - CLIENT_WOBASE_BROKEN: 前端发现后台断线
|
||||||
@ -172,10 +176,13 @@ export default {
|
|||||||
const thisRoute = getCurrentPages()?.pop?.()?.route || 'VueApp' // 立刻保存 route,因为在调用后台后,可能已切换到了其他页面。
|
const thisRoute = getCurrentPages()?.pop?.()?.route || 'VueApp' // 立刻保存 route,因为在调用后台后,可能已切换到了其他页面。
|
||||||
const startTime = new Date().toJSON()
|
const startTime = new Date().toJSON()
|
||||||
let apiurl = undefined
|
let apiurl = undefined
|
||||||
apiWhat._clientInfo = globalThis.wo?.envar?.clientInfo
|
apiWhat._clientInfo = {
|
||||||
|
...globalThis.wo?.envar?.clientInfo,
|
||||||
|
lang: globalThis.wo?.ss?.i18n?.mylang,
|
||||||
// #ifdef WEB
|
// #ifdef WEB
|
||||||
Object.assign(apiWhat._clientInfo, { requrl: globalThis.location?.href, lang: globalThis.wo?.ss?.i18n?.mylang })
|
requrl: globalThis.location?.href
|
||||||
// #endif
|
// #endif
|
||||||
|
}
|
||||||
apiWhat._passtoken = uni.getStorageSync('_passtoken')
|
apiWhat._passtoken = uni.getStorageSync('_passtoken')
|
||||||
let result = {}
|
let result = {}
|
||||||
if (baseType === 'UNICLOUD_OBJECT') {
|
if (baseType === 'UNICLOUD_OBJECT') {
|
||||||
@ -513,7 +520,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
showModal (option) {
|
showModal (option = {}) {
|
||||||
|
option.title = this.localizeText(option.title)
|
||||||
|
option.content = this.localizeText(option.content)
|
||||||
|
option.cancelText = this.localizeText(option.cancelText || { zhCN: '取消', enUS: 'Cancel' })
|
||||||
|
option.confirmText = this.localizeText(option.confirmText || { zhCN: '好的', enUS: 'OK' })
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
if (option.content) option.content = '\n' + option.content
|
if (option.content) option.content = '\n' + option.content
|
||||||
// #endif
|
// #endif
|
||||||
|
Loading…
Reference in New Issue
Block a user