Commit 9e46dec4 by maolipeng

Merge branch 'dev' of…

Merge branch 'dev' of ssh://xmgit.ixm5.cn:10022/xiaomai-cloud-class/xiaomai-cloud-class-web into dev
parents 6e0718c5 57ea00d5
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
"start:dev1": "cross-env DEPLOY_ENV=dev node scripts/start.js", "start:dev1": "cross-env DEPLOY_ENV=dev node scripts/start.js",
"start:rc": "cross-env DEPLOY_ENV=rc node scripts/start.js", "start:rc": "cross-env DEPLOY_ENV=rc node scripts/start.js",
"start:gray": "cross-env DEPLOY_ENV=gray node scripts/start.js", "start:gray": "cross-env DEPLOY_ENV=gray node scripts/start.js",
"start:prod": "cross-env DEPLOY_ENV=prod node scripts/start.js",
"build:dev": "cross-env DEPLOY_ENV=dev node --max_old_space_size=4096 scripts/build.js", "build:dev": "cross-env DEPLOY_ENV=dev node --max_old_space_size=4096 scripts/build.js",
"build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js", "build:dev1": "cross-env DEPLOY_ENV=dev node scripts/build.js",
"build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js", "build:rc": "cross-env DEPLOY_ENV=rc node scripts/build.js",
......
...@@ -44,6 +44,10 @@ const FileVerifyMap = { ...@@ -44,6 +44,10 @@ const FileVerifyMap = {
type: "word", type: "word",
maxSize: 100 maxSize: 100
}, },
"application/wps-writer": {
type: "word",
maxSize: 100,
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": { "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
type: "word", type: "word",
maxSize: 100 maxSize: 100
......
...@@ -26,8 +26,8 @@ export default class WechatApi { ...@@ -26,8 +26,8 @@ export default class WechatApi {
nonceStr: res.nonceStr, // 必填,生成签名的随机串 nonceStr: res.nonceStr, // 必填,生成签名的随机串
signature: res.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法 signature: res.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: ['chooseImage', 'shareToExternalContact', 'selectExternalContact', 'selectEnterpriseContact'], jsApiList: ['chooseImage', 'shareToExternalContact', 'selectExternalContact', 'selectEnterpriseContact'],
}); }).then(() => {
console.log('微信config设置完毕')
if (params.isAgentConfig) { if (params.isAgentConfig) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
Service.Hades('anon/hades/getWxWorkJSAPISignature', { Service.Hades('anon/hades/getWxWorkJSAPISignature', {
...@@ -48,6 +48,7 @@ export default class WechatApi { ...@@ -48,6 +48,7 @@ export default class WechatApi {
resolve(res); resolve(res);
}, },
fail: (err) => { fail: (err) => {
console.log(1213545344545)
console.log(err, 'err-agentconfig'); console.log(err, 'err-agentconfig');
reject(err); reject(err);
}, },
...@@ -55,6 +56,9 @@ export default class WechatApi { ...@@ -55,6 +56,9 @@ export default class WechatApi {
}); });
}); });
} }
})
}); });
} }
......
...@@ -2,7 +2,8 @@ import React, { useRef, useLayoutEffect } from 'react' ...@@ -2,7 +2,8 @@ import React, { useRef, useLayoutEffect } from 'react'
export default function WWOpenDataCom({ type, openid }) { export default function WWOpenDataCom({ type, openid }) {
const ref = useRef(null) const ref = useRef(null)
useLayoutEffect(() => { useLayoutEffect(() => {
WWOpenData.bind(ref.current) console.log(WWOpenData)
WWOpenData && WWOpenData.bind(ref.current)
}) })
return <ww-open-data ref={ref} type={type} openid={openid} /> return <ww-open-data ref={ref} type={type} openid={openid} />
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
@import './variables.less'; @import './variables.less';
@active-color: #2966FF; @active-color: #2966ff;
// 消息提示框 // 消息提示框
.ant-message { .ant-message {
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
.ant-switch-small:after { .ant-switch-small:after {
top: 0.3px; top: 0.3px;
} }
tbody .ant-switch-small {
min-width: 32px;
}
.ant-pagination { .ant-pagination {
display: inline !important; display: inline !important;
...@@ -234,7 +237,7 @@ ...@@ -234,7 +237,7 @@
} }
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn { .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
font-weight: 500!important; font-weight: 500 !important;
} }
.ant-tabs-nav .ant-tabs-tab-active { .ant-tabs-nav .ant-tabs-tab-active {
...@@ -264,7 +267,7 @@ ...@@ -264,7 +267,7 @@
position: absolute; position: absolute;
width: 30px; width: 30px;
height: 4px; height: 4px;
background: #2966FF !important; background: #2966ff !important;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
...@@ -339,14 +342,14 @@ mr0 { ...@@ -339,14 +342,14 @@ mr0 {
background: #f3f6fa; background: #f3f6fa;
.ant-select-selected-icon { .ant-select-selected-icon {
color:#2966FF !important; color: #2966ff !important;
} }
} }
.ant-select-dropdown-menu-item-selected { .ant-select-dropdown-menu-item-selected {
background: none; background: none;
font-weight: 400 !important; font-weight: 400 !important;
color:#2966FF; color: #2966ff;
} }
.ant-select-open .ant-select-selection { .ant-select-open .ant-select-selection {
...@@ -444,7 +447,7 @@ mr0 { ...@@ -444,7 +447,7 @@ mr0 {
.ant-modal { .ant-modal {
.ant-input { .ant-input {
&:focus { &:focus {
border: 1px solid #2966FF !important; border: 1px solid #2966ff !important;
} }
} }
} }
...@@ -457,8 +460,8 @@ mr0 { ...@@ -457,8 +460,8 @@ mr0 {
.ant-calendar-footer-extra { .ant-calendar-footer-extra {
.ant-tag-blue { .ant-tag-blue {
background: #fff; background: #fff;
color: #2966FF; color: #2966ff;
border-color: #2966FF; border-color: #2966ff;
} }
} }
} }
...@@ -474,7 +477,7 @@ mr0 { ...@@ -474,7 +477,7 @@ mr0 {
} }
.ant-modal-confirm-info .ant-modal-confirm-body > .anticon { .ant-modal-confirm-info .ant-modal-confirm-body > .anticon {
color: #2966FF!important; color: #2966ff !important;
} }
.ant-breadcrumb > span:last-child .ant-breadcrumb-separator { .ant-breadcrumb > span:last-child .ant-breadcrumb-separator {
...@@ -502,7 +505,7 @@ mr0 { ...@@ -502,7 +505,7 @@ mr0 {
font-size: 22px !important; font-size: 22px !important;
line-height: 22px !important; line-height: 22px !important;
float: left !important; float: left !important;
color:#2966FF !important; color: #2966ff !important;
margin-right: 16px !important; margin-right: 16px !important;
&.blue { &.blue {
color: #5cbaff !important; color: #5cbaff !important;
...@@ -527,8 +530,8 @@ mr0 { ...@@ -527,8 +530,8 @@ mr0 {
float: left; float: left;
margin-right: 16px; margin-right: 16px;
} }
>.confirm-icon{ > .confirm-icon {
color: #2966FF; color: #2966ff;
} }
.ant-modal-confirm-content { .ant-modal-confirm-content {
margin-left: 38px; margin-left: 38px;
...@@ -594,9 +597,9 @@ mr0 { ...@@ -594,9 +597,9 @@ mr0 {
// background: #FAFAFA !important; // background: #FAFAFA !important;
// } // }
.ant-table-thead > tr > th{ .ant-table-thead > tr > th {
font-weight:bold !important; font-weight: bold !important;
color:#333 !important; color: #333 !important;
} }
td.ant-table-column-sort { td.ant-table-column-sort {
background: none; background: none;
...@@ -657,11 +660,11 @@ td.ant-table-column-sort { ...@@ -657,11 +660,11 @@ td.ant-table-column-sort {
border-color: @xm-color-text-select-primary !important; border-color: @xm-color-text-select-primary !important;
border: none !important; border: none !important;
&:hover { &:hover {
background-color: #2966FF !important; background-color: #2966ff !important;
opacity: 0.8 !important; opacity: 0.8 !important;
} }
&:active{ &:active {
background-color:#5C8AFF !important; background-color: #5c8aff !important;
} }
} }
...@@ -720,9 +723,9 @@ td.ant-table-column-sort { ...@@ -720,9 +723,9 @@ td.ant-table-column-sort {
border-right: 0px !important; border-right: 0px !important;
} }
.ant-input-search > .ant-input-group > .ant-input-group-addon:last-child .ant-input-search-button span{ .ant-input-search > .ant-input-group > .ant-input-group-addon:last-child .ant-input-search-button span {
color:#bfbfbf !important; color: #bfbfbf !important;
font-size:12px; font-size: 12px;
} }
.ant-modal-footer { .ant-modal-footer {
...@@ -774,4 +777,3 @@ td.ant-table-column-sort { ...@@ -774,4 +777,3 @@ td.ant-table-column-sort {
.ant-table-column-sorter { .ant-table-column-sorter {
margin-left: 8px !important; margin-left: 8px !important;
} }
...@@ -16,19 +16,21 @@ export default class WechatApi { ...@@ -16,19 +16,21 @@ export default class WechatApi {
signature: res.signature, signature: res.signature,
jsApiList: ['startLiving','downloadLivingReplay'], jsApiList: ['startLiving','downloadLivingReplay'],
success: function(res) { success: function(res) {
console.log('agentConfig注册成功')
console.log(res,'agentConfig') console.log(res,'agentConfig')
}, },
fail: function(res) { fail: function(res) {
console.log(res,' agentConfig 错误') console.log(res,' agentConfig1 错误')
if(res.errMsg.indexOf('function not exist') > -1){ if(res.errMsg.indexOf('function not exist') > -1){
alert('版本过低请升级') alert('版本过低请升级')
} }
}, },
complete:(res)=>{ complete:(res)=>{
console.log(res,' agentConfig 错误') console.log(res,' agentConfig2 错误')
} }
} }
console.log(conf) console.log(conf)
wx.agentConfig(conf); wx.agentConfig(conf);
}); });
// } // }
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-20 09:21:40 * @Date: 2020-08-20 09:21:40
* @LastEditors: zhangleyuan * @LastEditors: yuananting
* @LastEditTime: 2021-03-04 17:16:30 * @LastEditTime: 2021-07-15 11:48:58
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -77,6 +77,10 @@ const FILR_VERIFY_MAP = { ...@@ -77,6 +77,10 @@ const FILR_VERIFY_MAP = {
type: "word", type: "word",
maxSize: 100 maxSize: 100
}, },
"application/wps-writer": {
type: "word",
maxSize: 100,
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": { "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
type: "word", type: "word",
maxSize: 100 maxSize: 100
......
...@@ -108,12 +108,10 @@ function EmployeeManage() { ...@@ -108,12 +108,10 @@ function EmployeeManage() {
useEffect(() => { useEffect(() => {
getListInfo(); getListInfo();
// initWechatConfig();
}, [storeId]); }, [storeId]);
async function initWechatConfig() {
WechatApi.initConfig({ isAgentConfig: true, url: window.location.href.split('#')[0] })
}
async function getListInfo() { async function getListInfo() {
await getStoreRole(); await getStoreRole();
...@@ -159,10 +157,11 @@ function EmployeeManage() { ...@@ -159,10 +157,11 @@ function EmployeeManage() {
/> />
)} )}
<span className="title">{val}</span> {/* <span className="title">{val}</span> */}
{/* <span className="title"> <span className="title">
<WWOpenDataCom type="userName" openid={val}/>
</span> */} <WWOpenDataCom type="userName" openid={val} />
</span>
</div> </div>
); );
}, },
...@@ -198,7 +197,7 @@ function EmployeeManage() { ...@@ -198,7 +197,7 @@ function EmployeeManage() {
<span className="divider-line">{" | "}</span> <span className="divider-line">{" | "}</span>
<span <span
className="delete" className="delete"
onClick={() =>{ onClick={() => {
handleDeleteWorkWechatEmployeeConfirm(record) handleDeleteWorkWechatEmployeeConfirm(record)
}} }}
> >
...@@ -247,7 +246,7 @@ function EmployeeManage() { ...@@ -247,7 +246,7 @@ function EmployeeManage() {
role: [], role: [],
avatar: "", avatar: "",
storeUserId: "", storeUserId: "",
weChatAccount:"" weChatAccount: ""
}); });
}} }}
isWorkWechat={isWorkWechat} isWorkWechat={isWorkWechat}
...@@ -278,7 +277,7 @@ function EmployeeManage() { ...@@ -278,7 +277,7 @@ function EmployeeManage() {
function handleDeleteEmployee(storeUserId: string) { function handleDeleteEmployee(storeUserId: string) {
StoreService.deleteEmployee({ storeUserId }).then((res: any) => { StoreService.deleteEmployee({ storeUserId }).then((res: any) => {
const msg = isWorkWechat ? "员工已删除":"讲师已删除"; const msg = isWorkWechat ? "员工已删除" : "讲师已删除";
message.success(msg); message.success(msg);
getEmployeeList(); getEmployeeList();
}); });
...@@ -385,7 +384,7 @@ function EmployeeManage() { ...@@ -385,7 +384,7 @@ function EmployeeManage() {
</Button> </Button>
} }
</div> </div>
<LimitTip type="员工" total={realTotal} tip={()=>{return (<div>数据为当前学院的员工数,若员工存在多个学院,企业人数只统计为1人</div>)}}/> <LimitTip type="员工" total={realTotal} tip={() => { return (<div>数据为当前学院的员工数,若员工存在多个学院,企业人数只统计为1人</div>) }} />
<div className="box-body"> <div className="box-body">
<XMTable <XMTable
renderEmpty={{ renderEmpty={{
......
...@@ -149,7 +149,7 @@ class AddLiveBasic extends React.Component { ...@@ -149,7 +149,7 @@ class AddLiveBasic extends React.Component {
<span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}> <span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}>
使用默认图 使用默认图
</span> </span>
<div className='tips'>建议尺寸1280*720px,图片支持jpg、jpeg、png格式</div> <div className='tips'>建议尺寸1280*720px或16:9。封面图最大5M,支持jpg、jpeg和png</div>
</div> </div>
<div className='img-content'> <div className='img-content'>
{isDefaultCover && <span className='tag'>默认图</span>} {isDefaultCover && <span className='tag'>默认图</span>}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-07-23 14:54:16 * @Date: 2020-07-23 14:54:16
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-14 11:43:49 * @LastEditTime: 2021-07-14 18:19:22
* @Description: 大班直播课预览弹窗 * @Description: 大班直播课预览弹窗
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -166,12 +166,7 @@ class PreviewCourseModal extends React.Component { ...@@ -166,12 +166,7 @@ class PreviewCourseModal extends React.Component {
<div className='container__header'> <div className='container__header'>
<Choose> <Choose>
<When condition={type === 'videoCourse'}> <When condition={type === 'videoCourse'}>
<video <img src={coverUrl ? coverUrl : `https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png`} className='course-cover' alt='' />
controls
src={courseChapterList.length && courseChapterList[0].mediaUrl || scheduleVideoUrl }
poster={coverUrl ? coverUrl : `https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png`}
className='course-url'
/>
</When> </When>
<Otherwise> <Otherwise>
<img src={coverUrl} className='course-cover' alt='' /> <img src={coverUrl} className='course-cover' alt='' />
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-07-14 11:44:14 * @LastEditTime: 2021-07-15 12:08:28
* @Description: 线下课新增/编辑页 * @Description: 线下课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -751,7 +751,7 @@ class AddOfflineCourse extends React.Component { ...@@ -751,7 +751,7 @@ class AddOfflineCourse extends React.Component {
<span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}> <span className={`default-btn ${isDefaultCover ? 'disabled' : ''}`} onClick={this.handleResetCoverUrl}>
使用默认图 使用默认图
</span> </span>
<div className='tips'>建议尺寸1280*720px,图片支持jpg、jpeg、png格式</div> <div className='tips'>建议尺寸1280*720px或16:9。封面图最大5M,支持jpg、jpeg和png</div>
</div> </div>
<div className='img-content'> <div className='img-content'>
{isDefaultCover && <span className='tag'>默认图</span>} {isDefaultCover && <span className='tag'>默认图</span>}
...@@ -853,7 +853,6 @@ class AddOfflineCourse extends React.Component { ...@@ -853,7 +853,6 @@ class AddOfflineCourse extends React.Component {
})} })}
</Select> </Select>
</div> </div>
<div className='introduce'> <div className='introduce'>
<span className='label'>课程简介:</span> <span className='label'>课程简介:</span>
<div className='content'> <div className='content'>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-14 16:41:36 * @LastEditTime: 2021-07-15 12:04:40
* @Description: 线上课新增/编辑页 * @Description: 线上课新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -821,7 +821,7 @@ class AddVideoCourse extends React.Component { ...@@ -821,7 +821,7 @@ class AddVideoCourse extends React.Component {
</If> </If>
<div className='cover-url flex mt16'> <div className='cover-url flex mt16'>
<div className='label'>课程封面</div> <div className='label'>封面图</div>
<div className='cover-url__wrap'> <div className='cover-url__wrap'>
<div className='opt-btns'> <div className='opt-btns'>
<div> <div>
......
...@@ -171,7 +171,7 @@ function VideoCourseDetail(){ ...@@ -171,7 +171,7 @@ function VideoCourseDetail(){
</div> </div>
<div className="course-detail__info"> <div className="course-detail__info">
<div className="info__title">{courseName}</div> <div className="info__title">{courseName}</div>
<div className="info__category">{`分类:${categoryName}`}</div> <div className="info__category">{`课程分类:${categoryName}`}</div>
<div className="info__chapterNum">{`课节数量:${courseChapterList.length}`}</div> <div className="info__chapterNum">{`课节数量:${courseChapterList.length}`}</div>
</div> </div>
</div> </div>
......
...@@ -126,8 +126,8 @@ class VideoCourseList extends React.Component { ...@@ -126,8 +126,8 @@ class VideoCourseList extends React.Component {
width: 100, width: 100,
align: 'right', align: 'right',
render: (val, item) => { render: (val, item) => {
return <div onClick={() => this.handleLinkToCourseDetail(item.id)}>{val || 1}</div>; return <div onClick={() => this.handleLinkToCourseDetail(item.id)}>{val || 1}</div>
}, }
}, },
{ {
title: ( title: (
...@@ -364,8 +364,8 @@ class VideoCourseList extends React.Component { ...@@ -364,8 +364,8 @@ class VideoCourseList extends React.Component {
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (record, needStr = false) => { handleShowShareModal = (record, needStr = false) => {
const { type } = this.props; const { type } = this.props;
const { id, scheduleVideoUrl } = record; const { id, scheduleVideoUrl, chapterNum } = record;
const htmlUrl = `${LIVE_SHARE}video_detail/${id}?id=${User.getStoreId()}`; const htmlUrl = chapterNum > 1 ? `${LIVE_SHARE}course_detail/${id}?id=${User.getStoreId()}` : `${LIVE_SHARE}video_detail/${id}?id=${User.getStoreId()}`;
const longUrl = htmlUrl; const longUrl = htmlUrl;
const { coverUrl, courseName } = record; const { coverUrl, courseName } = record;
const shareData = { const shareData = {
......
...@@ -15,7 +15,7 @@ import zhCN from 'antd/es/locale/zh_CN' ...@@ -15,7 +15,7 @@ import zhCN from 'antd/es/locale/zh_CN'
import User from '@/common/js/user'; import User from '@/common/js/user';
import BaseService from "@/domains/basic-domain/baseService"; import BaseService from "@/domains/basic-domain/baseService";
import moment from 'moment'; import moment from 'moment';
import WechatApi from "@/core/wechatApi" import WechatApi from '@/common/js/wechatApi';
import { VersionContext, VersionInfo, XMContext } from '@/store/context'; import { VersionContext, VersionInfo, XMContext } from '@/store/context';
import { setStoreGroupPermission, setStorePermission, setStoreGroupList, setStoreList } from '@/store/actions/index'; import { setStoreGroupPermission, setStorePermission, setStoreGroupList, setStoreList } from '@/store/actions/index';
import Service from "@/common/js/service"; import Service from "@/common/js/service";
...@@ -29,7 +29,7 @@ declare var window: any; ...@@ -29,7 +29,7 @@ declare var window: any;
const App: React.FC = (props: any) => { const App: React.FC = (props: any) => {
const [storeUserId, setStoreUserId] = useState('') const [storeUserId, setStoreUserId] = useState('')
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [versionInfo, setVersionInfo] = useState<VersionInfo|null>(null) const [versionInfo, setVersionInfo] = useState<VersionInfo | null>(null)
const userId = User.getUserId(); const userId = User.getUserId();
const [menuType, setMenuType] = useState(true); const [menuType, setMenuType] = useState(true);
const enterpriseId = User.getEnterpriseId(); const enterpriseId = User.getEnterpriseId();
...@@ -37,7 +37,7 @@ const App: React.FC = (props: any) => { ...@@ -37,7 +37,7 @@ const App: React.FC = (props: any) => {
useEffect(() => { useEffect(() => {
WechatApi.initShareConfig(); initWechatConfig();
getStoreAndUserInfo(); getStoreAndUserInfo();
getVersion(); getVersion();
if (window.location.hash === "#/") { if (window.location.hash === "#/") {
...@@ -47,6 +47,10 @@ const App: React.FC = (props: any) => { ...@@ -47,6 +47,10 @@ const App: React.FC = (props: any) => {
} }
}, []) }, [])
async function initWechatConfig() {
WechatApi.initConfig({ isAgentConfig: true, url: window.location.href.split('#')[0] })
}
useEffect(() => { useEffect(() => {
getStorePermission(); getStorePermission();
}, [window.location.hash]) }, [window.location.hash])
...@@ -68,7 +72,7 @@ const App: React.FC = (props: any) => { ...@@ -68,7 +72,7 @@ const App: React.FC = (props: any) => {
let version = res.result; let version = res.result;
User.setVersion(version); User.setVersion(version);
User.setExpirationTime(res.result.validEndTime) User.setExpirationTime(res.result.validEndTime)
let versioninfo:VersionInfo = { let versioninfo: VersionInfo = {
dayTime: version.dayTime, dayTime: version.dayTime,
stateEnum: version.stateEnum, stateEnum: version.stateEnum,
userNum: version.userNum === -1 ? '不限人数' : version.userNum, userNum: version.userNum === -1 ? '不限人数' : version.userNum,
...@@ -89,28 +93,28 @@ const App: React.FC = (props: any) => { ...@@ -89,28 +93,28 @@ const App: React.FC = (props: any) => {
} }
function getStoreInfo() { function getStoreInfo() {
console.log("currentStoreUserInfo",window.currentStoreUserInfo); console.log("currentStoreUserInfo", window.currentStoreUserInfo);
const params = { const params = {
storeId: User.getStoreId(), storeId: User.getStoreId(),
userId: User.getUserId(), userId: User.getUserId(),
}; };
Service.Hades('public/customerHades/getStoreAndUserMsg', params).then((res) => { Service.Hades('public/customerHades/getStoreAndUserMsg', params).then((res) => {
if(res.success){ if (res.success) {
const { id, storeUserId, storeName, userRole, storeType } = res.result; const { id, storeUserId, storeName, userRole, storeType } = res.result;
User.setStoreId(id); User.setStoreId(id);
User.setStoreUserId(storeUserId); User.setStoreUserId(storeUserId);
User.setStoreName(storeName); User.setStoreName(storeName);
Bus.trigger('storeNameChange',storeName); Bus.trigger('storeNameChange', storeName);
User.setUserRole(userRole); User.setUserRole(userRole);
User.setStoreType(storeType); User.setStoreType(storeType);
setCurrentStoreUserInfo(id,storeUserId) setCurrentStoreUserInfo(id, storeUserId)
setStoreUserId(storeUserId); setStoreUserId(storeUserId);
getUserPermission(); getUserPermission();
} }
}) })
} }
function setCurrentStoreUserInfo(storeId:any,storeUserId:any){ function setCurrentStoreUserInfo(storeId: any, storeUserId: any) {
window.currentStoreUserInfo.storeId = storeId; window.currentStoreUserInfo.storeId = storeId;
window.currentStoreUserInfo.storeUserId = storeUserId; window.currentStoreUserInfo.storeUserId = storeUserId;
window.currentStoreUserInfo.userId = User.getUserId(); window.currentStoreUserInfo.userId = User.getUserId();
...@@ -136,7 +140,7 @@ const App: React.FC = (props: any) => { ...@@ -136,7 +140,7 @@ const App: React.FC = (props: any) => {
Bus.trigger('storeNameChange', storeName); Bus.trigger('storeNameChange', storeName);
User.setUserRole(userRole); User.setUserRole(userRole);
User.setStoreType(storeType); User.setStoreType(storeType);
setCurrentStoreUserInfo(id,storeUserId); setCurrentStoreUserInfo(id, storeUserId);
ctx.dispatch(setStoreGroupList(storeGroupVOS)) ctx.dispatch(setStoreGroupList(storeGroupVOS))
ctx.dispatch(setStoreList(storeVOS)); ctx.dispatch(setStoreList(storeVOS));
setStoreUserId(storeUserId) setStoreUserId(storeUserId)
......
import React, { useState, useRef, useEffect, useContext } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import Breadcrumbs from '@/components/Breadcrumbs'; import Breadcrumbs from '@/components/Breadcrumbs';
import { Form, Alert, Input, Button, InputNumber, DatePicker, Switch, Radio, message, Modal, Tooltip } from 'antd'; import { Form, Input, Button, InputNumber, DatePicker, Switch, Radio, message, Modal, Tooltip } from 'antd';
import { Route, withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import User from '@/common/js/user'; import User from '@/common/js/user';
import moment from 'moment'; import moment from 'moment';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
......
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