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
f100d1f9
Commit
f100d1f9
authored
Jan 14, 2020
by
xd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://114.67.93.201/xulili/ybf
parents
be458508
60e504f5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
274 additions
and
48 deletions
+274
-48
page.vue
ybf_admin/src/views/system/login/page.vue
+1
-0
.eslintrc.js
ybf_wx/.eslintrc.js
+2
-1
package.json
ybf_wx/package.json
+1
-0
App.vue
ybf_wx/src/App.vue
+1
-1
active.js
ybf_wx/src/api/test/active.js
+1
-1
main.js
ybf_wx/src/api/test/main.js
+14
-3
requestCf.js
ybf_wx/src/utils/requestCf.js
+75
-0
requestEa.js
ybf_wx/src/utils/requestEa.js
+15
-10
requestWx.js
ybf_wx/src/utils/requestWx.js
+35
-0
index.vue
ybf_wx/src/views/sideNav/discount/index.vue
+18
-22
vue.config.js
ybf_wx/vue.config.js
+107
-0
yarn.lock
ybf_wx/yarn.lock
+4
-10
No files found.
ybf_admin/src/views/system/login/page.vue
View file @
f100d1f9
...
...
@@ -158,6 +158,7 @@ export default {
})
.
then
(()
=>
{
// 重定向对象不存在则返回顶层路径
// this.$router.replace(this.$route.query.redirect || '/homeMain')
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
'/homeMain'
)
})
}
else
{
...
...
ybf_wx/.eslintrc.js
View file @
f100d1f9
...
...
@@ -9,7 +9,8 @@ module.exports = {
],
rules
:
{
'no-console'
:
process
.
env
.
NODE_ENV
===
'production'
?
'error'
:
'off'
,
'no-debugger'
:
process
.
env
.
NODE_ENV
===
'production'
?
'error'
:
'off'
'no-debugger'
:
process
.
env
.
NODE_ENV
===
'production'
?
'error'
:
'off'
,
'no-unused-vars'
:
'off'
},
parserOptions
:
{
parser
:
'babel-eslint'
...
...
ybf_wx/package.json
View file @
f100d1f9
...
...
@@ -3,6 +3,7 @@
"version"
:
"0.1.0"
,
"private"
:
true
,
"scripts"
:
{
"start"
:
"vue-cli-service serve"
,
"serve"
:
"vue-cli-service serve"
,
"build"
:
"vue-cli-service build"
,
"lint"
:
"vue-cli-service lint"
...
...
ybf_wx/src/App.vue
View file @
f100d1f9
...
...
@@ -5,5 +5,5 @@
</
template
>
<
style
lang=
"scss"
>
@import
'~@/assets/style/public.scss'
;
/*@import '~@/assets/style/public.scss';*/
</
style
>
ybf_wx/src/api/test/active.js
View file @
f100d1f9
import
request
from
'@/utils/request'
import
request
from
'@/utils/request
Ea
'
// 案例
export
function
getCaseList
(
data
)
{
...
...
ybf_wx/src/api/test/main.js
View file @
f100d1f9
import
request
from
'@/utils/request'
import
request
from
'@/utils/request
Ea
'
export
function
ApiTestGet
()
{
return
request
({
...
...
@@ -6,9 +6,20 @@ export function ApiTestGet() {
method
:
'get'
})
}
export
function
ApiTestPost
(
inData
)
{
export
function
ApiTestCfPost
(
inData
)
{
let
postData
=
{
args
:
inData
}
return
request
({
url
:
'/trans/'
,
method
:
'post'
,
data
:
postData
})
}
export
function
ApiTestEaPost
(
inData
)
{
let
postData
=
{
appCode
:
"0611"
,
args
:
inData
}
return
request
({
...
...
ybf_wx/src/utils/requestCf.js
0 → 100644
View file @
f100d1f9
import
axios
from
'axios'
import
{
Message
,
MessageBox
}
from
'element-ui'
// import Router from '../router'
// import store from '../store'
// import { getToken } from '@/utils/auth'
const
testEnv
=
require
(
'../../config/dev.env'
)
// 创建axios实例
const
service
=
axios
.
create
({
baseURL
:
testEnv
.
BASE_API
,
// api 的 base_url
timeout
:
50000
// 请求超时时间
})
// request拦截器
service
.
interceptors
.
request
.
use
(
(
config
)
=>
{
if
(
sessionStorage
[
'token'
])
{
config
.
headers
[
'token'
]
=
sessionStorage
[
'token'
]
config
.
headers
[
'corpId'
]
=
'wwd1cdbca7b8b2b6c4'
config
.
headers
[
'agentId'
]
=
'1000015'
}
else
{
config
.
headers
[
'businessId'
]
=
'10'
}
return
config
;
},
(
error
)
=>
{
Promise
.
reject
(
error
)
}
)
// response 拦截器
service
.
interceptors
.
response
.
use
(
response
=>
{
console
.
log
(
response
)
if
(
response
.
status
==
200
)
{
return
response
.
data
}
else
{
Message
({
message
:
response
.
data
.
msg
,
type
:
'error'
,
duration
:
5
*
1000
})
}
// let loadingSetting = Loading.service({
// fullscreen: true,
// lock: true,
// background: 'rgba(0,0,0,0.4)',
// text: '正在加载',
// spinner: 'el-icon-loading'
// })
// endLoading(loadingSetting)
// if (response.errorCode == '1001') {
// Router.push({ path: "/login" });
// }
},
error
=>
{
console
.
log
(
error
)
// console.log('err' + error) // for debug
// Message({
// message: error.message,
// type: 'error',
// duration: 50 * 1000
// })
// return Promise.reject(error)
}
)
// function endLoading (loading) {
// store.commit('LOADING', false)
// loading.close()
// }
// function startLoding () {
// store.commit('LOADING', true)
// }
export
default
service
ybf_wx/src/utils/request.js
→
ybf_wx/src/utils/request
Ea
.js
View file @
f100d1f9
import
axios
from
'axios'
import
md5
from
"js-md5"
let
BASE_API
=
"https://gd.chfatech.com/guangdian"
const
log
=
console
.
log
.
bind
(
console
)
// let BASE_API = "https://gd.chfatech.com/guangdian"
let
BASE_API
=
"/api/"
const
zlog
=
console
.
log
.
bind
(
console
)
// URL 编码与拼接
const
createSign
=
(
inPostData
,
inAppSecret
)
=>
{
...
...
@@ -11,25 +13,25 @@ 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
;
};
// Basic Info
let
basicInfo
=
{
appUser
:
"user001"
,
ver
:
"v
1.0
"
,
ver
:
"v
2.17
"
,
appSecret
:
"JeC0mmE2ZjZmOfdmTGImYzU5Yjg1AYU2M3F="
}
...
...
@@ -42,11 +44,11 @@ const service = axios.create({
// request 拦截器
service
.
interceptors
.
request
.
use
(
res
=>
{
log
(
'--->axios: res.data:'
,
res
.
data
)
//
log('--->axios: res.data:', res.data)
let
oldPostData
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
))
let
newPostData
=
{
appUser
:
basicInfo
.
appUser
,
appCode
:
oldPostData
.
appCode
,
appCode
:
oldPostData
.
a
rgs
.
a
ppCode
,
ts
:
String
(
Date
.
parse
(
new
Date
())),
ver
:
basicInfo
.
ver
,
args
:
oldPostData
.
args
...
...
@@ -61,6 +63,9 @@ service.interceptors.request.use(
args
:
newPostData
.
args
}
delete
postData
.
args
.
appCode
zlog
()
res
.
data
=
postData
return
res
...
...
@@ -81,4 +86,4 @@ service.interceptors.response.use(
}
)
export
default
service
\ No newline at end of file
export
default
service
ybf_wx/src/utils/requestWx.js
0 → 100644
View file @
f100d1f9
import
axios
from
'axios'
export
function
wxRequest
(
url
,
data
=
{},
header
=
{},
method
=
'post'
)
{
// let URL = `http://172.16.0.111:8081${url}`
let
URL
=
`http://139.155.48.151:8081
${
url
}
`
if
(
method
==
'post'
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
axios
({
url
:
URL
,
method
:
method
,
headers
:
header
,
data
:
data
}).
then
(
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
res
=>
{
reject
(
res
)
})
})
}
if
(
method
==
'get'
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
axios
({
url
:
URL
,
method
:
method
,
headers
:
header
,
params
:
data
}).
then
(
res
=>
{
resolve
(
res
.
data
)
}).
catch
(
res
=>
{
reject
(
res
)
})
})
}
}
\ No newline at end of file
ybf_wx/src/views/sideNav/discount/index.vue
View file @
f100d1f9
...
...
@@ -14,7 +14,7 @@
<div
class=
"main-money"
>
{{
item
.
money
}}
元代金券
</div>
</div>
<div
class=
"buttons"
>
<button
class=
"button-send"
@
click=
"test
ButtonClick
"
>
推送
</button>
<button
class=
"button-send"
@
click=
"test
ApiCfPost
"
>
推送
</button>
</div>
</div>
<div
class=
"infos-tips"
>
...
...
@@ -33,8 +33,8 @@
</
template
>
<
script
>
import
{
ApiTest
Get
,
ApiTest
Post
}
from
"@/api/test/main"
;
const
log
=
console
.
log
.
bind
(
console
);
import
{
ApiTest
CfPost
,
ApiTestEa
Post
}
from
"@/api/test/main"
;
//
const log = console.log.bind(console);
export
default
{
name
:
"discountIndex"
,
...
...
@@ -78,33 +78,29 @@ export default {
};
},
created
()
{
// this.testApiGet();
this
.
testApiPost
();
},
methods
:
{
testApiGet
()
{
log
(
"--->testApi: Start:"
);
ApiTestGet
().
then
(
res
=>
{
log
(
"--->Api: Get: res ="
,
res
);
testApiCfPost
()
{
let
postData
=
{
appCode
:
'0606'
,
crmActionDate
:
'2020-01-10'
};
ApiTestCfPost
(
postData
).
then
(
res
=>
{
});
log
(
"--->testApi: End."
);
},
testApiPost
()
{
log
(
"--->testApi: Start:"
);
testApiEaPost
()
{
let
postData
=
{
brief
:
"停车券兑换"
,
orderNo
:
"12345678"
,
point
:
"123.321"
,
procType
:
46
,
updateType
:
"dec"
,
vipId
:
1
appCode
:
'0606'
,
crmActionDate
:
'2020-01-10'
};
ApiTestPost
(
postData
).
then
(
res
=>
{
log
(
"--->Api: Post: res ="
,
res
);
ApiTestEaPost
(
postData
).
then
(
res
=>
{
});
log
(
"--->testApi: End."
);
},
testButtonClick
()
{},
testButtonClick
()
{
this
.
testApiPost
()
},
buttonSingleMarketingClick
()
{
// this.$router.push("");
...
...
ybf_wx/vue.config.js
0 → 100644
View file @
f100d1f9
// 拼接路径
const
resolve
=
dir
=>
require
(
'path'
).
join
(
__dirname
,
dir
)
// 基础路径 注意发布之前要先修改这里
const
publicPath
=
'/'
module
.
exports
=
{
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'
:
''
}
},
}
},
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
)
}
}
ybf_wx/yarn.lock
View file @
f100d1f9
...
...
@@ -1503,13 +1503,12 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c"
integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==
axios@^0.19.
0
:
version "0.19.
0
"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.
0.tgz#8e09bff3d9122e133f7b8101c8fbdd00ed3d2ab8
"
integrity sha512-
1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ
==
axios@^0.19.
1
:
version "0.19.
1
"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.
1.tgz#8a6a04eed23dfe72747e1dd43c604b8f1677b5aa
"
integrity sha512-
Yl+7nfreYKaLRvAvjNPkvfjnQHJM1yLBY3zhqAwcJSwR/6ETkanUgylgtIvkvz0xJ+p/vZuNw8X7Hnb7Whsbpw
==
dependencies:
follow-redirects "1.5.10"
is-buffer "^2.0.2"
babel-eslint@^10.0.3:
version "10.0.3"
...
...
@@ -4404,11 +4403,6 @@ is-buffer@^1.1.5:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
is-buffer@^2.0.2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.4.tgz#3e572f23c8411a5cfd9557c849e3665e0b290623"
integrity sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==
is-callable@^1.1.4, is-callable@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab"
...
...
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