@@ -200,3 +246,14 @@ class Qrcode extends React.Component {
}
export default Qrcode;
+
+window.onload = function(){
+ if(isWeiXin()){
+ const outer = document.getElementById("wx-message");
+ const inner = document.createElement("div");
+ inner.className = "note-font";
+ inner.id = "wx-message-inner";
+ inner.innerHTML = "当前客户端不支持下载,请在浏览器中打开。";
+ outer.appendChild(inner);
+ }
+}
diff --git a/src/utils/util.js b/src/utils/util.js
index e46b191..3e78309 100644
--- a/src/utils/util.js
+++ b/src/utils/util.js
@@ -20,3 +20,12 @@ export function randRGB() {
)
return rgb;
}
+
+export function isWeiXin(){
+ const ua = window.navigator.userAgent.toLowerCase();
+ if(ua.match(/MicroMessenger/i) == 'micromessenger'){
+ return true;
+ }else{
+ return false;
+ }
+}