my.setLocalData

set data with key. key use your own defined name, data will only be isolated based on the level of mini programs

Sample Code

copy
my.call('setLocalData',{
   currentProvice: 'Fujian',
   currentCity:'Fuzhou',
},()=>{
  my.alert({
    title: 'Successful setLocalData',
  });
});

Parameters

Property

Type

Required

Description

key1

String

No

string data you set, we will storage this string data use this key

if key is empty string, we would not set this data

key2

String

No

key3..

String

No

Success Callback Function

The incoming parameter is of the Object type with the following attributes:

Property

Type

Required

Description

resultCode

Number

Yes

0: success

1002: internal error

resultMessage

String

No

Return on failure