全新UI视觉体验,移动端API优化降低重复调用,提高并发6倍,修复N多Bug
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
// import {
|
||||
// SUBSCRIBE_MESSAGE
|
||||
// } from '../config/cache.js';
|
||||
const arrTemp = ["beforePay","afterPay","refundApply", "beforeRecharge", "createBargain","pink"];
|
||||
|
||||
// export function auth() {
|
||||
@@ -16,7 +13,6 @@ const arrTemp = ["beforePay","afterPay","refundApply", "beforeRecharge", "creat
|
||||
*/
|
||||
export function openPaySubscribe() {
|
||||
let tmplIds = uni.getStorageSync('tempID' + arrTemp[0]);
|
||||
console.log(tmplIds)
|
||||
return subscribe(tmplIds);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,16 @@ class Cache {
|
||||
return Math.round(new Date() / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串转时间戳
|
||||
* @param {Object} expiresTime
|
||||
*/
|
||||
strTotime(expiresTime){
|
||||
let expires_time = expiresTime.substring(0, 19);
|
||||
expires_time = expires_time.replace(/-/g, '/');
|
||||
return Math.round(new Date(expires_time).getTime() / 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置过期时间缓存
|
||||
* @param {Object} key
|
||||
|
||||
@@ -14,9 +14,6 @@ export function silenceBindingSpread() {
|
||||
|
||||
//#ifdef MP
|
||||
let puid = getApp().globalData.spid;
|
||||
if (!puid) {
|
||||
puid = getApp().globalData.code;
|
||||
}
|
||||
//#endif
|
||||
|
||||
puid = parseInt(puid);
|
||||
|
||||
@@ -22,7 +22,6 @@ function baseRequest(url, method, data, {
|
||||
if (params != undefined) {
|
||||
header = HEADERPARAMS;
|
||||
}
|
||||
console.log('Url:',Url);
|
||||
if (!noAuth) {
|
||||
//登录过期自动登录
|
||||
if (!store.state.app.token && !checkLogin()) {
|
||||
@@ -32,9 +31,7 @@ function baseRequest(url, method, data, {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
|
||||
|
||||
return new Promise((reslove, reject) => {
|
||||
uni.request({
|
||||
url: Url + '/api/front/' + url,
|
||||
|
||||
1120
app/utils/util.js
1120
app/utils/util.js
File diff suppressed because it is too large
Load Diff
@@ -34,8 +34,6 @@ export function checkPhone(phone) {
|
||||
export const Debounce = (fn, t) => {
|
||||
const delay = t || 500
|
||||
let timer
|
||||
console.log(fn)
|
||||
console.log(typeof fn)
|
||||
return function() {
|
||||
const args = arguments
|
||||
if (timer) {
|
||||
@@ -49,4 +47,3 @@ export const Debounce = (fn, t) => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user