Commit 04c231d7 authored by 武广's avatar 武广

feat: 添加平台校验

parent cac87ce8
......@@ -3,6 +3,7 @@ import { connect } from 'dva';
import { Redirect } from 'umi';
import PageLoading from '@/components/PageLoading';
import localStorage from '@/utils/localStorage';
import sessionStorage from '@/utils/sessionStorage';
import { getUrlSearchParams, getToken } from '@/utils/utils';
class SecurityLayout extends React.Component {
......@@ -30,6 +31,8 @@ class SecurityLayout extends React.Component {
const isTob = searchPrams.source === 'tob';
if (isTob) {
localStorage.set('tobToken', searchPrams.token || '');
// 角色 searchPrams.isMaster (1:平台 0:pop)
sessionStorage.set('role', +searchPrams.isMaster === 1 ? 'platform' : 'tobMerchant');
}
const { isReady } = this.state;
......
import { apiEnterpriseList } from './index';
import { apiEnterpriseList, apiShopList } from './index';
// 获取企业列表
export const getEnterpriseList = async (name = '') => {
const res = await apiEnterpriseList({ name });
......@@ -9,3 +9,13 @@ export const getEnterpriseList = async (name = '') => {
})),
};
};
// 获取店铺列表
export const getShopList = async (name = '') => {
const res = await apiShopList({ name });
return {
id: res[res.length - 1].id,
list: res.map(item => ({
[item.id]: { text: item.name },
})),
};
};
......@@ -13,11 +13,21 @@ export async function apiTakeawayList(param) {
prefix: goodsApi,
});
}
/**
* 企业客户列表
* http://yapi.quantgroups.com/project/389/interface/api/65324
*/
export async function apiEnterpriseList(param) {
return request.post('/api/consoles/enterprise/pageList', {
data: param,
prefix: goodsApi,
});
}
/**
* 模糊查询店铺列表
* http://yapi.quantgroups.com/project/389/interface/api/65289
*/
export async function apiEnterpriseList(param) {
export async function apiShopList(param) {
return request.post('/api/consoles/shops/getListByName', {
data: param,
prefix: goodsApi,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment