Skip to content

Commit e0695d4

Browse files
committed
change config
1 parent a7b09a2 commit e0695d4

File tree

8 files changed

+37
-39
lines changed

8 files changed

+37
-39
lines changed

build/dev-server.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
require('./check-versions')(); // 检查 Node 和 npm 版本
22
var config = require('../config');
33
if (!process.env.NODE_ENV) {
4-
process.env.NODE_ENV = config.dev.env;
5-
// process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
4+
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
65
}
76

87
var opn = require('opn')

build/webpack.base.conf.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ var vueLoaderConfig = require('./vue-loader.conf');
66
function resolve(dir) {
77
return path.join(__dirname, '..', dir)
88
}
9-
109
var src = path.resolve(__dirname, '../src');
11-
var env = process.env.NODE_ENV
12-
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
13-
// various preprocessor loaders added to vue-loader at the end of this file
14-
var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap)
15-
var cssSourceMapProd = (env === 'production||sit' && config.build.productionSourceMap)
16-
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd
1710

1811
module.exports = {
1912
entry: {
@@ -22,7 +15,7 @@ module.exports = {
2215
output: {
2316
path: config.build.assetsRoot,
2417
filename: '[name].js',
25-
publicPath: process.env.NODE_ENV === 'production||sit' ? config.build.assetsPublicPath : config.dev.assetsPublicPath
18+
publicPath: process.env.NODE_ENV !== 'development' ? config.build.assetsPublicPath: config.dev.assetsPublicPath
2619
},
2720
resolve: {
2821
extensions: ['.js', '.vue', '.json'],

config/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module.exports = {
88
index: path.resolve(__dirname, '../dist/index.html'),
99
assetsRoot: path.resolve(__dirname, '../dist'),
1010
assetsSubDirectory: '',
11-
assetsPublicPath: '/',
12-
staticPath:'',
11+
assetsPublicPath: './',
12+
staticPath:'./',
1313
productionSourceMap: true,
1414
// Gzip off by default as many popular static hosts such as
1515
// Surge or Netlify already gzip all static assets for you.
@@ -28,8 +28,8 @@ module.exports = {
2828
port: 9527,
2929
autoOpenBrowser: true,
3030
assetsSubDirectory: 'static',
31-
staticPath:'/static',
3231
assetsPublicPath: '/',
32+
staticPath:'/static/',
3333
proxyTable: {},
3434
// CSS Sourcemaps off by default because relative paths are "buggy"
3535
// with this option, according to the CSS-Loader README

config/prod.env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
NODE_ENV: '"production"',
3-
BASE_API: '"https://api-prod',
3+
BASE_API: '"https://api-prod"',
44
APP_ORIGIN: '"https://wallstreetcn.com"'
55
};

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<title>Juicy</title>
99
</head>
1010
<body>
11-
<script src=<%= htmlWebpackPlugin.options.path %>/jquery.min.js></script>
12-
<script src=<%= htmlWebpackPlugin.options.path %>/tinymce1.3/tinymce.min.js></script>
11+
<script src=<%= htmlWebpackPlugin.options.path %>jquery.min.js></script>
12+
<script src=<%= htmlWebpackPlugin.options.path %>tinymce1.3/tinymce.min.js></script>
1313
<div id="app"></div>
1414
<!-- built files will be auto injected -->
1515
</body>

src/router/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const Form2 = resolve => require(['../views/example/form2'], resolve);
6767
Vue.use(Router);
6868

6969
export default new Router({
70-
mode: 'history',
70+
// mode: 'history', //后端支持可开
7171
scrollBehavior: () => ({ y: 0 }),
7272
routes: [
7373
{ path: '/login', component: Login, hidden: true },

src/views/components/mixin.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22
<div class="components-container">
33
<div class='component-item'>
44
<MDinput name="name" v-model="title" required :maxlength="100">
5-
标题
5+
标题
66
</MDinput>
77
<code class='code-part'>Material Design 的input</code>
88
</div>
99

1010
<div class='component-item'>
11-
<PanThumb image='https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'>
11+
<PanThumb image='https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'>
1212
上海花裤衩
13-
</PanThumb>
14-
<code class='code-part'>图片hover效果</code>
13+
</PanThumb>
14+
<code class='code-part'>图片hover效果</code>
1515
</div>
16+
17+
<div class='component-item'>
18+
<el-button v-waves type="primary">水波纹效果</el-button>
19+
<code class='code-part'>水波纹 v-directive</code>
20+
</div>
21+
1622
</div>
1723
</template>
1824
<script>

src/views/login/index.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,29 @@
9797
});
9898
},
9999
afterQRScan() {
100-
const hash = window.location.hash.slice(1);
101-
const hashObj = getQueryObject(hash);
102-
const originUrl = window.location.origin;
103-
history.replaceState({}, '', originUrl);
104-
const codeMap = {
105-
wechat: 'code',
106-
tencent: 'code'
107-
};
108-
const codeName = hashObj[codeMap[this.auth_type]];
109-
if (!codeName) {
110-
alert('第三方登录失败');
111-
} else {
112-
this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
113-
this.$router.push({ path: '/' });
114-
});
115-
}
100+
// const hash = window.location.hash.slice(1);
101+
// const hashObj = getQueryObject(hash);
102+
// const originUrl = window.location.origin;
103+
// history.replaceState({}, '', originUrl);
104+
// const codeMap = {
105+
// wechat: 'code',
106+
// tencent: 'code'
107+
// };
108+
// const codeName = hashObj[codeMap[this.auth_type]];
109+
// if (!codeName) {
110+
// alert('第三方登录失败');
111+
// } else {
112+
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
113+
// this.$router.push({ path: '/' });
114+
// });
115+
// }
116116
}
117117
},
118118
created() {
119-
window.addEventListener('hashchange', this.afterQRScan);
119+
// window.addEventListener('hashchange', this.afterQRScan);
120120
},
121121
destroyed() {
122-
window.removeEventListener('hashchange', this.afterQRScan);
122+
// window.removeEventListener('hashchange', this.afterQRScan);
123123
}
124124
}
125125
</script>

0 commit comments

Comments
 (0)