Commit ce0ba6ce authored by Bill's avatar Bill

修改socket

parent 56b98e4f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"api": "god-ytt", "api": "god-ytt",
"scripts:build": "node scripts/run", "scripts:build": "node scripts/run",
"scripts:build-yxc": "node scripts/run http://yxc-web-demo.shushangyun.com/api", "scripts:build-yxc": "node scripts/run http://yxc-web-demo.shushangyun.com/api",
"start:dev": "umi dev", "start:dev": "umi dev ",
"start:analyze": "ANALYZE=1 umi dev", "start:analyze": "ANALYZE=1 umi dev",
"clean": "rimraf node_modules", "clean": "rimraf node_modules",
"start": "yarn api && yarn scripts:build && umi dev", "start": "yarn api && yarn scripts:build && umi dev",
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test", "test": "umi-test",
"test:coverage": "umi-test --coverage", "test:coverage": "umi-test --coverage",
"start:cross": "cross-env SITE_ID=352 USE_ROUTE_CONFIG=false SOCKET_URL=http://10.0.0.25:8100 yarn start", "start:cross": "cross-env SITE_ID=352 USE_ROUTE_CONFIG=false SOCKET_URL=ws://10.0.0.25:8100 yarn start",
"start:url": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-all.wg.shushangyun.com USE_ROUTE_CONFIG=true SOCKET_URL=http://lingxi-all.wg.shushangyun.com yarn start", "start:url": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-all.wg.shushangyun.com USE_ROUTE_CONFIG=true SOCKET_URL=ws://lingxi-all.wg.shushangyun.com yarn start",
"start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=true SOCKET_URL=http://10.0.0.10:8100 yarn start" "start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=true SOCKET_URL=ws://10.0.0.10:8100 yarn start"
}, },
"lint-staged": { "lint-staged": {
"*.{js,jsx,less,md,json}": [ "*.{js,jsx,less,md,json}": [
......
export const NOT_CHANGE_VALUE = 'hello, world' export const NOT_CHANGE_VALUE = 'hello, world'
// socket的链接地址, 默认会使用后端接口网关地址 // socket的链接地址, 默认会使用后端接口网关地址
export const SOCKET_URL = process.env.SOCKET_URL || process.env.BACK_GATEWAY export const SOCKET_URL = process.env.SOCKET_URL || process.env.BACK_GATEWAY || "ws://10.0.0.25:8000"
export const MALL_TYPE = { export const MALL_TYPE = {
1: '企业商城', 1: '企业商城',
......
...@@ -7,7 +7,8 @@ import Location from './Location'; ...@@ -7,7 +7,8 @@ import Location from './Location';
import Roles from './Roles'; import Roles from './Roles';
import styles from '../styles/RightContent.less'; import styles from '../styles/RightContent.less';
import { Link } from 'umi'; import { Link } from 'umi';
import { getAuth } from '@/utils/auth' import { getAuth } from '@/utils/auth';
import { SOCKET_URL } from '@/constants';
// export type SiderTheme = 'light' | 'dark'; // export type SiderTheme = 'light' | 'dark';
// export interface GlobalHeaderRightProps extends Partial<ConnectProps> { // export interface GlobalHeaderRightProps extends Partial<ConnectProps> {
...@@ -15,7 +16,6 @@ import { getAuth } from '@/utils/auth' ...@@ -15,7 +16,6 @@ import { getAuth } from '@/utils/auth'
// layout: 'sidemenu' | 'topmenu'; // layout: 'sidemenu' | 'topmenu';
// } // }
const GlobalHeaderRight: React.FC<{}> = (props) => { const GlobalHeaderRight: React.FC<{}> = (props) => {
// const { theme, layout } = props; // const { theme, layout } = props;
let className = styles.right; let className = styles.right;
...@@ -30,7 +30,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => { ...@@ -30,7 +30,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
const webSocketInit = useCallback(() => { const webSocketInit = useCallback(() => {
console.log(ws.current) console.log(ws.current)
if (!ws.current || ws.current.readyState === 3) { if (!ws.current || ws.current.readyState === 3) {
ws.current = new WebSocket(`ws://10.0.0.25:8100/report/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}`); ws.current = new WebSocket(`${SOCKET_URL}/report/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}`);
ws.current.onopen = (e) => { ws.current.onopen = (e) => {
console.log(e) console.log(e)
} }
......
...@@ -138,11 +138,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => { ...@@ -138,11 +138,7 @@ const ProductModalTable:React.FC<ProductModalTableProps> = (props) => {
const handleConfirmProduct = async () => { const handleConfirmProduct = async () => {
// 判断所选择的商品是否属于同一个工作流 // 判断所选择的商品是否属于同一个工作流
<<<<<<< HEAD
const { code, data } = await PublicApi.postOrderIsWorkFlow({memberId: rowSelectionCtl.selectRow[0].memberId, productIds: rowSelectionCtl.selectedRowKeys}, { ctlType: 'none' })
=======
const res = await PublicApi.postOrderIsWorkFlow({memberId: rowSelectionCtl.selectRow[0].memberId, productIds: rowSelectionCtl.selectedRowKeys}, { ctlType: 'none' }) const res = await PublicApi.postOrderIsWorkFlow({memberId: rowSelectionCtl.selectRow[0].memberId, productIds: rowSelectionCtl.selectedRowKeys}, { ctlType: 'none' })
>>>>>>> 4d959facff1bbb3a2ebd1328ff93729394559ba4
if (res.code === 1000) { if (res.code === 1000) {
const productData = schemaAction.getFieldValue('orderProductRequests') const productData = schemaAction.getFieldValue('orderProductRequests')
......
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