Authored by 肖亚东

删除无用代码以及手机号登录修改

1 //app.js 1 //app.js
2 import objectAssign from './vendors/object-assign'; 2 import objectAssign from './vendors/object-assign';
3 import {WeToast} from './vendors/toast/wetoast'; 3 import {WeToast} from './vendors/toast/wetoast';
4 -import { APP_ID, API_HOST, SERVICE_HOST, MINI_APP_TYPE} from './libs/config'; 4 +import { APP_ID, API_HOST, MINI_APP_TYPE} from './libs/config';
5 import {GET, POST} from './libs/request'; 5 import {GET, POST} from './libs/request';
6 import md5 from './vendors/md5'; 6 import md5 from './vendors/md5';
7 var mta = require('./vendors/mta_analysis.js') 7 var mta = require('./vendors/mta_analysis.js')
1 'use strict' 1 'use strict'
2 -import {LOG_EVENT_HOST, API_HOST, SERVICE_HOST } from '../libs/config'; 2 +import {LOG_EVENT_HOST, API_HOSTAPI_HOST } from '../libs/config';
3 import { UPLOAD_LOG} from '../libs/request'; 3 import { UPLOAD_LOG} from '../libs/request';
4 import { getYHStorageSync } from '../utils/util'; 4 import { getYHStorageSync } from '../utils/util';
5 5
1 //****** 线上环境url,提交代码务必检查确认 ****** 1 //****** 线上环境url,提交代码务必检查确认 ******
2 // export const API_HOST = 'https://api.yoho.cn'; 2 // export const API_HOST = 'https://api.yoho.cn';
3 -// export const SERVICE_HOST = 'https://api.yoho.cn';  
4 // export const YOHOBUY_HOST = 'https://m.yohobuy.com'; 3 // export const YOHOBUY_HOST = 'https://m.yohobuy.com';
5 // export const APP_REPORT_HOST = 'https://app.yoho.cn/collect/v3'; 4 // export const APP_REPORT_HOST = 'https://app.yoho.cn/collect/v3';
6 // export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile'; 5 // export const LOG_EVENT_HOST = 'https://analysis.yohobuy.com/yas_mobile';
@@ -10,9 +9,8 @@ @@ -10,9 +9,8 @@
10 9
11 // *********测试3环境********* 10 // *********测试3环境*********
12 export const API_HOST = 'http://api-test3.dev.yohocorp.com'; 11 export const API_HOST = 'http://api-test3.dev.yohocorp.com';
13 - export const SERVICE_HOST = 'http://api-test3.dev.yohocorp.com';  
14 export const YOHOBUY_HOST = 'http://m.yohobuy.com'; 12 export const YOHOBUY_HOST = 'http://m.yohobuy.com';
15 - export const ACTIVITY_HOST = 'http://192.168.102.49:6006'; 13 + export const ACTIVITY_HOST = 'http://192.168.102.49 :6006';
16 export const YOHOOD_HOST = 'http://yohood.test.yoho.cn'; 14 export const YOHOOD_HOST = 'http://yohood.test.yoho.cn';
17 15
18 16
1 1
2 import Promise from '../vendors/es6-promise'; 2 import Promise from '../vendors/es6-promise';
3 -import { API_HOST, SERVICE_HOST } from './config'; 3 +import { API_HOST } from './config';
4 import { GET, POST } from './request'; 4 import { GET, POST } from './request';
5 import { getYHStorageSync } from '../utils/util'; 5 import { getYHStorageSync } from '../utils/util';
6 6
1 1
2 import Promise from '../vendors/es6-promise'; 2 import Promise from '../vendors/es6-promise';
3 -import { API_HOST, SERVICE_HOST } from './config'; 3 +import { API_HOST } from './config';
4 import { GET, POST } from './request'; 4 import { GET, POST } from './request';
5 // import { 5 // import {
6 // logEvent, 6 // logEvent,
1 -import {API_HOST, YOHOOD_HOST, SERVICE_HOST} from '../../libs/config'; 1 +import {API_HOST, YOHOOD_HOST } from '../../libs/config';
2 import {GET, POST} from '../../libs/request'; 2 import {GET, POST} from '../../libs/request';
3 import { getUnionID } from '../../utils/login'; 3 import { getUnionID } from '../../utils/login';
4 import { applyActivity } from '../../utils/activity'; 4 import { applyActivity } from '../../utils/activity';
1 // 逛文章详情 1 // 逛文章详情
2 -import { YOHOOD_HOST, API_HOST, SERVICE_HOST } from '../../libs/config'; 2 +import { YOHOOD_HOST, API_HOST } from '../../libs/config';
3 import { GET, POST } from '../../libs/request'; 3 import { GET, POST } from '../../libs/request';
4 import util from '../../utils/util'; 4 import util from '../../utils/util';
5 import { getQRCodeSource } from '../../libs/miniQRCodeRoute.js' 5 import { getQRCodeSource } from '../../libs/miniQRCodeRoute.js'
1 // pages/choosecountry/choosecountry.js 1 // pages/choosecountry/choosecountry.js
2 'use strict'; 2 'use strict';
3 -import { API_HOST, SERVICE_HOST } from '../../libs/config'; 3 +import { API_HOST } from '../../libs/config';
4 import { GET, POST } from '../../libs/request'; 4 import { GET, POST } from '../../libs/request';
5 import { getVerifyKey, bindAction, decodePhoneNumber, getUnionID, decodeUnionId, openAuthorizeSettings} from '../../utils/login'; 5 import { getVerifyKey, bindAction, decodePhoneNumber, getUnionID, decodeUnionId, openAuthorizeSettings} from '../../utils/login';
6 6
1 // 逛文章详情 1 // 逛文章详情
2 -import { YOHOOD_HOST, API_HOST, SERVICE_HOST } from '../../libs/config'; 2 +import { YOHOOD_HOST, API_HOST } from '../../libs/config';
3 import { GET, POST } from '../../libs/request'; 3 import { GET, POST } from '../../libs/request';
4 import util from '../../utils/util'; 4 import util from '../../utils/util';
5 import WxParse from '../../vendors/wxParse/wxParse'; 5 import WxParse from '../../vendors/wxParse/wxParse';
1 // components/Dialog/dialog.js 1 // components/Dialog/dialog.js
2 -import {  
3 - logEvent,  
4 - YB_TO_OPEN_APP_C,  
5 - YB_OPEN_APP_RESULT_L  
6 -} from '../../libs/analytics.js'  
7 -import { API_HOST, SERVICE_HOST } from '../../libs/config';  
8 -import { GET, POST } from '../../libs/request';  
9 import { postFormId } from '../../libs/formIdCollectRequest'; 2 import { postFormId } from '../../libs/formIdCollectRequest';
10 3
11 let app = getApp(); 4 let app = getApp();
@@ -74,7 +74,10 @@ Page({ @@ -74,7 +74,10 @@ Page({
74 }, 74 },
75 onShow: function() { 75 onShow: function() {
76 //Do some when page show. 76 //Do some when page show.
77 - 77 + let isLogin = app.isLogin() ? true : false;
  78 + this.setData({
  79 + isLogin,
  80 + })
78 }, 81 },
79 82
80 fetchTicketInfo() { 83 fetchTicketInfo() {
1 //login.js 1 //login.js
2 import {GET, POST} from '../libs/request'; 2 import {GET, POST} from '../libs/request';
3 -import {API_HOST, SERVICE_HOST} from '../libs/config'; 3 +import {API_HOST} from '../libs/config';
4 import {Encrypt} from '../libs/aes' 4 import {Encrypt} from '../libs/aes'
5 import {isStringEmpty} from './util' 5 import {isStringEmpty} from './util'
6 import { logEvent, 6 import { logEvent,
@@ -38,7 +38,7 @@ function wechatLoginAction(callbackFunc) { @@ -38,7 +38,7 @@ function wechatLoginAction(callbackFunc) {
38 jsCode: res.code, 38 jsCode: res.code,
39 miniapp_type: app.globalData.miniapp_type, 39 miniapp_type: app.globalData.miniapp_type,
40 } 40 }
41 - GET(SERVICE_HOST+'/wechat/', param) 41 + GET(API_HOST+'/wechat/', param)
42 .then(data => { 42 .then(data => {
43 if (data.code != 200) { 43 if (data.code != 200) {
44 callbackFunc({ 44 callbackFunc({
@@ -545,7 +545,7 @@ function decodePhoneNumber(iv, encryptedData, inviteCode, callbackFunc){ @@ -545,7 +545,7 @@ function decodePhoneNumber(iv, encryptedData, inviteCode, callbackFunc){
545 encryptedData: encryptedData, 545 encryptedData: encryptedData,
546 iv: iv, 546 iv: iv,
547 } 547 }
548 - GET(SERVICE_HOST + '/wechat/', param) 548 + GET(API_HOST + '/wechat/', param)
549 .then(data => { 549 .then(data => {
550 if(data.data.phoneNumber!==''&&data.data.countryCode!=''){ 550 if(data.data.phoneNumber!==''&&data.data.countryCode!=''){
551 BindMiniAppByAuto(data.data.phoneNumber, data.data.countryCode, inviteCode, 551 BindMiniAppByAuto(data.data.phoneNumber, data.data.countryCode, inviteCode,