dedecms phone PC synchronization bug fixes and updated plug-in front and rear side debugging experience

2017, due to work, download a dedecms mobile phone and PC synchronization update plug-ins.

Get this plug-in, there have been mobile terminal and PC, templates confusion generated.

Because, at that time just use dedecms, some of the core functions of the dede do not understand.

So, to fix this bug, do nothing. But he did not give up, the next couple of years, I have, many times the charge on this issue have collapsed under.

 

Taking advantage of the epidemic this time, plus participate in technical training, this time charge again. Success.

 

A: the relevant technology base.

1. PHP have a certain foundation. Do not be afraid encounter PHP code. Be able to read the meaning of each code.

2. To have some understanding of dede cache. dede system configuration will generate a configuration file on the service. This time, every time you access the background, some of the system configuration parameters through a file (rather than through a database) to read directly. In this way speed up the access speed dede background.

3. cache files and database data, often not the same. But because, when the generation of the PC and the mobile phone side, templates are read from the cache. Therefore, if you do not update the cache, then update the phone side and they will read the PC side of the template. This requires, before generating the document, synchronous operation.

 

II: About synchronization

dede is to use JS judgment, trigger an event to reach synchronization.

However, because the plug-in cache synchronization when toke missing parameters, resulting in confusion.

Only, at line 112 /dede/m/panduan.php file, adding a toke input box like. code show as below.

<input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?>">

-----------------------------------------------------------------------------------------------------------------------------------------------

Three: Debugging Experience

1. Use F12, open console, front-end, back-end, can do debugging .

2. To be familiar with the console network, the interpretation of post messages, was also found, post fails to respond, only to find the problem.

Record it, Mody Mody clatter.

Guess you like

Origin www.cnblogs.com/cn-oldboy/p/12343706.html