Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
walk_daka_h5
Overview
Overview
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
穆启卓
walk_daka_h5
Commits
8a9d7eae
Commit
8a9d7eae
authored
Mar 30, 2019
by
liu zhuoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线上版
parent
851f1a68
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
103 deletions
+104
-103
package-lock.json
package-lock.json
+0
-0
HelloWorld.vue
src/components/HelloWorld.vue
+1
-1
fetch.js
src/components/axios/fetch.js
+22
-22
url.js
src/components/axios/url.js
+76
-75
Author.vue
src/views/Author.vue
+2
-2
vue.config.js
vue.config.js
+3
-3
No files found.
package-lock.json
View file @
8a9d7eae
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/components/HelloWorld.vue
View file @
8a9d7eae
...
...
@@ -58,7 +58,7 @@
wx
.
config
({
debug
:
false
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
"wx
9af64967a0d40159
"
,
// 必填,公众号的唯一标识
appId
:
"wx
d1aab06cc88d0a5e
"
,
// 必填,公众号的唯一标识
timestamp
:
res
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
res
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
res
.
signature
,
// 必填,签名
...
...
src/components/axios/fetch.js
View file @
8a9d7eae
import
axios
from
'axios'
;
//引入axios
export
function
fetch
(
options
)
{
//
if (!window['userData']) {
//
let user_data_str = localStorage.getItem('walk_userData');
//
if (user_data_str) {
//
window['userData'] = JSON.parse(user_data_str);
//
}
//
}
//
if (!window['userData']) {
//
localStorage.setItem('last_url', location.hash.slice(1));
//
location.replace('#/Author');
//
// this.$router.push({name:"Author"})
//
}
if
(
!
window
[
'userData'
])
{
let
user_data_str
=
localStorage
.
getItem
(
'walk_userData'
);
if
(
user_data_str
)
{
window
[
'userData'
]
=
JSON
.
parse
(
user_data_str
);
}
}
if
(
!
window
[
'userData'
])
{
localStorage
.
setItem
(
'last_url'
,
location
.
hash
.
slice
(
1
));
location
.
replace
(
'#/Author'
);
// this.$router.push({name:"Author"})
}
return
new
Promise
((
resolve
,
reject
)
=>
{
const
instance
=
axios
.
create
({
//instance创建一个axios实例,可以自定义配置,可在 axios文档中查看详情
//所有的请求都会带上这些配置,比如全局都要用的身份信息等。
headers
:
{
'Content-Type'
:
'application/json'
,
//
'Authorization': window['userData']?window['userData'].token:''
'Authorization'
:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJvcGVuX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImV4cCI6MTU1Mzk3MTExOX0.KZhzLx6y6t_wDHU35DWNGVIp9M1tZLKzhaW8kMoeBoU"
'Authorization'
:
window
[
'userData'
]?
window
[
'userData'
].
token
:
''
//
'Authorization':"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJvcGVuX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImV4cCI6MTU1Mzk3MTExOX0.KZhzLx6y6t_wDHU35DWNGVIp9M1tZLKzhaW8kMoeBoU"
// 'token_in_header': global_.token,//token从全局变量那里传过来
},
timeout
:
30
*
1000
// 30秒超时
...
...
@@ -31,15 +31,15 @@ export function fetch(options) {
})
.
catch
(
error
=>
{
console
.
log
(
'请求异常信息:'
,
error
);
//
console.log(error);
//
if (error.response.status == 401) {
//
localStorage.setItem('last_url', location.hash.slice(1));
//
localStorage.setItem('walk_userData', '');
//
location.replace('#/Author');
//
// this.$router.push({name:"Author"})
//
} else {
//
reject(error);
//
}
console
.
log
(
error
);
if
(
error
.
response
.
status
==
401
)
{
localStorage
.
setItem
(
'last_url'
,
location
.
hash
.
slice
(
1
));
localStorage
.
setItem
(
'walk_userData'
,
''
);
location
.
replace
(
'#/Author'
);
// this.$router.push({name:"Author"})
}
else
{
reject
(
error
);
}
});
});
...
...
src/components/axios/url.js
View file @
8a9d7eae
...
...
@@ -3,90 +3,91 @@ let service = 'dev';
// let service = 'prod';
let
api
=
''
;
if
(
service
===
'dev'
)
{
/**dev开发**/
api
=
''
;
/**dev开发**/
// api = '';
api
=
'https://miniapp-api.wxatech.com/game-bsdk'
;
}
else
if
(
service
===
'prod'
)
{
/**prod部署**/
api
=
'https://miniapp-api.wxatech.com/game-bsdk'
;
/**prod部署**/
api
=
'https://miniapp-api.wxatech.com/game-bsdk'
;
}
let
trackApi
=
''
;
if
(
service
===
'dev'
)
{
/**dev开发**/
trackApi
=
'https://test-api.wxagame.com/game-track'
;
/**dev开发**/
trackApi
=
'https://test-api.wxagame.com/game-track'
;
}
else
if
(
service
===
'prod'
)
{
/**prod部署**/
trackApi
=
'https://minigame.api.wxagame.com/game-track'
;
/**prod部署**/
trackApi
=
'https://minigame.api.wxagame.com/game-track'
;
}
export
default
{
/**个人中心start**/
//1 打卡查询 GET /api/v1/daka_status
dakaStatusPath
:
`
${
api
}
/api/v1/daka_status`
,
//2 打卡操作 POST /api/v1/daka
dakaPath
:
`
${
api
}
/api/v1/daka`
,
//3 打卡记录 GET /api/v1/daka_records
dakaRecordsTotalPath
:
`
${
api
}
/api/v1/daka_records/total`
,
dakaRecordsListPath
:
`
${
api
}
/api/v1/daka_records/list`
,
dakaRecordsDetailPath
:
`
${
api
}
/api/v1/daka_records/detail`
,
//4 走马灯、玩法 GET /api/v1/game_info
gameInfoPath
:
`
${
api
}
/api/v1/game_info`
,
//5 余额查询 GET /api/v1/balance_query
balanceQueryPath
:
`
${
api
}
/api/v1/balance_query`
,
//6 余额提现 GET /api/v1/balance_withdraw
balanceWithdrawPath
:
`
${
api
}
/api/v1/balance_withdraw`
,
//7 常见问题 GET /api/v1/faq
faqPath
:
`
${
api
}
/api/v1/faq`
,
//8 客服 GET /api/v1/kefu
kefuPath
:
`
${
api
}
/api/v1/kefu`
,
//9 关注公众号 GET /api/v1/oc_follow
ocFollowPath
:
`
${
api
}
/api/v1/oc_follow`
,
//10 报名支付 GET /api/v1/daka_pay
dakaPayPath
:
`
${
api
}
/api/v1/daka_pay`
,
//11 jssdk注入
jssdkPath
:
`
${
api
}
/api/v1/config/jssdk`
,
// 12 提现banner GET /api/v1/config/withdraw_banner
withdrawBannerPath
:
`
${
api
}
/api/v1/config/withdraw_banner`
,
// 13 用户复活卡,免契约金卡信息 GET /api/v1/user_cards
userCardPath
:
`
${
api
}
/api/v1/user_cards`
,
// 14 分享内容 /api/v1/config/share_content
shareContentPath
:
`
${
api
}
/api/v1/config/share_content`
,
// 15 获取规则文本 /api/v1/get_rule
getRulePath
:
`
${
api
}
/api/v1/get_rule`
,
// 16 数据埋点 /api/v1/tracking
trackingPath
:
`
${
api
}
/api/v1/tracking`
,
// 17 关注公众号图片 /api/v1/liin_share_image
liinShareImagePath
:
`
${
api
}
/api/v1/liin_share_image`
,
// 18 每日分享图 /api/v1/daily_share_image
dailyShareImagePath
:
`
${
api
}
/api/v1/qrcode_url`
,
// 19 每日排行榜 /api/v1/daka_rank
dakaRankPath
:
`
${
api
}
/api/v1/daka_rank`
,
// 20 新用户 /api/v1/first_daka
firstDakaPath
:
`
${
api
}
/api/v1/first_daka`
,
// 21 个人排名 /api/v1/person_rank_info
personRankInfoPath
:
`
${
api
}
/api/v1/person_rank_info`
,
// 22 用户当月打卡状态查询
daka_status_list
:
`
${
api
}
/api/v1/daka_status/list`
,
// 23 每日故事详情
story_detail
:
`
${
api
}
/api/v1/story/detail`
,
// 24 每日故事列表
story_list
:
`
${
api
}
/api/v1/story/list`
,
// 25 记录详情
daka_records_detail
:
`
${
api
}
/api/v1/daka_records/detail`
,
// 25 规则详情
daka_rule
:
`
${
api
}
/api/v1/daka_rule`
,
// 26 红包 /api/v1/withdraw_img
withdraw_img
:
`
${
api
}
/api/v1/withdraw_img`
,
// 27 提现明细 /api/v1/withdraw_log
withdraw_log
:
`
${
api
}
/api/v1/withdraw_log`
,
// 首页数据
daka_index
:
`
${
api
}
/api/v1/daka_index`
,
// 判断用户是否参与比赛
select_user_signup
:
`
${
api
}
/api/v1/select_user_signup`
,
// 比赛详情
daka_status_detail
:
`
${
api
}
/api/v1/daka_status/detail`
,
// 比赛详情弹窗
pop_up_windows
:
`
${
api
}
/api/v1/pop_up_windows`
,
/**个人中心start**/
//1 打卡查询 GET /api/v1/daka_status
dakaStatusPath
:
`
${
api
}
/api/v1/daka_status`
,
//2 打卡操作 POST /api/v1/daka
dakaPath
:
`
${
api
}
/api/v1/daka`
,
//3 打卡记录 GET /api/v1/daka_records
dakaRecordsTotalPath
:
`
${
api
}
/api/v1/daka_records/total`
,
dakaRecordsListPath
:
`
${
api
}
/api/v1/daka_records/list`
,
dakaRecordsDetailPath
:
`
${
api
}
/api/v1/daka_records/detail`
,
//4 走马灯、玩法 GET /api/v1/game_info
gameInfoPath
:
`
${
api
}
/api/v1/game_info`
,
//5 余额查询 GET /api/v1/balance_query
balanceQueryPath
:
`
${
api
}
/api/v1/balance_query`
,
//6 余额提现 GET /api/v1/balance_withdraw
balanceWithdrawPath
:
`
${
api
}
/api/v1/balance_withdraw`
,
//7 常见问题 GET /api/v1/faq
faqPath
:
`
${
api
}
/api/v1/faq`
,
//8 客服 GET /api/v1/kefu
kefuPath
:
`
${
api
}
/api/v1/kefu`
,
//9 关注公众号 GET /api/v1/oc_follow
ocFollowPath
:
`
${
api
}
/api/v1/oc_follow`
,
//10 报名支付 GET /api/v1/daka_pay
dakaPayPath
:
`
${
api
}
/api/v1/daka_pay`
,
//11 jssdk注入
jssdkPath
:
`
${
api
}
/api/v1/config/jssdk`
,
// 12 提现banner GET /api/v1/config/withdraw_banner
withdrawBannerPath
:
`
${
api
}
/api/v1/config/withdraw_banner`
,
// 13 用户复活卡,免契约金卡信息 GET /api/v1/user_cards
userCardPath
:
`
${
api
}
/api/v1/user_cards`
,
// 14 分享内容 /api/v1/config/share_content
shareContentPath
:
`
${
api
}
/api/v1/config/share_content`
,
// 15 获取规则文本 /api/v1/get_rule
getRulePath
:
`
${
api
}
/api/v1/get_rule`
,
// 16 数据埋点 /api/v1/tracking
trackingPath
:
`
${
api
}
/api/v1/tracking`
,
// 17 关注公众号图片 /api/v1/liin_share_image
liinShareImagePath
:
`
${
api
}
/api/v1/liin_share_image`
,
// 18 每日分享图 /api/v1/daily_share_image
dailyShareImagePath
:
`
${
api
}
/api/v1/qrcode_url`
,
// 19 每日排行榜 /api/v1/daka_rank
dakaRankPath
:
`
${
api
}
/api/v1/daka_rank`
,
// 20 新用户 /api/v1/first_daka
firstDakaPath
:
`
${
api
}
/api/v1/first_daka`
,
// 21 个人排名 /api/v1/person_rank_info
personRankInfoPath
:
`
${
api
}
/api/v1/person_rank_info`
,
// 22 用户当月打卡状态查询
daka_status_list
:
`
${
api
}
/api/v1/daka_status/list`
,
// 23 每日故事详情
story_detail
:
`
${
api
}
/api/v1/story/detail`
,
// 24 每日故事列表
story_list
:
`
${
api
}
/api/v1/story/list`
,
// 25 记录详情
daka_records_detail
:
`
${
api
}
/api/v1/daka_records/detail`
,
// 25 规则详情
daka_rule
:
`
${
api
}
/api/v1/daka_rule`
,
// 26 红包 /api/v1/withdraw_img
withdraw_img
:
`
${
api
}
/api/v1/withdraw_img`
,
// 27 提现明细 /api/v1/withdraw_log
withdraw_log
:
`
${
api
}
/api/v1/withdraw_log`
,
// 首页数据
daka_index
:
`
${
api
}
/api/v1/daka_index`
,
// 判断用户是否参与比赛
select_user_signup
:
`
${
api
}
/api/v1/select_user_signup`
,
// 比赛详情
daka_status_detail
:
`
${
api
}
/api/v1/daka_status/detail`
,
// 比赛详情弹窗
pop_up_windows
:
`
${
api
}
/api/v1/pop_up_windows`
,
}
src/views/Author.vue
View file @
8a9d7eae
...
...
@@ -20,7 +20,7 @@
let
local_hash
=
location
.
hash
;
window
.
localStorage
.
setItem
(
"local_hash"
,
local_hash
);
let
redirect_uri
=
encodeURIComponent
(
`
${
location
.
origin
}${
location
.
pathname
}
`
);
location
.
replace
(
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx
9af64967a0d40159
&redirect_uri=
${
redirect_uri
}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
);
location
.
replace
(
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx
d1aab06cc88d0a5e
&redirect_uri=
${
redirect_uri
}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
);
}
else
{
console
.
log
(
"拿到code"
,
code
);
console
.
log
(
"请求登录"
);
...
...
@@ -54,7 +54,7 @@
// setTimeout(() => {
// // this.$router.go("/MyData");
location
.
replace
(
`https://miniapp-api.wxatech.com/app_pages/
read
_daka.html?#
${
last_url
}
`
`https://miniapp-api.wxatech.com/app_pages/
walk
_daka.html?#
${
last_url
}
`
);
// }, 60000);
}
...
...
vue.config.js
View file @
8a9d7eae
//vue.config.js
module
.
exports
=
{
// 选项...
//
publicPath: 'https://miniapp-api.wxatech.com/app_pages',
// indexPath: "read
_daka.html",
// assetsDir: "read
_static",
publicPath
:
'https://miniapp-api.wxatech.com/app_pages'
,
indexPath
:
"walk
_daka.html"
,
assetsDir
:
"walk
_static"
,
devServer
:
{
proxy
:
{
'/api'
:
{
...
...
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