Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
e0695d42
Commit
e0695d42
authored
Apr 23, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change config
parent
a7b09a2a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
39 deletions
+37
-39
dev-server.js
build/dev-server.js
+1
-2
webpack.base.conf.js
build/webpack.base.conf.js
+1
-8
index.js
config/index.js
+3
-3
prod.env.js
config/prod.env.js
+1
-1
index.html
index.html
+2
-2
index.js
src/router/index.js
+1
-1
mixin.vue
src/views/components/mixin.vue
+10
-4
index.vue
src/views/login/index.vue
+18
-18
No files found.
build/dev-server.js
View file @
e0695d42
require
(
'./check-versions'
)();
// 检查 Node 和 npm 版本
var
config
=
require
(
'../config'
);
if
(
!
process
.
env
.
NODE_ENV
)
{
process
.
env
.
NODE_ENV
=
config
.
dev
.
env
;
// process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
process
.
env
.
NODE_ENV
=
JSON
.
parse
(
config
.
dev
.
env
.
NODE_ENV
)
}
var
opn
=
require
(
'opn'
)
...
...
build/webpack.base.conf.js
View file @
e0695d42
...
...
@@ -6,14 +6,7 @@ var vueLoaderConfig = require('./vue-loader.conf');
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
'..'
,
dir
)
}
var
src
=
path
.
resolve
(
__dirname
,
'../src'
);
var
env
=
process
.
env
.
NODE_ENV
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
// various preprocessor loaders added to vue-loader at the end of this file
var
cssSourceMapDev
=
(
env
===
'development'
&&
config
.
dev
.
cssSourceMap
)
var
cssSourceMapProd
=
(
env
===
'production||sit'
&&
config
.
build
.
productionSourceMap
)
var
useCssSourceMap
=
cssSourceMapDev
||
cssSourceMapProd
module
.
exports
=
{
entry
:
{
...
...
@@ -22,7 +15,7 @@ module.exports = {
output
:
{
path
:
config
.
build
.
assetsRoot
,
filename
:
'[name].js'
,
publicPath
:
process
.
env
.
NODE_ENV
===
'production||sit'
?
config
.
build
.
assetsPublicPath
:
config
.
dev
.
assetsPublicPath
publicPath
:
process
.
env
.
NODE_ENV
!==
'development'
?
config
.
build
.
assetsPublicPath
:
config
.
dev
.
assetsPublicPath
},
resolve
:
{
extensions
:
[
'.js'
,
'.vue'
,
'.json'
],
...
...
config/index.js
View file @
e0695d42
...
...
@@ -8,8 +8,8 @@ module.exports = {
index
:
path
.
resolve
(
__dirname
,
'../dist/index.html'
),
assetsRoot
:
path
.
resolve
(
__dirname
,
'../dist'
),
assetsSubDirectory
:
''
,
assetsPublicPath
:
'/'
,
staticPath
:
''
,
assetsPublicPath
:
'
.
/'
,
staticPath
:
'
./
'
,
productionSourceMap
:
true
,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
...
...
@@ -28,8 +28,8 @@ module.exports = {
port
:
9527
,
autoOpenBrowser
:
true
,
assetsSubDirectory
:
'static'
,
staticPath
:
'/static'
,
assetsPublicPath
:
'/'
,
staticPath
:
'/static/'
,
proxyTable
:
{},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
...
...
config/prod.env.js
View file @
e0695d42
module
.
exports
=
{
NODE_ENV
:
'"production"'
,
BASE_API
:
'"https://api-prod'
,
BASE_API
:
'"https://api-prod
"
'
,
APP_ORIGIN
:
'"https://wallstreetcn.com"'
};
index.html
View file @
e0695d42
...
...
@@ -8,8 +8,8 @@
<title>
Juicy
</title>
</head>
<body>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
/
jquery
.
min
.
js
>
</script>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
/
tinymce1
.
3
/
tinymce
.
min
.
js
>
</script>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
jquery
.
min
.
js
>
</script>
<script
src=
<%=
htmlWebpackPlugin
.
options
.
path
%
>
tinymce1
.
3
/
tinymce
.
min
.
js
>
</script>
<div
id=
"app"
></div>
<!-- built files will be auto injected -->
</body>
...
...
src/router/index.js
View file @
e0695d42
...
...
@@ -67,7 +67,7 @@ const Form2 = resolve => require(['../views/example/form2'], resolve);
Vue
.
use
(
Router
);
export
default
new
Router
({
mode
:
'history'
,
// mode: 'history', //后端支持可开
scrollBehavior
:
()
=>
({
y
:
0
}),
routes
:
[
{
path
:
'/login'
,
component
:
Login
,
hidden
:
true
},
...
...
src/views/components/mixin.vue
View file @
e0695d42
...
...
@@ -2,17 +2,23 @@
<div
class=
"components-container"
>
<div
class=
'component-item'
>
<MDinput
name=
"name"
v-model=
"title"
required
:maxlength=
"100"
>
标题
标题
</MDinput>
<code
class=
'code-part'
>
Material Design 的input
</code>
</div>
<div
class=
'component-item'
>
<PanThumb
image=
'https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'
>
<PanThumb
image=
'https://wpimg.wallstcn.com/577965b9-bb9e-4e02-9f0c-095b41417191'
>
上海花裤衩
</PanThumb>
<code
class=
'code-part'
>
图片hover效果
</code>
</PanThumb>
<code
class=
'code-part'
>
图片hover效果
</code>
</div>
<div
class=
'component-item'
>
<el-button
v-waves
type=
"primary"
>
水波纹效果
</el-button>
<code
class=
'code-part'
>
水波纹 v-directive
</code>
</div>
</div>
</
template
>
<
script
>
...
...
src/views/login/index.vue
View file @
e0695d42
...
...
@@ -97,29 +97,29 @@
});
},
afterQRScan
()
{
const
hash
=
window
.
location
.
hash
.
slice
(
1
);
const
hashObj
=
getQueryObject
(
hash
);
const
originUrl
=
window
.
location
.
origin
;
history
.
replaceState
({},
''
,
originUrl
);
const
codeMap
=
{
wechat
:
'code'
,
tencent
:
'code'
};
const
codeName
=
hashObj
[
codeMap
[
this
.
auth_type
]];
if
(
!
codeName
)
{
alert
(
'第三方登录失败'
);
}
else
{
this
.
$store
.
dispatch
(
'LoginByThirdparty'
,
codeName
).
then
(()
=>
{
this
.
$router
.
push
({
path
:
'/'
});
});
}
//
const hash = window.location.hash.slice(1);
//
const hashObj = getQueryObject(hash);
//
const originUrl = window.location.origin;
//
history.replaceState({}, '', originUrl);
//
const codeMap = {
//
wechat: 'code',
//
tencent: 'code'
//
};
//
const codeName = hashObj[codeMap[this.auth_type]];
//
if (!codeName) {
//
alert('第三方登录失败');
//
} else {
//
this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
//
this.$router.push({ path: '/' });
//
});
//
}
}
},
created
()
{
window
.
addEventListener
(
'hashchange'
,
this
.
afterQRScan
);
//
window.addEventListener('hashchange', this.afterQRScan);
},
destroyed
()
{
window
.
removeEventListener
(
'hashchange'
,
this
.
afterQRScan
);
//
window.removeEventListener('hashchange', this.afterQRScan);
}
}
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment