feat:v1.4前端更新
This commit is contained in:
@@ -1,19 +1,27 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
import { spread } from "@/api/user";
|
||||
import Cache from "@/utils/cache";
|
||||
import { getCity } from '@/api/api.js';
|
||||
|
||||
/**
|
||||
* 静默授权绑定上下级,使用在已经登录后扫描了别人的推广二维码
|
||||
* @param {Object} puid
|
||||
*/
|
||||
export function silenceBindingSpread() {
|
||||
|
||||
|
||||
//#ifdef H5 || APP
|
||||
//#ifdef H5
|
||||
let puid = Cache.get('spread');
|
||||
//#endif
|
||||
|
||||
//#ifdef MP
|
||||
let puid = getApp().globalData.spid;
|
||||
//#endif
|
||||
//#ifdef MP || APP-PLUS
|
||||
let puid = getApp().globalData.spread;
|
||||
//#endif
|
||||
|
||||
puid = parseInt(puid);
|
||||
@@ -21,15 +29,15 @@ export function silenceBindingSpread() {
|
||||
puid = 0;
|
||||
}
|
||||
if (puid) {
|
||||
spread(puid).then(res => {}).catch(res => {});
|
||||
//#ifdef H5
|
||||
Cache.clear('spread');
|
||||
//#endif
|
||||
|
||||
//#ifdef MP
|
||||
getApp().globalData.spid = 0;
|
||||
getApp().globalData.code = 0;
|
||||
//#endif
|
||||
spread(puid).then(res => {}).catch(res => {
|
||||
//#ifdef H5
|
||||
Cache.clear("spread");
|
||||
//#endif
|
||||
|
||||
//#ifdef MP || APP-PLUS
|
||||
getApp().globalData.spread = 0;
|
||||
//#endif
|
||||
});
|
||||
} else {
|
||||
Cache.set('spread', 0);
|
||||
}
|
||||
@@ -74,6 +82,19 @@ export {
|
||||
}
|
||||
// #endif
|
||||
|
||||
|
||||
// 获取地址数据
|
||||
export function getCityList() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getCity().then(res => {
|
||||
resolve(res.data);
|
||||
let oneDay = 24 * 3600 * 1000;
|
||||
Cache.setItem({
|
||||
name: 'cityList',
|
||||
value: res.data,
|
||||
expires: oneDay * 7
|
||||
}); //设置七天过期时间
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export default parseQuery;
|
||||
|
||||
Reference in New Issue
Block a user