Authored by 陈峰

fix miniapp login

@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 }, 9 },
10 "scripts": { 10 "scripts": {
11 "start": "NODE_ENV=\"production\" node app.js", 11 "start": "NODE_ENV=\"production\" node app.js",
12 - "dev": "nodemon -e js,hbs -i public/ app.js", 12 + "dev": "nodemon -e js,hbs -i public/ -i dist/ app.js",
13 "static": "yo-cli dev --config ./build/yo.dev.conf.js", 13 "static": "yo-cli dev --config ./build/yo.dev.conf.js",
14 "build:node": "node ./build/yo.node.conf.js", 14 "build:node": "node ./build/yo.node.conf.js",
15 "build:sw": "webpack --config ./build/webpack.sw.config.js", 15 "build:sw": "webpack --config ./build/webpack.sw.config.js",
@@ -41,6 +41,7 @@ yoho = { @@ -41,6 +41,7 @@ yoho = {
41 isNowApp: /yohonow/i.test(navigator.userAgent || ''), 41 isNowApp: /yohonow/i.test(navigator.userAgent || ''),
42 isMarsApp: /YohoMars/i.test(navigator.userAgent || ''), 42 isMarsApp: /YohoMars/i.test(navigator.userAgent || ''),
43 isYohoApp: /YohoBuy/i.test(navigator.userAgent || ''), 43 isYohoApp: /YohoBuy/i.test(navigator.userAgent || ''),
  44 + isMiniApp: /miniProgram/i.test(navigator.userAgent || '') || qs.client_type === 'miniapp',
44 isApp: /YohoMars/i.test(navigator.userAgent || '') || 45 isApp: /YohoMars/i.test(navigator.userAgent || '') ||
45 /YohoBuy/i.test(navigator.userAgent || '') || 46 /YohoBuy/i.test(navigator.userAgent || '') ||
46 /yohonow/i.test(navigator.userAgent || '') || 47 /yohonow/i.test(navigator.userAgent || '') ||
@@ -166,6 +167,9 @@ yoho = { @@ -166,6 +167,9 @@ yoho = {
166 }, 167 },
167 168
168 goLogin: function(refer, data) { 169 goLogin: function(refer, data) {
  170 + if (this.isMiniApp) {
  171 + return false;
  172 + }
169 let url; 173 let url;
170 174
171 if (refer.indexOf('//') === 0) { 175 if (refer.indexOf('//') === 0) {