Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
xulili
ybf
Commits
60e504f5
Commit
60e504f5
authored
Jan 14, 2020
by
xulili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代理
parent
67fc5807
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
18 deletions
+110
-18
App.vue
ybf_wx/src/App.vue
+1
-1
requestEa.js
ybf_wx/src/utils/requestEa.js
+5
-5
vue.config.js
ybf_wx/vue.config.js
+104
-12
No files found.
ybf_wx/src/App.vue
View file @
60e504f5
...
...
@@ -5,5 +5,5 @@
</
template
>
<
style
lang=
"scss"
>
@import
'~@/assets/style/public.scss'
;
/*@import '~@/assets/style/public.scss';*/
</
style
>
ybf_wx/src/utils/requestEa.js
View file @
60e504f5
...
...
@@ -2,7 +2,7 @@ import axios from 'axios'
import
md5
from
"js-md5"
// let BASE_API = "https://gd.chfatech.com/guangdian"
let
BASE_API
=
"
http://111.26.165.55:8010
/"
let
BASE_API
=
"
/api
/"
const
zlog
=
console
.
log
.
bind
(
console
)
...
...
@@ -13,18 +13,18 @@ const createSign = (inPostData, inAppSecret) => {
let
ts
=
inPostData
.
ts
let
args
=
JSON
.
parse
(
JSON
.
stringify
(
inPostData
.
args
));
let
appSecret
=
inAppSecret
let
res
=
""
;
// URL 编码
for
(
let
key
in
args
)
{
res
+=
encodeURIComponent
(
key
)
+
"%3d"
+
encodeURIComponent
(
args
[
key
]).
toLowerCase
()
+
"%26"
;
}
res
=
res
.
slice
(
0
,
-
3
);
// URL 拼接
res
+=
`&appUser=
${
appUser
}
&appCode=
${
appCode
}
&
${
ts
}
${
appSecret
}
`
return
res
;
};
...
...
ybf_wx/vue.config.js
View file @
60e504f5
// 拼接路径
const
resolve
=
dir
=>
require
(
'path'
).
join
(
__dirname
,
dir
)
// 基础路径 注意发布之前要先修改这里
const
publicPath
=
'/'
module
.
exports
=
{
devServer
:
{
proxy
:
{
'/trans'
:
{
// target: 'http://111.26.165.55:8010/',
target
:
'http://bing.com/'
,
ws
:
false
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/trans'
:
''
}
}
publicPath
,
// 根据你的实际情况更改这里
lintOnSave
:
true
,
devServer
:
{
publicPath
,
// 和 publicPath 保持一致
disableHostCheck
:
false
,
https
:
false
,
hotOnly
:
false
,
// See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#configuring-proxy
proxy
:
{
'/api'
:
{
ws
:
false
,
target
:
'http://111.26.165.55:8010'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/api'
:
''
}
},
}
}
\ No newline at end of file
},
css
:
{
loaderOptions
:
{
sass
:
{
prependData
:
`@import "~@/assets/style/public.scss";`
,
},
}
},
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack
:
config
=>
{
/**
* 删除懒加载模块的 prefetch preload,降低带宽压力
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#prefetch
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#preload
* 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的
*/
config
.
plugins
.
delete
(
'prefetch'
).
delete
(
'preload'
)
// 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559
config
.
resolve
.
symlinks
(
true
)
config
// 开发环境
.
when
(
process
.
env
.
NODE_ENV
===
'development'
,
// sourcemap不包含列信息
config
=>
config
.
devtool
(
'cheap-source-map'
)
)
// .when(process.env.NODE_ENV !== 'development', config => {
// config.optimization
// .minimizer([
// new UglifyJsPlugin({
// uglifyOptions: {
// // 移除 console
// // 其它优化选项 https://segmentfault.com/a/1190000010874406
// compress: {
// warnings: false,
// drop_console: true,
// drop_debugger: true,
// pure_funcs: ['console.log']
// }
// }
// })
// ])
// })
// // markdown
// config.module
// .rule('md')
// .test(/\.md$/)
// .use('text-loader')
// .loader('text-loader')
// .end()
// // i18n
// config.module
// .rule('i18n')
// .resourceQuery(/blockType=i18n/)
// .use('i18n')
// .loader('@kazupon/vue-i18n-loader')
// .end()
// svg
const
svgRule
=
config
.
module
.
rule
(
'svg'
)
svgRule
.
uses
.
clear
()
svgRule
.
include
.
add
(
resolve
(
'src/assets/svg-icons/icons'
))
.
end
()
.
use
(
'svg-sprite-loader'
)
.
loader
(
'svg-sprite-loader'
)
.
options
({
symbolId
:
'd2-[name]'
})
.
end
()
// image exclude
const
imagesRule
=
config
.
module
.
rule
(
'images'
)
imagesRule
.
test
(
/
\.(
png|jpe
?
g|gif|webp|svg
)(\?
.*
)?
$/
)
.
exclude
.
add
(
resolve
(
'src/assets/svg-icons/icons'
))
.
end
()
// 重新设置 alias
config
.
resolve
.
alias
.
set
(
'@api'
,
resolve
(
'src/api'
))
// node
config
.
node
.
set
(
'__dirname'
,
true
).
set
(
'__filename'
,
true
)
}
}
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