Commit af1b30e2 by 穆启卓

小细节

parent e1496465
......@@ -342,7 +342,7 @@
if (window["userData"]) {
this.userData = window["userData"];
} else {
let localUserData = localStorage.getItem("read_userData");
let localUserData = localStorage.getItem("walk_userData");
if (localUserData) {
window["userData"] = JSON.parse(localUserData);
this.userData = window["userData"];
......
......@@ -270,7 +270,7 @@
if (window["userData"]) {
this.userData = window["userData"];
} else {
let localUserData = localStorage.getItem("read_userData");
let localUserData = localStorage.getItem("walk_userData");
if (localUserData) {
window["userData"] = JSON.parse(localUserData);
this.userData = window["userData"];
......
......@@ -17,9 +17,8 @@ function getPlatform() {
//打卡查询
export function dakaStatus() { //lookOption是你要调用接口的名字,issuer,userId是传进来的参数
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaStatusPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -28,15 +27,12 @@ export function dakaStatus() { //lookOption是你要调用接口的名字,issu
// 打卡操作
export function daka(use_rebirth) { //lookOption是你要调用接口的名字,issuer,userId是传进来的参数
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
use_rebirth: use_rebirth || 0,
}
})
}
......@@ -44,9 +40,8 @@ export function daka(use_rebirth) { //lookOption是你要调用接口的名字
// 打卡总计
export function dakaRecordTotal() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaRecordsTotalPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -56,9 +51,8 @@ export function dakaRecordTotal() {
// 打卡记录列表
export function dakaRecordList(page, perpage) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaRecordsListPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
// 第几页(从1开始)
......@@ -72,9 +66,8 @@ export function dakaRecordList(page, perpage) {
// 打卡总计
export function dakaRecordDetail(page, perpage, period, daka) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaRecordsDetailPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
// 第几页(从1开始)
......@@ -90,9 +83,8 @@ export function dakaRecordDetail(page, perpage, period, daka) {
// 走马灯,玩法
export function gameInfo() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.gameInfoPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -102,9 +94,8 @@ export function gameInfo() {
// 余额查询
export function balanceQuery() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.balanceQueryPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -120,9 +111,8 @@ export function balanceWithdraw(money, code) {
params["money"] = money
}
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.balanceWithdrawPath,
method: 'GET',//请求方法
method: 'GET',
params: params
})
}
......@@ -130,9 +120,8 @@ export function balanceWithdraw(money, code) {
// 常见问题
export function faq() { //lookOption是你要调用接口的名字,issuer,userId是传进来的参数
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.faqPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -142,9 +131,8 @@ export function faq() { //lookOption是你要调用接口的名字,issuer,user
// 客服
export function kefu() { //lookOption是你要调用接口的名字,issuer,userId是传进来的参数
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.kefuPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -154,9 +142,8 @@ export function kefu() { //lookOption是你要调用接口的名字,issuer,use
// 关注公众号
export function ocFollow() { //lookOption是你要调用接口的名字,issuer,userId是传进来的参数
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.ocFollowPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -177,9 +164,8 @@ export function dakaPay(days,use_contract) {
from_type = localStorage.getItem('from_type');
}
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaPayPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
// platform: ios, android, other
......@@ -195,9 +181,8 @@ export function dakaPay(days,use_contract) {
// jssdk注入
export function jssdk(url) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.jssdkPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
// platform: ios, android, other
......@@ -209,9 +194,8 @@ export function jssdk(url) {
// 用户复活卡,免契约金卡信息
export function userCards() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.userCardPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -221,9 +205,8 @@ export function userCards() {
// 获取分享内容
export function shareContent(from_type) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.shareContentPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
from_type: from_type || ''
......@@ -234,9 +217,8 @@ export function shareContent(from_type) {
// 获取规则内容
export function getRule() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.getRulePath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
from_type: from_type || ''
......@@ -248,9 +230,8 @@ export function getRule() {
// 数据埋点
export function track(key) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.trackingPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
p: `study`,
......@@ -264,9 +245,8 @@ export function track(key) {
export function liinShare(key) {
var new_user = sessionStorage.getItem('new_user') ? 1 : 0;
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.liinShareImagePath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
new_user: new_user
......@@ -277,9 +257,8 @@ export function liinShare(key) {
// 每日分享图
export function dailyShare(from_type) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dailyShareImagePath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
from_type: from_type || "daily_share"
......@@ -290,9 +269,8 @@ export function dailyShare(from_type) {
// 打卡排行榜
export function dakaRank(page, per_page, period) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.dakaRankPath,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
page: page || 1,
......@@ -305,9 +283,8 @@ export function dakaRank(page, per_page, period) {
// 新用户
export function firstDaka() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.firstDakaPath,
method: 'GET',//请求方法
method: 'GET',
params: {}
})
}
......@@ -315,9 +292,8 @@ export function firstDaka() {
// 个人排名
export function personRank(period) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.personRankInfoPath,
method: 'GET',//请求方法
method: 'GET',
params: {
period: period
}
......@@ -327,9 +303,8 @@ export function personRank(period) {
// 用户当月打卡状态查询
export function daka_status_list(year_month) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.daka_status_list,
method: 'GET',//请求方法
method: 'GET',
params: {
year_month: year_month || ""
}
......@@ -339,9 +314,8 @@ export function daka_status_list(year_month) {
// 每日故事详情
export function story_detail(story_id, story_index) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.story_detail,
method: 'GET',//请求方法
method: 'GET',
params: {
story_id: story_id,
story_index: story_index,
......@@ -352,9 +326,8 @@ export function story_detail(story_id, story_index) {
// 每日故事列表
export function story_list() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.story_list,
method: 'GET',//请求方法
method: 'GET',
params: {}
})
}
......@@ -363,9 +336,8 @@ export function story_list() {
// 记录详情
export function daka_records_detail(course_id) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.daka_records_detail,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
course_id: course_id,
......@@ -376,9 +348,8 @@ export function daka_records_detail(course_id) {
// 记录详情
export function daka_rule() {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.daka_rule,
method: 'GET',//请求方法
method: 'GET',
params: {
//传过去的参数
}
......@@ -389,9 +360,8 @@ export function daka_rule() {
// 红包图片
export function withdraw_img(position) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.withdraw_img,
method: 'GET',//请求方法
method: 'GET',
params: {
position: position || ""
}
......@@ -401,9 +371,8 @@ export function withdraw_img(position) {
// 资金明细
export function withdraw_log(page) {
return fetch({
//api.Hallowmas 引用url.js里面的数据
url: api.withdraw_log,
method: 'GET',//请求方法
method: 'GET',
params: {
page: page,
per_page: 10
......@@ -415,7 +384,7 @@ export function withdraw_log(page) {
export function daka_index(grade) {
return fetch({
url: api.daka_index,
method: 'GET',//请求方法
method: 'GET',
params: {
grade: grade
}
......
......@@ -2,7 +2,7 @@ import axios from 'axios';//引入axios
export function fetch(options) {
// if (!window['userData']) {
// let user_data_str = localStorage.getItem('read_userData');
// let user_data_str = localStorage.getItem('walk_userData');
// if (user_data_str) {
// window['userData'] = JSON.parse(user_data_str);
// }
......@@ -34,7 +34,7 @@ export function fetch(options) {
// console.log(error);
// if (error.response.status == 401) {
// localStorage.setItem('last_url', location.hash.slice(1));
// localStorage.setItem('read_userData', '');
// localStorage.setItem('walk_userData', '');
// location.replace('#/Author');
// // this.$router.push({name:"Author"})
// } else {
......
......@@ -77,7 +77,7 @@ export default {
daka_records_detail: `${api}/api/v1/daka_records/detail`,
// 25 规则详情
daka_rule: `${api}/api/v1/daka_rule`,
// 26 红包 /api/v1/withdraw_img
// 26 红包 /api/v1/withdraw_img
withdraw_img: `${api}/api/v1/withdraw_img`,
// 27 提现明细 /api/v1/withdraw_log
withdraw_log: `${api}/api/v1/withdraw_log`,
......
......@@ -17,7 +17,7 @@ window.wx = wx;
router.beforeEach((to, from, next) => {
// document.title = to.meta.title //修改各个页面的title
var uid = localStorage.getItem('read_userData');
var uid = localStorage.getItem('walk_userData');
if (location.search.match(/inviter/)) {
let searchs = location.search.split('&');
let search_obj = {};
......
......@@ -7,6 +7,11 @@
// var url = getToUrl();
export default {
name: "Author",
data() {
return {
uid: ""
};
},
created() {
document.title = "微信授权中";
var code = this.GetUrlParame("code"); // 截取code
......@@ -14,18 +19,14 @@
if (!code) {
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=wx9af64967a0d40159&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
);
let redirect_uri = encodeURIComponent(`${location.origin}${location.pathname}`);
location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9af64967a0d40159&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`);
} else {
console.log("拿到code", code);
console.log("请求登录");
let inviter = localStorage.getItem("inviter");
var uid = localStorage.getItem('read_userData');
var uid = localStorage.getItem('walk_userData');
if (uid && inviter == JSON.parse(uid).id) {
inviter = "";
}
......@@ -46,7 +47,7 @@
}
let result = res.data;
if (result.code == 0) {
localStorage.setItem("read_userData", JSON.stringify(result.data));
localStorage.setItem("walk_userData", JSON.stringify(result.data));
sessionStorage.setItem("new_user", result.data.new_user);
let last_url = localStorage.getItem("last_url") || "/";
let url = location.href.split("#")[0];
......@@ -65,11 +66,6 @@
});
}
},
data() {
return {
uid: ""
};
},
methods: {
// 截取code
GetUrlParame(parameName) {
......
......@@ -36,7 +36,7 @@
Title
},
created() {
let userData = localStorage.getItem("read_userData")
let userData = localStorage.getItem("walk_userData")
if (userData) {
this.userData = JSON.parse(userData)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment