Commit 18e64979 by zhujian

fix

parent 60bcf37b
......@@ -72,7 +72,7 @@ function getClientEnvironment(publicUrl) {
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
BREND: process.env.BREND || 'xiaomai',
BRAND: process.env.BRAND || 'xiaomai',
DEPLOY_ENV: process.env.DEPLOY_ENV,
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
......
......@@ -125,14 +125,14 @@
"command": "node scripts/start.js",
"env": {
"DEPLOY_ENV": "",
"BREND": "syoo"
"BRAND": "syoo"
}
},
"build:syoo": {
"command": "node scripts/build.js",
"env": {
"DEPLOY_ENV": "prod",
"BREND": "syoo"
"BRAND": "syoo"
}
}
},
......
......@@ -104,11 +104,12 @@
const appTermEnum = getParameterByName('appTermEnum');
const code = getParameterByName('code');
const ticket = getParameterByName('ticket');
const corpType = getParameterByName('corpType');
if (!code) {
postJSON('hades/anon/hades/getCorpTrainSuiteId', {}, (res) => {
postJSON('hades/anon/hades/getCorpTrainSuiteId', { corpType }, (res) => {
const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${res.result}&redirect_uri=${encodeURIComponent(location.href)}&response_type=code&scope=snsapi_privateinfo&state=STATE#wechat_redirect`
location.href = url
})
......
......@@ -8,7 +8,7 @@
*/
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError } from 'axios';
import { message, Modal } from 'antd';
import { corpType } from '@/domains/brand/constants'
import { BASIC_HOST, TIME_OUT, USER_TYPE, VERSION, PROJECT } from '@/domains/basic-domain/constants';
import User from './user';
......@@ -130,7 +130,7 @@ class Axios {
if (method === 'GET') {
config = Object.assign({ params, url: `${BASIC_HOST}${_url}`, method });
} else {
config = Object.assign({ data: params, url: `${BASIC_HOST}${_url}`, method });
config = Object.assign({ data: { corpType, ...(params || {}) }, url: `${BASIC_HOST}${_url}`, method });
}
instance(config).then((res: AxiosResponse): void => {
......
export const BREND: any = process.env.BREND;
export const BRAND: any = process.env.BRAND;
const BrandNameMap: any = {
xiaomai: '小麦企学院',
......@@ -27,21 +27,25 @@ const PATH_MAP: any = {
}
const LIVE_SHARE_MAP: any = {
dev: 'https://dev.xiaomai5.com/store-live/index.html#/',
dev1: 'https://dev.xiaomai5.com/store-live/index.html#/',
rc: 'https://rc.xiaomai5.com/store-live/index.html#/',
gray: 'https://res.xiaomai0.com/store-live/gray/index.html#/',
prod: 'https://res.xiaomai0.com/store-live/index.html#/',
}
xiaomai: 'https://res.xiaomai0.com/store-live/index.html#/',
syoo: 'https://res.xiaomai0.com/store-live/index.html#/',
}
const CorpType_MAP: any = {
xiaomai: 'X_Mai',
syoo: 'S_You',
}
export const brandName: string = BrandNameMap[BREND];
export const brandIcon: string = BrandIconMap[BREND];
export const brandLogo: string = BrandLogoMap[BREND];
export const brandBanner: string = BrandBannerMap[BREND];
export const path: string = PATH_MAP[BREND];
export const live: string = LIVE_SHARE_MAP[BREND];
window.brandName = BrandNameMap[BREND];
export const brandName: string = BrandNameMap[BRAND];
export const brandIcon: string = BrandIconMap[BRAND];
export const brandLogo: string = BrandLogoMap[BRAND];
export const brandBanner: string = BrandBannerMap[BRAND];
export const path: string = PATH_MAP[BRAND];
export const live: string = LIVE_SHARE_MAP[BRAND];
export const corpType: string = CorpType_MAP[BRAND];
window.brandName = BrandNameMap[BRAND];
......@@ -23,7 +23,7 @@ import '@/core/xmTD';
import User from '@/common/js/user';
import Service from "@/common/js/service";
import BaseService from '@/domains/basic-domain/baseService';
import {brandName,BREND,brandIcon} from '@/domains/brand/constants'
import {brandName,BRAND,brandIcon} from '@/domains/brand/constants'
declare var getParameterByName: any;
declare var window: any;
......@@ -32,7 +32,7 @@ const history = createHashHistory();
document.title=brandName;
var iconUrl ='https://image.xiaomaiketang.com/xm/WGWCtxiGzE.png'
if(BREND !='xiaomai'){
if(BRAND !='xiaomai'){
iconUrl =brandIcon
}
......
......@@ -2,9 +2,9 @@ import React, { useState, useRef, useEffect } from 'react';
import qrcode from '@/libs/qrcode/qrcode.js';
import Service from '@/common/js/service';
import User from '@/common/js/user';
import { PATH } from '@/domains/basic-domain/constants';
import { PATH, corpType } from '@/domains/basic-domain/constants';
import './WechatLogin.less';
import {brandName,BREND,brandIcon,brandLogo} from '@/domains/brand/constants'
import { brandName, BRAND, brandIcon, brandLogo } from '@/domains/brand/constants'
declare var location: any;
declare var window: any;
......@@ -27,7 +27,7 @@ export default function WechatLogin(props: any) {
if (status === 0) {
Service.Hades('anon/hades/getTicket', {}).then((res: any) => {
setTicket(res.result);
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}`;
const redirect = `${PATH}?ticket=${res.result}&appTermEnum=XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN&env=${process.env.DEPLOY_ENV || 'dev'}&corpType=${corpType}`;
const qrcodeWrapDom: any = document.querySelector('#qrcode');
let qrnode = new qrcode({
text: redirect,
......
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