提交 196f1e1a 编写于 作者: C chenshixu1
上级 47addc6b
...@@ -69,7 +69,7 @@ get(key: string, callback: AsyncCallback<string>): void ...@@ -69,7 +69,7 @@ get(key: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -102,7 +102,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void ...@@ -102,7 +102,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", "default", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", "default", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -142,9 +142,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -142,9 +142,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.get("const.ohos.apiversion"); let p = systemparameter.get("const.ohos.apiversion");
p.then((value:string) => { p.then((value: string) => {
console.log("get test.parameter.key success: " + value); console.log("get test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log("get test.parameter.key error: " + err.code); console.log("get test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
...@@ -208,7 +208,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void ...@@ -208,7 +208,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.set("test.parameter.key", "testValue", (err:BusinessError, data:string) =>{ systemparameter.set("test.parameter.key", "testValue", (err: BusinessError, data: void) =>{
if (err == undefined) { if (err == undefined) {
console.log("set test.parameter.key value success :" + data) console.log("set test.parameter.key value success :" + data)
} else { } else {
...@@ -251,9 +251,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -251,9 +251,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.set("test.parameter.key", "testValue"); let p = systemparameter.set("test.parameter.key", "testValue");
p.then((value:string) => { p.then((value: void) => {
console.log("set test.parameter.key success: " + value); console.log("set test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log(" set test.parameter.key error: " + err.code); console.log(" set test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
......
...@@ -69,7 +69,7 @@ get(key: string, callback: AsyncCallback<string>): void ...@@ -69,7 +69,7 @@ get(key: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -102,7 +102,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void ...@@ -102,7 +102,7 @@ get(key: string, def: string, callback: AsyncCallback<string>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.get("const.ohos.apiversion", "default", (err:BusinessError, data:string) => { systemparameter.get("const.ohos.apiversion", "default", (err: BusinessError, data: string) => {
if (err == undefined) { if (err == undefined) {
console.log("get test.parameter.key value success:" + data) console.log("get test.parameter.key value success:" + data)
} else { } else {
...@@ -142,9 +142,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -142,9 +142,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.get("const.ohos.apiversion"); let p = systemparameter.get("const.ohos.apiversion");
p.then((value:string) => { p.then((value: string) => {
console.log("get test.parameter.key success: " + value); console.log("get test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log("get test.parameter.key error: " + err.code); console.log("get test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
...@@ -201,7 +201,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void ...@@ -201,7 +201,7 @@ set(key: string, value: string, callback: AsyncCallback<void>): void
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
try { try {
systemparameter.set("test.parameter.key", "testValue", (err:BusinessError, data:string) => { systemparameter.set("test.parameter.key", "testValue", (err: BusinessError, data: void) => {
if (err == undefined) { if (err == undefined) {
console.log("set test.parameter.key value success :" + data) console.log("set test.parameter.key value success :" + data)
} else { } else {
...@@ -240,9 +240,9 @@ import { BusinessError } from '@ohos.base'; ...@@ -240,9 +240,9 @@ import { BusinessError } from '@ohos.base';
try { try {
let p = systemparameter.set("test.parameter.key", "testValue"); let p = systemparameter.set("test.parameter.key", "testValue");
p.then((value:string) => { p.then((value: void) => {
console.log("set test.parameter.key success: " + value); console.log("set test.parameter.key success: " + value);
}).catch((err:BusinessError) => { }).catch((err: BusinessError) => {
console.log(" set test.parameter.key error: " + err.code); console.log(" set test.parameter.key error: " + err.code);
}); });
} catch(e) { } catch(e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册