Merge remote-tracking branch 'refs/remotes/yudao/master'
commit
e53cb63ce4
|
@ -156,7 +156,8 @@
|
|||
data: JSON.stringify({
|
||||
items: [{
|
||||
skuId: e.id,
|
||||
count: e.goods_num
|
||||
count: e.goods_num,
|
||||
categoryId: state.goodsInfo.categoryId
|
||||
}]
|
||||
}),
|
||||
});
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
skuId: item.sku.id,
|
||||
count: item.count,
|
||||
cartId: item.id,
|
||||
categoryId: item.spu.categoryId
|
||||
})
|
||||
goods_list.push({
|
||||
// goods_id: item.goods_id,
|
||||
|
|
|
@ -14,7 +14,7 @@ export function showAuthModal(type = 'smsLogin') {
|
|||
modal.$patch((state) => {
|
||||
state.auth = type;
|
||||
});
|
||||
}, 200);
|
||||
}, 500);
|
||||
closeAuthModal();
|
||||
} else {
|
||||
modal.$patch((state) => {
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
*/
|
||||
|
||||
import Request from 'luch-request';
|
||||
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
|
||||
import { apiPath, baseUrl, tenantId } from '@/sheep/config';
|
||||
import $store from '@/sheep/store';
|
||||
import $platform from '@/sheep/platform';
|
||||
import {
|
||||
showAuthModal
|
||||
} from '@/sheep/hooks/useModal';
|
||||
import { showAuthModal } from '@/sheep/hooks/useModal';
|
||||
import AuthUtil from '@/sheep/api/member/auth';
|
||||
import { getTerminal } from '@/sheep/util/const';
|
||||
|
||||
const options = {
|
||||
// 显示操作成功消息 默认不显示
|
||||
|
@ -93,13 +92,12 @@ http.interceptors.request.use(
|
|||
// 增加 token 令牌、terminal 终端、tenant 租户的请求头
|
||||
const token = getAccessToken();
|
||||
if (token) {
|
||||
config.header['Authorization'] = token;
|
||||
}
|
||||
// TODO 芋艿:特殊处理
|
||||
config.header['Authorization'] = token;
|
||||
}
|
||||
config.header['terminal'] = getTerminal();
|
||||
|
||||
config.header['Accept'] = '*/*';
|
||||
config.header['tenant-id'] = tenantId;
|
||||
config.header['terminal'] = '20';
|
||||
// config.header['Authorization'] = 'Bearer test247';
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
|
|
|
@ -1,3 +1,36 @@
|
|||
// ========== COMMON - 公共模块 ==========
|
||||
|
||||
/**
|
||||
* 与后端Terminal枚举一一对应
|
||||
*/
|
||||
export const TerminalEnum = {
|
||||
UNKNOWN: 0, // 未知, 目的:在无法解析到 terminal 时,使用它
|
||||
WECHAT_MINI_PROGRAM: 10, //微信小程序
|
||||
WECHAT_WAP: 11, // 微信公众号
|
||||
H5: 20, // H5 网页
|
||||
APP: 31, // 手机 App
|
||||
};
|
||||
|
||||
/**
|
||||
* 将 uni-app 提供的平台转换为后端所需的 terminal值
|
||||
*
|
||||
* @return 终端
|
||||
*/
|
||||
export const getTerminal = () => {
|
||||
const platformType = uni.getSystemInfoSync().uniPlatform;
|
||||
// 与后端terminal枚举一一对应
|
||||
switch (platformType) {
|
||||
case 'app':
|
||||
return TerminalEnum.APP;
|
||||
case 'web':
|
||||
return TerminalEnum.H5;
|
||||
case 'mp-weixin':
|
||||
return TerminalEnum.WECHAT_MINI_PROGRAM;
|
||||
default:
|
||||
return TerminalEnum.UNKNOWN;
|
||||
}
|
||||
};
|
||||
|
||||
// ========== MALL - 营销模块 ==========
|
||||
|
||||
import dayjs from "dayjs";
|
||||
|
|
Loading…
Reference in New Issue