RT
backend java
frontend Vue
RT
backend java
frontend Vue
the backend writes whether the interface is maintained or not. Before each request, the secondary API is sent to check whether the background is under maintenance, and the status shows that is maintaining
at the front end. Otherwise, it's normal. (simple solution.
when an API returns status
as 404
, jump to the
initial GET
request on the system maintenance page, and the request will be processed by the backend. You can show whatever you want on the back end.
if it is an uncertain "accident" in the middle, what is shown is part of the function of the front end, and just ask the front end to do it.
if you are using axios as an interactive plug-in, you can try the following configuration
this.$http.get(url, data, config)
.then(res => {
// success
})
.catch((err) => {
// fail
if (err.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
// 2xx
} else if (err.request) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
//
} else {
// Something happened in setting up the request that triggered an Error
}
console.log(error.config);
})
the front end can make a judgment based on the status code returned by the background. When a specific status code appears, it jumps to the maintenance page
.when configuring nginx, backend maintenance, it automatically jumps to the system maintenance page under maintenance
Thank you very much. The problem has been solved. Let's talk about my practice. Because the size of the server is limited, it is impossible to do Websocket, and want to manipulate the maintenance page at will, so a json file is placed in the root directory of the server front end, and this json file is used as a configuration file. You can configure whether or not to maintain, the time period for maintenance, maintain the content displayed on the page, and then judge it by reading requests from the front end, which is also a way
.Previous: The ``in router.push ({path: `/ user/$ {userId}`}) is changed to''. Is there any difference?
1. If I call the function of js natively, I am not sure what the scope of the function of js is. I packaged the node module with bowseriry and wanted to expose the function I wrote to the native call . For example, the global domain of window,node in the...
Import project prompt error: log4j:ERROR setFile (null,true) call failed. java.io.FileNotFoundException: d:classnet.log (the system cannot find the specified path.) ask for the guidance of the gods! ^ _ ^ ...
the logic for the background to return the json result is Map<String, Object> resultMap = new HashMap<>(); resultMap.put("userType", userType); resultMap.put("phone", phone); resultMap.put("channel&q...
background code snippet: UtilHttp.streamContentToBrowser(response, UtilObject.getBytes(list), "application octet-stream"); background list: listbyte[],ioJSAjax: dataType: "text ": ... XMLHttpRequest byteArray: list ...
package cn.chinaunicom.changyue.util; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.lang.StringUtils; ** * : AES<br > * : AES<br > * : <br ...
...
$("-sharpcontract_remark").text( data.data.type==0 ? "" : ""+""+data.data.rentRooms.name +""+data.data.area+"");...
...
I want to use ajax to submit the form, verify that the user name password is correct, and use json to transfer data, which is also a post submission method, but once submitted, I find that the user name and password can be seen on the developer s tool. ...
now the pop-up can only be confirmed twice, and you can t enter the content? I want to click "disagree " and pop up an input box to fill in the reason for disagreement. ...
as shown in the figure, there are two input tabs, which are two radio buttons. Choose to turn them on or off. After clicking Save Settings, a div on the page will be shown or hidden. my problem is, when I click Save Settings, how do I know if I cli...
this is the code of the front-end request javacors is there something wrong with the setting mode? I don t know much about the background code at the front end, and I don t know how to solve cross-domain problems in the background . ...
how reliable is the process of password authentication for user login? (do not discuss channel encryption on https) 1. The front-end plaintext passes the password to the back-end for encryption, and compares the processed ciphertext with the database t...
the company has developed a third-party platform for Mini Program. In the case of not being released throughout the network, obviously the operation steps are the same. Why can t the second Mini Program account generate Mini Program? some have trie...
A string is as follows: Table name 1 @ Field 1 ~ Table name 1 @ Field 2 ~ Table name 2 @ Field 1 ~ Table name 2 @ Field 2 how to reasonably handle it in json format { 1:[12], 2:[1, 2] } ...
can you only use the markdown language in README.md in github? I ve experimented with using the markdown language in other files, but it doesn t work. Ask for popular science ~ ...
as shown in the figure above, what is the cause? Front end or back end? I have no idea at all. ...
python smtp send email setup signature? you can also say how it is sent in other languages ....
the development process of the java, backend of our company is to pull the svn warehouse code on its own, and then configure the local server to run the code pulled by svn on the local server. After the local development is completed, the code will be u...
var num = 1234567.89 ; var num1 = num.replace( (?<= d)(?=( d{3})+ b) g, , ); b 1,234,567.89 var num2 = num.replace( (?<= d)(?=( d{3})) g, , ); b 1,2,3,4,567.89 b b ...