Day13: Learning data connector (1)

Today's task :

1. learned in small micro-channel program is not directly connected to the database, to be connected through an interface database, currently only supports micro-channel applet https.

In the micro-channel connecting the applet can be used to place data interface utils, if in the case of the familiar ajax, data access can be more easily achieved.

The following example is a function and parameters required for the connection

 

2. With regard to the realization of the search function

Use the "http: // localhost / .." connection to the server back-end interface to receive a small program passed in the past keywords.

Here are some examples of the code of wxml

 

 

Tomorrow Plan :

For various reasons no common back-end programming and write the students, so it did not do before and after the scheduled end of the interaction.

I hope can successfully meet tomorrow to complete the simple transfer of user information.

Daily Summary : We see the online tutorials connection that if the data of each page to access the data interface of his own, feeling very OOP. If you use a getbyparams, getbyid,

  1.  GetById(url,id){  
  2.   return getApi(url, id)  
  3.    .then(res => res.data)  
  4.  }  

Find out all the data according to the conditions, or to obtain a data according to id, comparison may be more convenient, a little behind the program can try.

Guess you like

Origin www.cnblogs.com/Askia/p/11440441.html