Commit 30504996 by zhanghaozhe

修改文件结构

parent fd7e388a
...@@ -276,8 +276,7 @@ module.exports = function(webpackEnv) { ...@@ -276,8 +276,7 @@ module.exports = function(webpackEnv) {
'react-native': 'react-native-web', 'react-native': 'react-native-web',
'@': path.resolve(__dirname, '../src'), '@': path.resolve(__dirname, '../src'),
'@common': path.resolve(__dirname, '../src/common'), '@common': path.resolve(__dirname, '../src/common'),
'@components': path.resolve(__dirname, '../src/components'), '@components': path.resolve(__dirname, '../src/components')
'@base': path.resolve(__dirname, '../src/base')
}, },
plugins: [ plugins: [
// Adds support for installing with Plug'n'Play, leading to faster installs and adding // Adds support for installing with Plug'n'Play, leading to faster installs and adding
......
...@@ -4977,6 +4977,11 @@ ...@@ -4977,6 +4977,11 @@
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
"integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==" "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q=="
}, },
"eventlistener": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/eventlistener/-/eventlistener-0.0.1.tgz",
"integrity": "sha1-7Suqu4UiJ68rz4iRUscsY8pTLrg="
},
"events": { "events": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz",
...@@ -8635,6 +8640,11 @@ ...@@ -8635,6 +8640,11 @@
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
}, },
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
},
"lodash.isarguments": { "lodash.isarguments": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz",
...@@ -8692,6 +8702,11 @@ ...@@ -8692,6 +8702,11 @@
"lodash._reinterpolate": "~3.0.0" "lodash._reinterpolate": "~3.0.0"
} }
}, },
"lodash.throttle": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
"integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ="
},
"lodash.uniq": { "lodash.uniq": {
"version": "4.5.0", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
...@@ -11337,6 +11352,17 @@ ...@@ -11337,6 +11352,17 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz",
"integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA=="
}, },
"react-lazy-load": {
"version": "3.0.13",
"resolved": "https://registry.npmjs.org/react-lazy-load/-/react-lazy-load-3.0.13.tgz",
"integrity": "sha1-OwqS0zbUPT8Nc8vm81sXBQsIuCQ=",
"requires": {
"eventlistener": "0.0.1",
"lodash.debounce": "^4.0.0",
"lodash.throttle": "^4.0.0",
"prop-types": "^15.5.8"
}
},
"react-lifecycles-compat": { "react-lifecycles-compat": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
......
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { LocaleProvider } from 'antd-mobile'
import { BrowserRouter as Router } from 'react-router-dom'
import Routes from './router'
class App extends Component {
render() {
return (
<LocaleProvider>
<Router>
<Routes></Routes>
</Router>
</LocaleProvider>
);
}
}
export default connect()(App);
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux' import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import thunk from 'redux-thunk' import thunk from 'redux-thunk'
import { logger } from 'redux-logger' import { logger } from 'redux-logger'
// import Router from './router'; import Routes from './router';
import rootReducers from './store' import rootReducers from './store'
import App from './App';
// 默认样式 // 默认样式
import './assets/css/index.scss'; import './assets/css/index.scss';
...@@ -15,12 +14,14 @@ import './assets/css/index.scss'; ...@@ -15,12 +14,14 @@ import './assets/css/index.scss';
import './assets/font/iconfont.css'; import './assets/font/iconfont.css';
var store = createStore(rootReducers, compose( const store = createStore(
applyMiddleware(thunk,logger) rootReducers,
)) applyMiddleware(thunk, logger)
)
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<App /> <Routes/>
</Provider>, </Provider>,
document.getElementById('root')); document.getElementById('root'));
\ No newline at end of file \ No newline at end of file
// import { BASE_URL as target } from './utils/api'
const proxy = require('http-proxy-middleware') const proxy = require('http-proxy-middleware')
const target = 'http://fast-test.julyedu.com' const target = 'http://fast-test.julyedu.com'
......
export { default as api } from './api' export { default as api } from './api'
//数组去重
export const unique = (array) => {
var n = []; //一个新的临时数组
//遍历当前数组
for (var i = 0; i < array.length; i++) {
//如果当前数组的第i已经保存进了临时数组,那么跳过,
//否则把当前项push到临时数组里面
if (n.indexOf(array[i]) === -1) n.push(array[i]);
}
return n;
}
export const formatTime = (date) => {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
return [year, month, day].join('-')
}
// 计算时间相差fn(过去距离当前时间) // 计算时间相差fn(过去距离当前时间)
export const computingTime = (pastTime) => { export const computingTime = (pastTime) => {
...@@ -63,11 +43,6 @@ export const timeDown = (endDate) => { ...@@ -63,11 +43,6 @@ export const timeDown = (endDate) => {
return leftTime; return leftTime;
} }
// 去除字符串首尾空格
export const strTrim = (s) => {
return s.replace(/(^\s*)|(\s*$)/g, "");
}
export const isPhone = ($poneInput) => { export const isPhone = ($poneInput) => {
var myreg = /^[1][3,4,5,7,8][0-9]{9}$/; var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!myreg.test($poneInput)) { if (!myreg.test($poneInput)) {
......
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