WeChat service number template message details page opens a blank page
Problem description
The WeChat service number was running normally, and suddenly found that the template message details page was open blank page (is it not their own move what? I tried three brands of Android phones: Xiaomi, Huawei and Meizu. All the screens were blank (on the phone). It can be opened on iPhone, PC Chrome and QQ browsers can be opened normally, and it can also be opened normally using WeChat developer tools. A number of online searches reported that the SSL certificate chain was incomplete, and the iPhone was not affected so it could be opened properly. I really believe it. Wasted a day… But very confused, because the certificate is in the Tencent cloud server application (although is free), and then downloaded, supposedly should be complete. Details to https://www.sslceshi.com/ssl_check/ validation is complete, see the certificate chain part without missing that is complete, and ultimately positioning down is presents project back in 404. Use the package capture tool Fiddler to turn on capture when you refresh the detail page link in your browser and you’ll see 404. Use method is as follows:
The final effect after solving the problem is:
To solve the problem
-
Modify the contents of
in the Tomcat configuration file server.xml and add the code: < Valve className = “org. Apache. Catalina. Valves. Rewrite. RewriteValve” / >, add tag < Host name = “localhost” > after the complete code is:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <! -- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <! -- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <! -- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t " %r" %s %b" /> <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" /> </Host>
Don’t worry. Copy the tag
….
-
/usr/local/tomcat9 = /usr/local/tomcat9 = /usr/local/tomcat9 = /usr/local/tomcat9 = /usr/local/tomcat9 Make the path/usr/local/tomcat9 / conf/Catalina/localhost created under your name to rewrite the config files, including all the code is:
RewriteCond %{REQUEST_PATH} ! -f RewriteRule ^/wxpadfe/(.*) /wxpadfe/index.html
Above wxpadfe is presents to compile the project name, is also deployed in tomcat project directory name, or the front end of the test project files in the path/usr/local/tomcat9 / webapps/wxpadfe. The configuration is complete in this Tomcat.
-
Angular
Do not use theHashLocationStrategy
, not only to solve the 404 problem in this case, but also to solveoauth
The issue of web authentication. Using the commandng build --prod --aot --base-href wxpadfe
compileAngular
The project. This is where the compiled project name andtomcat
The name of the directory in which the project is located is consistent, whilerewrite.config
The project name in the. -
For more proof, here’s the code for the root route in the Angular project:
const routes: Routes = [ { path:'soDtl', loadChildren:'./pages/sendoutdetail/sendoutdetail.module#SendoutdetailModule', Data :{title:' Finished shipping list details ',isRemove: true } },............... ............... ............... ............... @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { }
-
Here’s the Angular project home page code:
<! Doctype HTML > < HTML lang="en"> <head> <meta charset="utf-8"> <title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> </head> <body> <app-root></app-root> </body> </html>
- Finally, just to confirm, some posts say to be on
tomcat
The configuration file ofweb.xml
In the 404 jump page set, after testing in the above configuration is not inweb.xml
The 404 jump page is set in the. - Last but not least, a special thanks
segmentfault
的@ and then go hiking
, the source of the error can be provided to solve the problem.