| | |
| | | ] |
| | | ] |
| | | }, |
| | | "homepage": "./build", |
| | | "homepage": ".", |
| | | "devDependencies": { |
| | | "typescript": "^4.0.2" |
| | | } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8" /> |
| | | <title></title> |
| | | </head> |
| | | <body> |
| | | <script> |
| | | if ('ActiveXObject' in window) { |
| | | window.onload = function() { |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">您的浏览器<span style="color: #ff4d4f">不受支持</span></div>' |
| | | } |
| | | } else { |
| | | fetch(`./options.json`) |
| | | .then(function(response) {return response.json()}) |
| | | .catch(function() { |
| | | document.body.innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>' |
| | | }) |
| | | .then(function(config) { |
| | | if (!config) { |
| | | document.body.innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>' |
| | | } else { |
| | | var url = window.location.href.split(/(index.html)+/ig)[0] |
| | | var appPort = 'admin/index.html' |
| | | if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { |
| | | appPort = 'mob/index.html' |
| | | } else { |
| | | if (config.defaultApp) { |
| | | appPort = 'pc/' |
| | | } |
| | | } |
| | | window.location.replace(url + appPort) |
| | | } |
| | | }) |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | | "filter": "false" |
| | | "filter": "false", |
| | | "defaultApp": "", |
| | | "defaultLang": "zh-CN" |
| | | } |
| | |
| | | if (options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | } |
| | | } else if (!isCloud && window.GLOB.mainSystemApi) { |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | param.linkurl = window.GLOB.linkurl |
| | | } |
| | | param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | } |
| | | |
| | |
| | | if (options.cloudServiceApi) { |
| | | param.rduri = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | } |
| | | } else if (!isCloud && window.GLOB.mainSystemApi) { |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | param.linkurl = window.GLOB.linkurl |
| | | } |
| | | param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | } |
| | | |
| | |
| | | // 获取主菜单参数 |
| | | let menudefer = new Promise(resolve => { |
| | | let _param = {func: 's_get_pc_menus', systemType: options.sysType} |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | _param.linkurl = window.GLOB.linkurl |
| | | } |
| | | _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : '' |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | |
| | | ) |
| | | } |
| | | |
| | | |
| | | if (sessionStorage.getItem('loginError')) { |
| | | try { |
| | | let res = JSON.parse(sessionStorage.getItem('loginError')) |
| | |
| | | sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '') |
| | | sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '') |
| | | |
| | | fetch(`./options.json`) |
| | | // 测试系统文件置于admin中 |
| | | |
| | | fetch(process.env.NODE_ENV === 'production' && options.sysType === 'local' ? '../options.json' : './options.json') |
| | | .then(response => response.json()) |
| | | .catch(() => { |
| | | console.warn('系统配置信息获取失败,请联系管理员!') |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>' |
| | | }) |
| | | .then(config => { |
| | | if (!config) return |
| | |
| | | } |
| | | |
| | | if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限 |
| | | let _service = window.location.href.replace(/\/index.html(.*)|\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') |
| | | let _service = window.location.href.replace(/(\/admin)?\/index.html(.*)|(\/admin)?\/#(.*)/ig, '').replace(new RegExp(document.location.origin + '/?', 'ig'), '') |
| | | GLOB.linkurl = _href |
| | | if (!/index.html/ig.test(GLOB.linkurl)) { |
| | | GLOB.linkurl = GLOB.linkurl + 'index.html' |
| | |
| | | } |
| | | }, |
| | | { |
| | | title: '标题', dataIndex: 'title', key: 'title', align: 'center', width: '150px' |
| | | }, |
| | | { |
| | | title: '图标', dataIndex: 'favicon', key: 'favicon', align: 'center', width: '150px', |
| | | render: (text, record) => (text ? <img style={{width: '32px', height: '32px'}} src={text} alt="" /> : null) |
| | | }, |
| | | { |
| | | title: 'Action', |
| | | key: 'action', |
| | | align: 'center', |
| | | width: '120px', |
| | | render: (text, record) => ( |
| | | <div> |
| | | <Button type="link" onClick={() => this.deleteSubApp(record)} style={{color: '#ff4d4f'}}>删除</Button> |
| | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | if (visible === 'edit') { |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css}'`) |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | |
| | | </Modal> |
| | | <Modal |
| | | title={'编辑子应用'} |
| | | width={'600px'} |
| | | width={'750px'} |
| | | maskClosable={false} |
| | | visible={!!subVisible} |
| | | onCancel={() => this.setState({subVisible: false})} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Radio } from 'antd' |
| | | import { Form, Row, Col, Select, Radio, Input } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | const FileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | |
| | | return new Promise(resolve => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | if (values.favicon && values.favicon.length > 0 && values.favicon[0].status === 'done') { |
| | | values.favicon = values.favicon[0].response || values.favicon[0].url || '' |
| | | } else { |
| | | values.favicon = '' |
| | | } |
| | | resolve(values) |
| | | } |
| | | }) |
| | |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 12 } |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | let filelist = [] |
| | | |
| | | if (type === 'edit' && card && card.favicon) { |
| | | filelist = [{ |
| | | uid: `favicon`, |
| | | name: card.favicon.slice(card.favicon.lastIndexOf('/') + 1), |
| | | status: 'done', |
| | | url: card.favicon, |
| | | origin: true |
| | | }] |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="mob-card-edit-form"> |
| | | <Row gutter={24}> |
| | | <Col span={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="应用类型"> |
| | | {getFieldDecorator('typename', { |
| | | initialValue: card ? card.typename : 'mob' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="语言"> |
| | | {getFieldDecorator('lang', { |
| | | initialValue: card ? card.lang || 'zh-CN' : 'zh-CN' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="登录"> |
| | | {getFieldDecorator('login_types', { |
| | | initialValue: card ? card.login_types || 'true' : 'true' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="权限管理"> |
| | | {getFieldDecorator('role_type', { |
| | | initialValue: card ? card.role_type || 'true' : 'true' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="短连接"> |
| | | {getFieldDecorator('link_type', { |
| | | initialValue: card ? card.link_type || 'true' : 'true' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="皮肤"> |
| | | {getFieldDecorator('css', { |
| | | initialValue: card ? card.css : 'bg_black_style_blue' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="标题"> |
| | | {getFieldDecorator('title', { |
| | | initialValue: card ? card.title || '' : '' |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="图标"> |
| | | {getFieldDecorator('favicon', { |
| | | initialValue: filelist |
| | | })(<FileUpload accept=".jpg,.png,.gif,.pjp,.pjpeg,.jpeg,.jfif,.webp,.ico" maxFile={1} fileType={'text'} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | async loadmenu () { |
| | | // 获取主菜单 |
| | | let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'} |
| | | |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | _param.linkurl = window.GLOB.linkurl |
| | | } |
| | | _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : '' |
| | | |
| | | let result = await Api.getSystemConfig(_param) |
| | |
| | | reload = () => { |
| | | const { mainMenu } = this.props |
| | | let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'} |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | _param.linkurl = window.GLOB.linkurl |
| | | } |
| | | _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : '' |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | |
| | | UNSAFE_componentWillMount () { |
| | | const { MenuId, config } = this.props |
| | | let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'} |
| | | if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') { |
| | | _param.linkurl = window.GLOB.linkurl |
| | | } |
| | | _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : '' |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | |
| | | MenuNo: _config.MenuNo || '', |
| | | EasyCode: _config.easyCode || '', |
| | | Template: 'webPage', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: 'pc', |
| | | MenuName: _config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'webPage'}), |
| | | LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_config))), |