提交 867b3c6d 编写于 作者: Q qiang

fix: 修改部分中文报错信息

上级 0be095bf
...@@ -20,9 +20,9 @@ export function getProvider ({ ...@@ -20,9 +20,9 @@ export function getProvider ({
isFn(success) && success(res) isFn(success) && success(res)
} else { } else {
res = { res = {
errMsg: 'getProvider:fail:服务[' + service + ']不存在' errMsg: 'getProvider:fail service not found'
} }
isFn(fail) && fail(res) isFn(fail) && fail(res)
} }
isFn(complete) && complete(res) isFn(complete) && complete(res)
} }
...@@ -19,7 +19,7 @@ function createTodoApi (name) { ...@@ -19,7 +19,7 @@ function createTodoApi (name) {
complete complete
}) { }) {
const res = { const res = {
errMsg: `${name}:fail:暂不支持 ${name} 方法` errMsg: `${name}:fail method '${name}' not supported`
} }
isFn(fail) && fail(res) isFn(fail) && fail(res)
isFn(complete) && complete(res) isFn(complete) && complete(res)
......
...@@ -35,7 +35,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k ...@@ -35,7 +35,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
keyOption = keyOption(fromArgs[key], fromArgs, toArgs) keyOption = keyOption(fromArgs[key], fromArgs, toArgs)
} }
if (!keyOption) { // 不支持的参数 if (!keyOption) { // 不支持的参数
console.warn(`__PLATFORM_TITLE__ ${methodName}暂不支持${key}`) console.warn(`The '${methodName}' method of platform '__PLATFORM_TITLE__' does not support option '${key}'`)
} else if (isStr(keyOption)) { // 重写参数 key } else if (isStr(keyOption)) { // 重写参数 key
toArgs[keyOption] = fromArgs[key] toArgs[keyOption] = fromArgs[key]
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
...@@ -70,7 +70,7 @@ export default function wrapper (methodName, method) { ...@@ -70,7 +70,7 @@ export default function wrapper (methodName, method) {
const protocol = protocols[methodName] const protocol = protocols[methodName]
if (!protocol) { // 暂不支持的 api if (!protocol) { // 暂不支持的 api
return function () { return function () {
console.error(`__PLATFORM_TITLE__ 暂不支持${methodName}`) console.error(`Platform '__PLATFORM_TITLE__' does not support '${methodName}'.`)
} }
} }
return function (arg1, arg2) { // 目前 api 最多两个参数 return function (arg1, arg2) { // 目前 api 最多两个参数
...@@ -98,4 +98,4 @@ export default function wrapper (methodName, method) { ...@@ -98,4 +98,4 @@ export default function wrapper (methodName, method) {
} }
} }
return method return method
} }
...@@ -226,9 +226,7 @@ function checkColor (e) { ...@@ -226,9 +226,7 @@ function checkColor (e) {
a = a >= 0 ? a : 255 a = a >= 0 ? a : 255
return [n, o, r, a] return [n, o, r, a]
} }
console.group('非法颜色: ' + e) console.error('unsupported color:' + e)
console.error('不支持颜色:' + e)
console.groupEnd()
return [0, 0, 0, 255] return [0, 0, 0, 255]
} }
......
...@@ -27,5 +27,5 @@ onMethod('onUIStyleChange', function (res) { ...@@ -27,5 +27,5 @@ onMethod('onUIStyleChange', function (res) {
export function onUIStyleChange (callbackId) { export function onUIStyleChange (callbackId) {
callbacks.push(callbackId) callbacks.push(callbackId)
console.log('API uni.onUIStyleChange 已过时,请使用 uni.onThemeChange,详情:https://uniapp.dcloud.net.cn/api/system/theme') console.warn('The "uni.onUIStyleChange" API is deprecated, please use "uni.onThemeChange". Learn more: https://uniapp.dcloud.net.cn/api/system/theme.')
} }
...@@ -69,11 +69,11 @@ class LivePusherContext { ...@@ -69,11 +69,11 @@ class LivePusherContext {
export function createLivePusherContext (id, vm) { export function createLivePusherContext (id, vm) {
if (!vm) { if (!vm) {
return console.warn('uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)') return console.warn('uni.createLivePusherContext: 2 arguments required, but only 1 present')
} }
const elm = findElmById(id, vm) const elm = findElmById(id, vm)
if (!elm) { if (!elm) {
return console.warn('Can not find `' + id + '`') return console.warn('Can not find `' + id + '`')
} }
return new LivePusherContext(id, elm) return new LivePusherContext(id, elm)
} }
...@@ -17,7 +17,7 @@ export function openDocument ({ ...@@ -17,7 +17,7 @@ export function openDocument ({
}) })
}, err => { }, err => {
invoke(callbackId, { invoke(callbackId, {
errMsg: 'openDocument:fail 文件[' + filePath + ']读取失败:' + err.message errMsg: 'openDocument:fail ' + err.message
}) })
}) })
} }
...@@ -53,14 +53,14 @@ const Recorder = { ...@@ -53,14 +53,14 @@ const Recorder = {
pause () { pause () {
if (recorder) { if (recorder) {
publishRecorderStateChange('error', { publishRecorderStateChange('error', {
errMsg: '暂不支持录音pause操作' errMsg: 'Unsupported operation: pause'
}) })
} }
}, },
resume () { resume () {
if (recorder) { if (recorder) {
publishRecorderStateChange('error', { publishRecorderStateChange('error', {
errMsg: '暂不支持录音resume操作' errMsg: 'Unsupported operation: resume'
}) })
} }
} }
......
...@@ -70,7 +70,7 @@ export function getProvider ({ ...@@ -70,7 +70,7 @@ export function getProvider ({
}) })
} else { } else {
invoke(callbackId, { invoke(callbackId, {
errMsg: 'getProvider:fail 服务[' + service + ']不支持' errMsg: 'getProvider:fail service not found'
}) })
} }
} }
...@@ -16,7 +16,7 @@ export function requestPayment (params, callbackId) { ...@@ -16,7 +16,7 @@ export function requestPayment (params, callbackId) {
}) => id === provider) }) => id === provider)
if (!service) { if (!service) {
invoke(callbackId, { invoke(callbackId, {
errMsg: 'requestPayment:fail 支付服务[' + provider + ']不存在' errMsg: 'requestPayment:fail service not found'
}) })
} else { } else {
plus.payment.request(service, params.orderInfo, res => { plus.payment.request(service, params.orderInfo, res => {
......
...@@ -154,7 +154,7 @@ export function share (params, callbackId, method = 'share') { ...@@ -154,7 +154,7 @@ export function share (params, callbackId, method = 'share') {
}) => id === provider) }) => id === provider)
if (!service) { if (!service) {
invoke(callbackId, { invoke(callbackId, {
errMsg: method + ':fail 分享服务[' + provider + ']不存在' errMsg: method + ':fail service not found'
}) })
} else { } else {
if (service.authenticated) { if (service.authenticated) {
......
...@@ -57,7 +57,7 @@ export function getApp ({ ...@@ -57,7 +57,7 @@ export function getApp ({
return defaultApp return defaultApp
} }
console.error( console.error(
'[warn]: getApp() 操作失败,v3模式加速了首页 nvue 的启动速度,当在首页 nvue 中使用 getApp() 不一定可以获取真正的 App 对象。详情请参考:https://uniapp.dcloud.io/collocation/frame/window?id=getapp' '[warn]: getApp() failed. Learn more: https://uniapp.dcloud.io/collocation/frame/window?id=getapp.'
) )
} }
...@@ -236,4 +236,4 @@ export function registerApp (appVm) { ...@@ -236,4 +236,4 @@ export function registerApp (appVm) {
__uniConfig.ready = true __uniConfig.ready = true
process.env.NODE_ENV !== 'production' && perf('registerApp') process.env.NODE_ENV !== 'production' && perf('registerApp')
} }
...@@ -23,7 +23,7 @@ export function navigate (path, callback, isAppLaunch) { ...@@ -23,7 +23,7 @@ export function navigate (path, callback, isAppLaunch) {
plus.navigator.closeSplashscreen() plus.navigator.closeSplashscreen()
} }
if (!isAppLaunch && todoNavigator) { if (!isAppLaunch && todoNavigator) {
return console.error(`已存在待跳转页面${todoNavigator.path},请不要连续多次跳转页面${path}`) return console.error(`Waiting to navigate to: ${todoNavigator.path}, do not operate continuously: ${path}.`)
} }
if (__uniConfig.renderer === 'native') { // 纯原生无需wait逻辑 if (__uniConfig.renderer === 'native') { // 纯原生无需wait逻辑
// 如果是首页还未初始化,需要等一等,其他无需等待 // 如果是首页还未初始化,需要等一等,其他无需等待
...@@ -88,4 +88,4 @@ export function navigateFinish () { ...@@ -88,4 +88,4 @@ export function navigateFinish () {
? todoNavigator.navigate() ? todoNavigator.navigate()
: registerWebviewReady(preloadWebview.id, todoNavigate) : registerWebviewReady(preloadWebview.id, todoNavigate)
} }
} }
...@@ -29,8 +29,8 @@ export function consumePlusMessage (type, args) { ...@@ -29,8 +29,8 @@ export function consumePlusMessage (type, args) {
*/ */
export function registerPlusMessage (type, callback, keepAlive = true) { export function registerPlusMessage (type, callback, keepAlive = true) {
if (callbacks[type]) { if (callbacks[type]) {
return console.warn(`${type} 已注册:` + (callbacks[type].toString())) return console.warn(`'${type}' registered: ` + (callbacks[type].toString()))
} }
callback.keepAlive = !!keepAlive callback.keepAlive = !!keepAlive
callbacks[type] = callback callbacks[type] = callback
} }
...@@ -72,7 +72,7 @@ function initSubNVue (subNVue, routeOptions, webview) { ...@@ -72,7 +72,7 @@ function initSubNVue (subNVue, routeOptions, webview) {
delete style.type delete style.type
if (isPopup && !subNVue.id) { if (isPopup && !subNVue.id) {
console.warn('subNVue[' + subNVue.path + '] 尚未配置 id') console.warn('subNVue[' + subNVue.path + '] is missing id')
} }
// TODO lazyload // TODO lazyload
......
...@@ -17,9 +17,7 @@ export function getFileInfo ({ ...@@ -17,9 +17,7 @@ export function getFileInfo ({
}) })
}).catch((err) => { }).catch((err) => {
invoke(callbackId, { invoke(callbackId, {
errMsg: 'getFileInfo:fail 文件[' + errMsg: 'getFileInfo:fail ' + err.message
filePath +
'] getFileInfo 失败:' + err.message
}) })
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册