diff --git a/entry/src/main/ets/MainAbility/MainAbilityEx.ets b/entry/src/main/ets/MainAbility/MainAbilityEx.ets index 183da08..1a5333f 100644 --- a/entry/src/main/ets/MainAbility/MainAbilityEx.ets +++ b/entry/src/main/ets/MainAbility/MainAbilityEx.ets @@ -319,7 +319,7 @@ export default class MainAbility extends UIExtensionAbility { this.dlpFilesToEncrypt(session); } else { await GetAlertMessage.startAlertAbility(this.context, { - code: Constants.ERR_JS_APP_INSIDE_ERROR } as BusinessError); + code: Constants.ERR_JS_APP_CANNOT_OPEN } as BusinessError); } } catch { return; diff --git a/entry/src/main/ets/common/GetAlertMessage.ets b/entry/src/main/ets/common/GetAlertMessage.ets index 8e32672..b42ede9 100644 --- a/entry/src/main/ets/common/GetAlertMessage.ets +++ b/entry/src/main/ets/common/GetAlertMessage.ets @@ -142,6 +142,8 @@ export class GetAlertMessage { return { 'msg': $r('app.string.MESSAGE_APP_FILE_PARAM_ERROR') } as Record; case Constants.ERR_JS_USER_NO_PERMISSION: return { 'msg': $r('app.string.MESSAGE_APP_NOT_HAVE_PERM') } as Record; + case Constants.ERR_JS_APP_CANNOT_OPEN: + return { 'msg': $r('app.string.CANNOT_OPEN_THIS_TYPE_FILE') } as Record; default: if (defaultTitle !== undefined && defaultMessage != undefined) { return { 'title': defaultTitle, 'msg': defaultMessage } as Record; diff --git a/entry/src/main/ets/common/constant.ets b/entry/src/main/ets/common/constant.ets index 94be155..1d326a0 100644 --- a/entry/src/main/ets/common/constant.ets +++ b/entry/src/main/ets/common/constant.ets @@ -177,6 +177,7 @@ export default class Constants { public static readonly ERR_JS_APP_SYSTEM_IS_AUTHENTICATED = 8; public static readonly ERR_JS_APP_NETWORK_INVALID = 9; public static readonly ERR_JS_APP_ENCRYPTING = 10; + public static readonly ERR_JS_APP_CANNOT_OPEN = 11; public static readonly ERR_JS_CREDENTIAL_TIMEOUT = 19100003; public static readonly ERR_JS_CREDENTIAL_SERVICE_ERROR = 19100004; public static readonly ERR_JS_CREDENTIAL_SERVER_ERROR = 19100005; diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 170ec68..8a01096 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -208,6 +208,10 @@ "name": "MESSAGE_APP_NOT_HAVE_PERM", "value": "You don't have permission to view this file." }, + { + "name": "CANNOT_OPEN_THIS_TYPE_FILE", + "value": "Cannot open this type of file" + }, { "name": "MESSAGE_APP_FILE_PARAM_ERROR", "value": "Unable to open file. Check and try again." diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index 0f58398..9a6e547 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -208,6 +208,10 @@ "name": "MESSAGE_APP_NOT_HAVE_PERM", "value": "您没有权限查看此文件。" }, + { + "name": "CANNOT_OPEN_THIS_TYPE_FILE", + "value": "无法打开此类型文件。" + }, { "name": "MESSAGE_APP_FILE_PARAM_ERROR", "value": "无法打开此文件。请检查后重试。"