SoFunction
Updated on 2025-03-11

Android cache method using HBuilder

The code is as follows:

/*
  * Packaging operation can be performed in the middle
  *mui represents mui, owner represents window's app attribute, which is a value passed
  */
(function(mui,owner)
{
 /**
   * Get the current status
   **/
  = function() {
  var stateText = ('$state');
  if(stateText != null && stateText != undefined) {
   var s = (stateText);
   if(new Date() > new Date()) {
    stateText = "";
   }
  }
  stateText = stateText || '{"ID":0,"Ticket":"","UserName":""}';
  return (stateText);
 };
 /**
   * Set the current status
   **/
  = function(state) {
  state = state || {
   Ticket: "",
   UserName:""
   //TokenTimeOut: "1970-1-1"
  };
  ('$state', (state));
 };
 /**
   * Get the local configuration of the application
   **/
  = function(settings) {
  settings = settings || {};
  ('$settings', (settings));
 }
 /**
   * Set the local configuration of the application
   **/
  = function() {
  var settingsText = ('$settings') || "{}";
  return (settingsText);
 }
}(mui,  = {}));

How to use

Quote JS <script src="js/"></script>

//Storage cachevar postData = {
 AccountName: "administrator",
Pwd: "12345678",
 Company: "bao"
 };//Declare object(data);Store in cache
//Get cachevar _user = ();//Get storage objectvar Ticke = _user.Ticket //Get the bill

Summarize

The above is the caching method of using HBuilder on Android introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!