diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..95cfff78 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +build.sh +.idea +unpackage \ No newline at end of file diff --git a/api/api.js b/api/api.js index faa7cf61..56380336 100644 --- a/api/api.js +++ b/api/api.js @@ -162,7 +162,7 @@ export function switchH5Login(){ // #endif /* - * h5切换公众号登陆 + * h5切换公众号登录 * */ // #ifdef H5 export function switchH5Login() { @@ -189,9 +189,9 @@ export function logout(){ /** * 获取订阅消息id */ -export function getTemlIds() +export function getTemlIds(data) { - return request.get('wechat/teml_ids', {}, { noAuth:true}); + return request.post('wechat/program/my/temp/list?limit=3&page=1', data , { noAuth:true}); } /** diff --git a/api/order.js b/api/order.js index 53f57659..81a1127a 100644 --- a/api/order.js +++ b/api/order.js @@ -168,10 +168,11 @@ export function orderRefundVerify(data) { * 订单确认获取订单详细信息 * @param string cartId */ -export function orderConfirm(cartId, isNew) { +export function orderConfirm(cartId, isNew, addAgain) { return request.post('order/confirm', { cartIds: cartId, - isNew: isNew + isNew: isNew, + addAgain: addAgain }, {}, 1); } @@ -203,3 +204,11 @@ export function orderCreate(key, data) { export function postOrderComputed(key, data) { return request.post("order/computed/" + key, data); } + +/** + * 将字符串 转base64 + * @param object data + */ +export function qrcodeApi(data) { + return request.post('qrcode/str2base64', data, {}, 1); +} \ No newline at end of file diff --git a/api/public.js b/api/public.js index b1f19994..42a6ac65 100644 --- a/api/public.js +++ b/api/public.js @@ -24,7 +24,7 @@ export function getWechatConfig() { export function wechatAuth(code, spread, login_type) { return request.get( "wechat/authorize/login", - { code, spread, login_type }, + { code, spread_spid:spread, login_type }, { noAuth: true } ); } @@ -41,7 +41,7 @@ export function getLogo() /** * 小程序用户登录 - * @param data object 小程序用户登陆信息 + * @param data object 小程序用户登录信息 */ export function login(code,data) { return request.post("wechat/authorize/program/login?code="+code, data, { noAuth : true }); diff --git a/api/user.js b/api/user.js index 2080f364..a228b5df 100644 --- a/api/user.js +++ b/api/user.js @@ -325,7 +325,7 @@ export function getRechargeApi() { } /** - * 登陆记录 + * 登录记录 */ export function setVisit(data) { diff --git a/components/Authorize.vue b/components/Authorize.vue index 5cfdea9f..a76aec9e 100644 --- a/components/Authorize.vue +++ b/components/Authorize.vue @@ -98,7 +98,7 @@ }) }, setUserInfo(){ - uni.showLoading({title:'正在登陆中'}); + uni.showLoading({title:'正在登录中'}); Routine.getCode().then(code=>{ this.getUserInfo(code); }).catch(res=>{ diff --git a/components/Authorize002.vue b/components/Authorize002.vue index 394e3503..0a85d2a2 100644 --- a/components/Authorize002.vue +++ b/components/Authorize002.vue @@ -103,7 +103,7 @@ setUserInfo(e){ console.log('78878787'); console.log(e); - uni.showLoading({title:'正在登陆中'}); + uni.showLoading({title:'正在登录中'}); if(e.detail.errMsg == "getPhoneNumber:ok"){ console.log('授权成功'); Routine.getCode().then(code=>{ diff --git a/components/orderGoods/index.vue b/components/orderGoods/index.vue index ea386613..ad5fb318 100644 --- a/components/orderGoods/index.vue +++ b/components/orderGoods/index.vue @@ -96,4 +96,7 @@ line-height: 86rpx; box-sizing: border-box; } + .pictrue image{ + background: #f4f4f4; + } diff --git a/components/userEvaluation/index.vue b/components/userEvaluation/index.vue index 46287951..2d4d8c77 100644 --- a/components/userEvaluation/index.vue +++ b/components/userEvaluation/index.vue @@ -73,6 +73,7 @@ width: 100%; height: 100%; border-radius: 50%; + background: #f4f4f4; } .evaluateWtapper .evaluateItem .pic-text .name { diff --git a/config/cache.js b/config/cache.js index e6e238f3..b8425e33 100644 --- a/config/cache.js +++ b/config/cache.js @@ -20,7 +20,7 @@ module.exports = { //��ȨlogoС���� LOGO_URL: 'LOGO_URL', //模板缓存 - SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE', + // SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE', TIPS_KEY: 'TIPS_KEY', diff --git a/libs/wechat.js b/libs/wechat.js index cebadf86..dfa2827d 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -153,13 +153,14 @@ class AuthWechat { } /** - * 授权登陆获取token + * 授权登录获取token * @param {Object} code */ auth(code) { return new Promise((resolve, reject) => { let loginType = Cache.get(LOGINTYPE); - wechatAuth(code, parseInt(Cache.get("spread")), loginType) + alert(Cache.get("spread")) + wechatAuth(code, Cache.get("spread"), loginType) .then(({ data }) => { @@ -173,6 +174,7 @@ class AuthWechat { }); Cache.set(WX_AUTH, code); Cache.clear(STATE_KEY); + // Cache.clear('spread'); loginType && Cache.clear(LOGINTYPE); resolve(); }) @@ -204,7 +206,7 @@ class AuthWechat { } /** - * 跳转自动登陆 + * 跳转自动登录 */ toAuth() { let that = this; @@ -223,10 +225,6 @@ class AuthWechat { return new Promise((resolve, reject) => { let configDefault = { fail(res) { - console.log('前解放后的金凤凰3'); - console.log(res); - console.log(that.instance); - console.log('前解放后的金凤凰2'); if (that.instance) return reject({ is_ready: true, wx: that.instance @@ -236,9 +234,6 @@ class AuthWechat { is_ready: true, wx: wx }); - console.log('么么么么1'); - console.log(wx); - console.log('么么么么2'); }) }, success(res) { diff --git a/main.js b/main.js index ac9ea62e..9ba62985 100644 --- a/main.js +++ b/main.js @@ -3,8 +3,11 @@ import App from './App' import store from './store' import Cache from './utils/cache' import util from 'utils/util' +import configs from './config/app.js' + Vue.prototype.$util = util; +Vue.prototype.$config = configs; Vue.prototype.$Cache = Cache; Vue.prototype.$eventHub = new Vue(); Vue.config.productionTip = false diff --git a/manifest.json b/manifest.json index bd90133e..7b9f5fdc 100644 --- a/manifest.json +++ b/manifest.json @@ -68,6 +68,13 @@ "desc" : "你的位置信息将用于和门店的距离长度" } }, + // "plugins" : { + // "chat" : { + // "version" : "1.0.8", + // "provider" : "wx738958e0f4c894f9" + // } + // }, + // "sitemapLocation" : "sitemap.json", "usingComponents" : true }, "mp-alipay" : { diff --git a/pages.json b/pages.json index 876aefc7..562fed2f 100644 --- a/pages.json +++ b/pages.json @@ -109,7 +109,7 @@ // #endif } } - ], + ], "subPackages": [ { "root": "pages/users", diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue index 371043ee..a0b25b67 100644 --- a/pages/goods_details/index.vue +++ b/pages/goods_details/index.vue @@ -216,6 +216,8 @@ diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue index 0151d2eb..8ca3fa62 100644 --- a/pages/users/order_confirm/index.vue +++ b/pages/users/order_confirm/index.vue @@ -270,7 +270,8 @@ isShowAuth: false, //是否隐藏授权 from: '', news: true, - again: false + again: false, + addAgain: false }; }, computed: mapGetters(['isLogin']), @@ -294,6 +295,7 @@ this.is_address = options.is_address ? true : false; this.news = options.new || true; this.again = options.again || false; + this.addAgain = options.addAgain || false; if (this.isLogin) { this.getaddressInfo(); this.getConfirm(); @@ -361,8 +363,8 @@ * 获取门店列表数据 */ getList: function() { - let longitude = uni.getStorageSync("CACHE_LONGITUDE"); //经度 - let latitude = uni.getStorageSync("CACHE_LATITUDE"); //纬度 + let longitude = uni.getStorageSync("user_longitude"); //经度 + let latitude = uni.getStorageSync("user_latitude"); //纬度 let data = { latitude: latitude, //纬度 longitude: longitude, //经度 @@ -400,6 +402,7 @@ shippingType: parseInt(shippingType) + 1, payType: this.payType }).then(res => { + console.log(res) let result = res.data.result.result; if (result) { this.totalPrice = result.orderId.payPrice; @@ -408,7 +411,11 @@ this.integral = this.useIntegral ? result.orderId.surplusIntegral : this.userInfo.integral; this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.orderId.payPostage); } - }) + }).catch(err => { + return this.$util.Tips({ + title: err + }); + }); }, addressType: function(e) { let index = e; @@ -494,7 +501,7 @@ */ getConfirm: function() { let that = this; - orderConfirm(that.cartId,that.again).then(res => { + orderConfirm(that.cartId,that.news,this.addAgain).then(res => { that.$set(that, 'userInfo', res.data.userInfo); that.$set(that, 'integral', res.data.userInfo.integral); that.$set(that, 'cartInfo', res.data.cartInfo); @@ -570,17 +577,21 @@ let that = this; if (that.addressId) { getAddressDetail(that.addressId).then(res => { - res.data.isDefault = parseInt(res.data.isDefault); - that.addressInfo = res.data || {}; - that.addressId = res.data.id || 0; - that.address.addressId = res.data.id || 0; + if(res.data){ + res.data.isDefault = parseInt(res.data.isDefault); + that.addressInfo = res.data || {}; + that.addressId = res.data.id || 0; + that.address.addressId = res.data.id || 0; + } }) } else { getAddressDefault().then(res => { - res.data.isDefault = parseInt(res.data.isDefault); - that.addressInfo = res.data || {}; - that.addressId = res.data.id || 0; - that.address.addressId = res.data.id || 0; + if(res.data){ + res.data.isDefault = parseInt(res.data.isDefault); + that.addressInfo = res.data || {}; + that.addressId = res.data.id || 0; + that.address.addressId = res.data.id || 0; + } }) } }, @@ -820,8 +831,6 @@ title: '暂无门店,请选择其他方式' }); } - console.log('坎坎坷坷扩'); - console.log(that.news); data = { realName: that.contacts, phone: that.contactsTel, diff --git a/pages/users/user_get_coupon/index.vue b/pages/users/user_get_coupon/index.vue index 832f3999..096d3c5e 100644 --- a/pages/users/user_get_coupon/index.vue +++ b/pages/users/user_get_coupon/index.vue @@ -108,8 +108,8 @@ that.$set(that,'couponsList',list); that.$util.Tips({ title: '领取成功' }); },function(res){ - return that.$util.Tips({title:res.msg}); - }); + return that.$util.Tips({title:res}); + }) }, /** * 获取领取优惠券列表 diff --git a/pages/users/wechat_login/index.vue b/pages/users/wechat_login/index.vue new file mode 100644 index 00000000..74196aa9 --- /dev/null +++ b/pages/users/wechat_login/index.vue @@ -0,0 +1,373 @@ + + + + + diff --git a/plugin/chat/yzf_chat.js b/plugin/chat/yzf_chat.js new file mode 100644 index 00000000..1defb445 --- /dev/null +++ b/plugin/chat/yzf_chat.js @@ -0,0 +1 @@ +!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=+new Date,o="yzfh5-data-"+i,a="yzfh5-main-chat-"+i,r="yzfh5-main-iframe-"+i,c="yzfh5-main-contact-"+i,d="yzfh5-chat-btn-"+i,s="yzfh5-dot-"+i,l="yzfh5-state-"+i,u="yzfh5-icon-"+i;t.default={scope:o,mainChatId:a,mainIframeId:r,mainContactId:c,chatBtnId:d,dotId:s,stateId:l,iconId:u}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={isMobile:function(){var e=!1;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(e=!0),e}()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElem=function(e){return document.getElementById(e)},t.hideElem=function(e){e.style.display="none"},t.showElem=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e.style.display=t}},function(e,t,n){e.exports=n(4)},function(e,t,n){"use strict";var i=n(5),o=Object({NODE_ENV:"development",YZF_CHAT_WEB_CHAT:"https://yzf.qq.com/xv/web/static/chat/index.html",YZF_CHAT_WEB_PREFIX:"https://yzf.qq.com/xv/web"})||!1,a=o.YZF_CHAT_WEB_CHAT,r=void 0===a?"https://yzf.qq.com/xv/web/static/chat/index.html":a,c=o.YZF_CHAT_WEB_PREFIX,d=void 0===c?"https://yzf.qq.com/xv/web":c,s=!1,l={init:function(e){if(!s){var t=e.sign||"",n=e.data||{},o=e.uid||"",a=e.selector||"",c=e.callback,l=!("rmb"in e)||e.rmb,u="goodImg"in e?e.goodImg:"contain",f=!0===e.nofixed,p=r+"?inner=1&sign="+t+"&uid="+o+"&rmb="+l+"&goodImg="+u;if(n&&Object.keys(n).length)p+="&c1="+(n.c1||""),p+="&c2="+(n.c2||""),p+="&c3="+(n.c3||""),p+="&c4="+(n.c4||""),p+="&c5="+(n.c5||"");f&&(p+="&nofixed=1"),(0,i.render)(p,d,a,c,t),s=!0}},close:function(){(0,i.close)()}};window.yzf=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.render=function(e,t,n,c,s){var h=(0,i.default)({id:o.default,isMobile:f});h=(h=h.replace(new RegExp(u,"g"),o.default.scope)).replace(new RegExp("https://kf.qq.com/xv-dev/web","g"),t);var x=document.createElement("div");x.innerHTML=h,x.style.display="none",document.body.appendChild(x);var b=function(){x.style.display="block"},g=setTimeout(b,3e3),y=(0,r.getElem)(o.default.mainChatId);!f&&(y.style.zIndex=2147483647);var _=(0,r.getElem)(o.default.dotId),v=(0,r.getElem)(o.default.stateId),E=(0,r.getElem)(o.default.mainIframeId),w=(0,r.getElem)(o.default.mainContactId),I=w;if(n)try{var F=document.querySelector(n);F&&(p=!1,I=F,w.remove(),clearTimeout(g),g=null,b())}catch(Y){console.error(Y)}p&&(0,d.loadTheme)(t,s,function(e,t){var n=!1;if(e&&t&&0==t.status){var i=null;try{i=JSON.parse(t.data)}catch(Y){}if(i&&i.custom_color){var a=i.custom_color,c=(0,r.getElem)(o.default.chatBtnId);console.log(2222,e,t,i,c),c&&(c.style.backgroundColor=a,c.parentNode&&c.parentNode.parentNode&&(c.parentNode.parentNode.style.display="block"))}else n=!0}else n=!0;clearTimeout(g),g=null,n&&b(),(0,r.showElem)(w)});I.addEventListener("click",function(){l||(l=!0,E.src=e,E.onload=function(){E.contentWindow.postMessage({type:"init"},"*")}),(0,r.showElem)(y),p&&((0,r.hideElem)(I),(0,r.hideElem)(_),(0,r.hideElem)(v))}),a.default.listen(I,c,p),p&&(window.onresize=m,m())},t.close=function(){var e=(0,r.getElem)(o.default.mainChatId),t=(0,r.getElem)(o.default.mainContactId);(0,r.hideElem)(e),p&&(0,r.showElem)(t)};var i=s(n(6)),o=s(n(0)),a=s(n(10)),r=n(2),c=s(n(1)),d=n(11);function s(e){return e&&e.__esModule?e:{default:e}}var l=!1,u="YZF_STYLE_PREFIX",f=c.default.isMobile,p=!0;function m(){var e=(0,r.getElem)(o.default.chatBtnId).getElementsByClassName("txt")[0],t=window.innerWidth;e.textContent=t>=1e3?"\u8054\u7cfb\u5ba2\u670d":"\u5ba2\u670d"}},function(e,t,n){var i=n(7);e.exports=function(e){"use strict";e=e||{};var t="",n=i.$escape,o=e.id,a=e.isMobile;return t+='\n\n'}},function(e,t,n){"use strict";e.exports=n(8)},function(e,t,n){"use strict";(function(t){var n="undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof t?t:{},i=Object.create(n),o=/["&'<>]/;i.$escape=function(e){return function(e){var t=""+e,n=o.exec(t);if(!n)return e;var i="",a=void 0,r=void 0,c=void 0;for(a=n.index,r=0;a=200&&this.status<300||304===this.status){var e=this.responseText;try{var n=JSON.parse(e);n?t(!0,n):t(!1)}catch(i){t(!1)}}},n.ontimeout=function(){t(!1)},n.onerror=function(){t(!1)},n.open("GET",e),n.send(null)}}]); \ No newline at end of file diff --git a/store/getters.js b/store/getters.js index 4b6be6e3..789199c2 100644 --- a/store/getters.js +++ b/store/getters.js @@ -6,6 +6,7 @@ export default { uid:state => state.app.uid, homeActive: state => state.app.homeActive, home: state => state.app.home, + chatUrl: state => state.app.chatUrl }; // export default { // token: state => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJrYWlmYS5jcm1lYi5uZXQiLCJhdWQiOiJrYWlmYS5jcm1lYi5uZXQiLCJpYXQiOjE1NzcwODM1MzQsIm5iZiI6MTU3NzA4MzUzNCwiZXhwIjoxNTc3MDk0MzM0LCJqdGkiOnsiaWQiOjExMCwidHlwZSI6InVzZXIifX0.U-i1pbdRjyXI1gr79Uq2XBPZ89T8f5Ai9jwrR8woTwE', diff --git a/store/modules/app.js b/store/modules/app.js index c53bbdf2..d25f8175 100644 --- a/store/modules/app.js +++ b/store/modules/app.js @@ -16,6 +16,7 @@ const state = { userInfo: null, uid: Cache.get(UID) || null, homeActive: false, + chatUrl: Cache.get('chatUrl') || '', }; const mutations = { @@ -49,6 +50,9 @@ const mutations = { CLOSE_HOME(state) { state.homeActive = false; }, + SET_CHATURL(state, chatUrl){ + state.chatUrl = chatUrl; + } }; const actions = { diff --git a/utils/SubscribeMessage.js b/utils/SubscribeMessage.js index ddb8cf9b..7f17b298 100644 --- a/utils/SubscribeMessage.js +++ b/utils/SubscribeMessage.js @@ -1,25 +1,22 @@ -import { - SUBSCRIBE_MESSAGE -} from '../config/cache.js'; +// import { +// SUBSCRIBE_MESSAGE +// } from '../config/cache.js'; +const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"]; -export function auth() { - let tmplIds = {}; - let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE); - tmplIds = messageTmplIds ? JSON.parse(messageTmplIds) : {}; - return tmplIds; -} +// export function auth() { +// let tmplIds = {}; +// let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE); +// tmplIds = messageTmplIds ? JSON.parse(messageTmplIds) : {}; +// return tmplIds; +// } /** * 支付成功后订阅消息id * 订阅 确认收货通知 订单支付成功 新订单管理员提醒 */ export function openPaySubscribe() { - let tmplIds = auth(); - return subscribe([ - tmplIds.oreder_takever, - tmplIds.order_pay_success, - tmplIds.order_new, - ]); + let tmplIds = uni.getStorageSync('tempID' + arrTemp[0]); + return subscribe(tmplIds); } /** @@ -27,12 +24,8 @@ export function openPaySubscribe() { * 送货 发货 取消订单 */ export function openOrderSubscribe() { - let tmplIds = auth(); - return subscribe([ - tmplIds.order_deliver_success, - tmplIds.order_postage_success, - tmplIds.order_clone - ]); + let tmplIds = uni.getStorageSync('tempID' + arrTemp[1]); + return subscribe(tmplIds); } /** @@ -40,10 +33,8 @@ export function openOrderSubscribe() { * 成功 和 失败 消息 */ export function openExtrctSubscribe() { - let tmplIds = auth(); - return subscribe([ - tmplIds.user_extract - ]); + let tmplIds = uni.getStorageSync('tempID' + arrTemp[2]); + return subscribe(tmplIds); } /** @@ -70,25 +61,25 @@ export function openBargainSubscribe() { * 订单退款 */ export function openOrderRefundSubscribe() { - let tmplIds = auth(); - return subscribe([tmplIds.order_refund]); + let tmplIds = uni.getStorageSync('tempID' + arrTemp[3]); + return subscribe(tmplIds); } /** * 充值成功 */ export function openRechargeSubscribe() { - let tmplIds = auth(); - return subscribe([tmplIds.recharge_success]); + let tmplIds = uni.getStorageSync('tempID' + arrTemp[4]); + return subscribe(tmplIds); } -/** - * 提现 - */ -export function openEextractSubscribe() { - let tmplIds = auth(); - return subscribe([tmplIds.user_extract]); -} +// /** +// * 提现 +// */ +// export function openEextractSubscribe() { +// let tmplIds = JSON.parse(uni.getStorageSync('tempID' + paySubscribe)); +// return subscribe(tmplIds); +// } /** * 调起订阅界面 diff --git a/utils/index.js b/utils/index.js index cd61145b..31c132ce 100644 --- a/utils/index.js +++ b/utils/index.js @@ -2,7 +2,7 @@ import { spread } from "@/api/user"; import Cache from "@/utils/cache"; /** - * 绑定用户授权 + * 静默授权绑定上下级,使用在已经登录后扫描了别人的推广二维码 * @param {Object} puid */ export function silenceBindingSpread() @@ -25,20 +25,21 @@ export function silenceBindingSpread() puid = 0; } if(puid){ - spread(puid).then(res=>{ - console.log(res); - //#ifdef H5 - Cache.clear('spread'); - //#endif - - //#ifdef MP - getApp().globalData.spid = 0; - getApp().globalData.code = 0; - //#endif - - }).catch(res=>{ - console.log(res); - }); + //#ifdef H5 + Cache.set('spread', 0); + //#endif + + //#ifdef MP + getApp().globalData.spid = 0; + getApp().globalData.code = 0; + //#endif + // spread(puid).then(res=>{ + // console.log(res); + // }).catch(res=>{ + // console.log(res); + // }); + }else{ + Cache.set('spread', 0); } } diff --git a/utils/request.js b/utils/request.js index db8cd04b..f369e7f8 100644 --- a/utils/request.js +++ b/utils/request.js @@ -27,7 +27,7 @@ function baseRequest(url, method, data, { if (!store.state.app.token && !checkLogin()) { toLogin(); return Promise.reject({ - msg: '未登陆' + msg: '未登录' }); } }