Commit 9cffeb61 authored by 全球's avatar 全球

修改

parents f741c165 cc1a3c7d
VUE_APP_BASE_URL = "http://8.131.244.76:81/"
\ No newline at end of file
VUE_APP_BASE_URL = "http://8.131.244.76:81"
\ No newline at end of file
......@@ -6,8 +6,8 @@
</template>
<script>
import { getAuthToken } from "@/utils/bridgeToAppFun";
import BaseNavBar from "./components/BaseNavBar.vue";
import { getUserInfo } from "@/api/user";
export default {
components: {
BaseNavBar
......@@ -22,15 +22,31 @@ export default {
this.currentTitle = val.meta.title;
}
},
mounted() {
getAuthToken()
created() {
console.log("和App开始交互");
this.$bridgeToAppFun
.getAuthToken()
.then(res => {
// const token = res;
console.log(res);
console.log("获取token成功", res);
this.saveUser(res);
})
.catch(err => {
console.log("error", err);
console.log("获取token失败", err);
});
},
methods: {
saveUser(data) {
if (data) {
getUserInfo().then(res => {
console.log("存用户信息");
if (res.code == 0) {
localStorage.setItem("user", JSON.stringify(res.data));
}
});
} else {
console.log("调用失败");
}
}
}
};
</script>
......
......@@ -55,7 +55,7 @@ export function cashOut(params) {
/**
* 获取用户银行卡信息
* @param {*} params
* @param {*} params userId
* @returns
*/
export function getUserBankInfo(params) {
......@@ -65,3 +65,14 @@ export function getUserBankInfo(params) {
params
});
}
/**
* 获取银行卡列表
* @returns
*/
export function getBankList() {
return request({
url: "/bank/getBankNameList",
method: "get"
});
}
......@@ -65,15 +65,26 @@ export function logout(token) {
});
}
/**
* 根据token获取userId
* @param {*} params token
*/
export function getUserInfo() {
export function getUserInfo() {
return request({
url: "/api/user/info",
method: "post",
method: "post"
});
}
/**
* 获取用户信息
* @param {*} params userId
* @returns
*/
export function getUserInfo2(params) {
return request({
url: "/user/getByUserId",
method: "get",
params
});
}
\ No newline at end of file
}
......@@ -20,7 +20,31 @@ export default {
},
methods: {
onClickLeft() {
this.$router.go(-1);
const currentPage = this.$router.currentRoute.name;
console.log("router", currentPage);
const whiteList = [
"MyStatus",
"Publish",
"FastestProgress",
"MonthAward",
"Instructions",
"Settings",
"Grade",
"AirDrop",
"Invite",
"AboutUs",
"customerService"
];
if (whiteList.indexOf(currentPage) > -1) {
try {
this.$bridgeToAppFun.navigateBack();
} catch {
console.log("不能交互");
}
} else {
this.$router.go(-1);
}
// this.$router.go(-1);
},
onClickRight() {
console.log("right");
......
......@@ -8,9 +8,14 @@ import "amfe-flexible";
import "@/plugins/vant-ui.js";
import "@/plugins/echarts-plugins.js";
import Vconsole from "vconsole";
import { getUserId, getUserAvatar } from "./utils/localGetter";
Vue.prototype.$userId = getUserId();
Vue.prototype.$userAvatar = getUserAvatar();
Vue.prototype.$vConsole = new Vconsole();
import bridgeToAppFun from "@/utils/bridgeToAppFun";
Vue.prototype.$bridgeToAppFun = new bridgeToAppFun();
Vue.prototype.$vConsole = new Vconsole();
Vue.use(MiniRefreshTools);
Vue.config.productionTip = false;
......
import Vue from "vue";
import {
ActionSheet,
Button,
Cell,
CellGroup,
......@@ -24,7 +25,8 @@ import {
Loading
} from "vant";
Vue.use(Button)
Vue.use(ActionSheet)
.use(Button)
.use(Cell)
.use(CellGroup)
.use(Dialog)
......
// H5 去调用App的方法
import jsBridge from "./bridge";
import { getUserInfo } from "@/api/user";
// 获取Token
export function getAuthToken() {
return new Promise((resolve, reject) => {
console.log("调用1");
jsBridge.callhandler("getAuthToken", null, data => {
console.log("调用2");
localStorage.setItem("token", data);
console.log("--------------");
if (data) {
getUserInfo().then(res=>{
})
alert("获取到的token" + data);
resolve(data);
} else {
reject("调用失败,未返回data");
class bridgeToAppFun {
constructor() {
this.userAgent = null;
console.log(navigator.userAgent);
if (
navigator.userAgent.indexOf("Android") > -1 ||
navigator.userAgent.indexOf("Adr") > -1
) {
this.userAgent = "android";
} else if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
this.userAgent = "ios";
} else {
this.userAgent = "web";
}
}
// 获取Token
getAuthToken() {
if (this.userAgent === "android") {
// android
let token = null;
try {
token = window.android.getAuthToken();
localStorage.setItem("token", token);
} catch {
console.log("token获取失败");
}
});
});
return new Promise((resolve, reject) => {
if (token) {
resolve(token);
} else {
reject("失败");
}
});
} else if (this.userAgent === "ios") {
// ios
return new Promise((resolve, reject) => {
jsBridge.callhandler("getAuthToken", null, data => {
localStorage.setItem("token", data);
if (data) {
resolve(data);
} else {
console.log("调用失败");
reject("getAuthToken", data);
}
});
});
}
}
// 退出
logoutToApp() {
console.log("退出登录");
if (this.userAgent === "android") {
console.log("an");
window.android.logout();
} else {
jsBridge.callhandler("logout");
}
}
navigateBack() {
console.log("返回");
if (this.userAgent === "android") {
console.log("an");
window.android.navigateBack();
} else {
jsBridge.callhandler("navigateBack");
}
}
showBottomBar(params) {
console.log("隐藏底部");
if (this.userAgent === "android") {
console.log("an");
window.android.showBottomBar(params);
} else {
jsBridge.callhandler("showBottomBar", params);
}
}
}
// 退出
export function logoutToApp() {
jsBridge.callhandler("logout");
}
export default bridgeToAppFun;
export function getUserId() {
let userInfo = localStorage.getItem("user");
if (userInfo) {
return JSON.parse(userInfo).userId;
} else {
return "";
}
}
export function getUserAvatar() {
let userInfo = localStorage.getItem("user");
if (userInfo) {
return JSON.parse(userInfo).headImage;
} else {
return "";
}
}
......@@ -5,14 +5,13 @@ let loading = null;
const service = axios.create({
baseURL: "/shop-mall",
// baseURL: "http://192.168.204.152:8997/shop-mall",
timeout: 5000
});
service.interceptors.request.use(
config => {
const token = localStorage.getItem("token");
config.headers["Authorization"] = "Bearer " + token;
config.headers["token"] = token;
if (!config.loading) {
loading = Toast.loading({
forbidClick: true,
......@@ -23,8 +22,6 @@ service.interceptors.request.use(
},
error => {
if (loading) Toast.clear();
console.log("rqquest====错误", error);
console.log(error);
this.$toast.fail(error.response.data.error);
}
);
......
......@@ -44,7 +44,7 @@ export default {
data() {
return {
total: 0,
userPoolVos: [{ userId: "" }],
userPoolVos: [{ userId: this.$userId }],
timer: null
};
},
......@@ -55,7 +55,7 @@ export default {
queryData() {
const _this = this;
queryAerialDelivery().then(res => {
console.log(res);
console.log('空投池', res);
if (res.code === 0) {
_this.total = res.data.total;
_this.userPoolVos = res.data.userPoolVos;
......
<template>
<div class="bank">
<van-cell-group>
<van-field
v-model="form.bankName"
label="所属银行"
right-icon="arrow"
<van-cell
is-link
:value="form.bankName"
title="所属银行"
placeholder="请选择"
size="large"
readonly
@click="sheetShow = true"
/>
<van-field
v-model="form.cardNumber"
......@@ -31,15 +31,33 @@
@click="addAndEditBankInfo"
>编辑</van-button
>
<van-popup v-model="sheetShow" round position="bottom">
<van-picker
show-toolbar
title="请选择银行"
:columns="actions"
:default-index="2"
@cancel="sheetShow = false"
@confirm="onSelect"
/>
</van-popup>
<!-- <van-action-sheet v-model="sheetShow" :actions="actions" @select="onSelect" /> -->
</div>
</template>
<script>
import { getUserBankInfo, addUserBankInfo, editUserBankInfo } from "@/api/bank";
import {
getUserBankInfo,
addUserBankInfo,
editUserBankInfo,
getBankList
} from "@/api/bank";
export default {
name: "Bank",
data() {
return {
sheetShow: false,
actions: [],
form: {
bankName: "",
cardNumber: "",
......@@ -49,9 +67,21 @@ export default {
};
},
mounted() {
this.getBank();
this.getBankInfo();
},
methods: {
onSelect(item) {
this.form.bankName = item;
this.sheetShow = false;
},
getBank() {
getBankList().then(res => {
if (res.code === 0) {
this.actions = res.data;
}
});
},
addAndEditBankInfo() {
const params = this.form;
if (this.form.id) {
......@@ -86,10 +116,10 @@ export default {
},
getBankInfo() {
const params = {
userId: "13100911369"
userId: this.$userId
};
getUserBankInfo(params).then(res => {
if (res.code === 0) {
if (res.code === 0 && res.data) {
this.form = res.data;
}
});
......
......@@ -48,7 +48,7 @@ export default {
methods: {
getWithdrawal() {
const params = {
userId: "13100911369"
userId: this.$userId
};
getWithdrawalAmount(params).then(res => {
if (res.code === 0) {
......
......@@ -71,7 +71,7 @@ export default {
},
getRecordList(yearMonth) {
const params = {
userId: "13100911369",
userId: this.$userId,
yearMonth: yearMonth
};
getWithdrawalRecord(params).then(res => {
......
......@@ -5,12 +5,18 @@
</van-cell-group>
<div class="detail">
<p style="font-size: 24px">提现金额</p>
<van-field v-model="money" type="number" label="¥" class="money" />
<van-field
v-model="money"
type="number"
label="¥"
class="money"
@blur="onFillMoneyBlur"
/>
<div class="remain">
<span style="color: #666666"
>可提现金额{{ remainMoney.toFixed(2) }}</span
>
<span class="all" @click="allIn">全部提现</span>
<span v-if="remainMoney > 0" class="all" @click="allIn">全部提现</span>
</div>
<div class="real">
<p class="real-item">
......@@ -76,6 +82,7 @@
</template>
<script>
import { getWithdrawalAmount } from "@/api/wallet";
import { getUserBankInfo, sendSms, cashOut } from "@/api/bank";
import BaseDialog from "@/components/BaseDialog.vue";
export default {
......@@ -83,7 +90,7 @@ export default {
name: "CashOut",
data() {
return {
userPhone: "13100911369",
userPhone: this.$userId,
bank: "",
money: null,
remainMoney: 100,
......@@ -97,8 +104,28 @@ export default {
},
created() {
this.getUserInfo();
this.canCashOut();
},
methods: {
onFillMoneyBlur(e) {
if (e.target.value > this.remainMoney) {
this.$toast.fail("输入超过可提现金额,请重新输入");
return false;
}
},
canCashOut() {
const params = {
userId: this.$userId
};
getWithdrawalAmount(params).then(res => {
if (res.code === 0) {
this.remainMoney = res.data.currentMoneyCan;
} else {
this.remainMoney = 100;
}
});
getWithdrawalAmount;
},
jumpToBank() {
console.log("1");
this.$router.push("/bank");
......@@ -113,9 +140,12 @@ export default {
this.$toast.fail("未输入提现金额");
return;
}
if (this.money > this.remainMoney) {
this.$toast.fail("输入超过可提现金额,请重新输入");
return;
}
const params = {
userId: this.userPhone
userId: this.$userId
};
sendSms(params).then();
this.validCode = null;
......@@ -123,11 +153,15 @@ export default {
},
getUserInfo() {
const params = {
userId: "13100911369"
userId: this.$userId
};
getUserBankInfo(params).then(res => {
if (res.code === 0) {
this.bank = res.data.bankName;
if (res.data.bankName) {
this.bank = res.data.bankName;
} else {
this.bank = "";
}
}
});
},
......
......@@ -16,8 +16,9 @@
<div class="save-code">
<p>保存二维码</p>
<p>打开微信扫一扫添加客服</p>
<p>请截图保存!</p>
</div>
<van-button>保存</van-button>
<!-- <van-button>保存</van-button> -->
</div>
</div>
</div>
......@@ -42,7 +43,10 @@ export default {
this.$router.push({ name: urlName });
},
getCustomerData() {
getCustomer().then(res => {
let params = {
userId: this.$userId
};
getCustomer(params).then(res => {
if (res.code === 0) {
this.imageUrl = process.env.VUE_APP_BASE_URL + res.data;
}
......
......@@ -107,7 +107,8 @@ export default {
this.$router.push({ name: urlName });
},
getstatus() {
const userId = 13933770749;
const userId = this.$userId;
console.log(userId);
const _this = this;
getForestStatus(userId).then(res => {
if (res.code === 0) {
......
......@@ -23,7 +23,7 @@ export default {
methods: {
getAllRecord() {
const params = {
userId: "5"
userId: this.$userId
};
showIncomeRecord(params).then(res => {
if (res.code === 0) {
......
......@@ -231,7 +231,7 @@ export default {
},
getDetail() {
const params = {
userId: "13100911369"
userId: this.$userId
};
queryIncomeDetail(params).then(res => {
if (res.code === 0) {
......
......@@ -2,21 +2,12 @@
<div class="wallet">
<div class="content">
<img class="balance-img" src="@/assets/images/余额.png" alt />
<p
style="position:absolute;top:136px;width:100%;font-size:18px;color:#333333"
>
<p class="currentprofitlabel">
当月收益
</p>
<div
style="position:absolute;top:178px;width:100%"
@click="jumpToIncomeDetail"
>
<div class="currentprofit" @click="jumpToIncomeDetail">
<span class="month-income">{{ walletInfo.moneyIncome }}</span>
<img
src="@/assets/images/右箭头.png"
alt
style="width:11px;height:18px"
/>
<img src="@/assets/images/右箭头.png" alt class="month-income-arrow" />
</div>
<div class="bottom-box">
<div class="income-item">
......@@ -24,11 +15,7 @@
<p>累计收益</p>
<div @click="jumpToAll">
<span class="money">{{ walletInfo.totalIncome }}</span>
<img
src="@/assets/images/右箭头.png"
alt
style="width:8px;height:15px"
/>
<img src="@/assets/images/右箭头.png" alt class="arrow" />
</div>
</div>
<div class="income-item">
......@@ -36,11 +23,7 @@
<p>未提余额</p>
<div @click="jumpToCanCashOut">
<span class="money">{{ walletInfo.currentMoneyCan }}</span>
<img
src="@/assets/images/右箭头.png"
alt
style="width:8px;height:15px"
/>
<img src="@/assets/images/右箭头.png" alt class="arrow" />
</div>
</div>
</div>
......@@ -55,9 +38,7 @@
</template>
<script>
import { getAuthToken } from "@/utils/bridgeToAppFun";
import { getMoneyPackage } from "@/api/wallet";
export default {
name: "Wallet",
data() {
......@@ -71,13 +52,6 @@ export default {
},
mounted() {
this.getWalletInfo();
getAuthToken()
.then(res => {
console.log("success", res);
})
.catch(err => {
console.log("error", err);
});
},
methods: {
// 跳转到可提现界面
......@@ -101,7 +75,7 @@ export default {
// 获取用户钱包展示信息
getWalletInfo() {
const params = {
userId: "13100911369"
userId: this.$userId
};
getMoneyPackage(params)
.then(res => {
......@@ -122,17 +96,31 @@ export default {
<style lang="scss" scoped>
.wallet {
box-sizing: border-box;
height: 100vh;
padding: 10px 16px;
height: calc(100vh - 48px);
overflow: hidden;
padding: 15px;
box-sizing: border-box;
p {
margin: 0;
}
.content {
position: relative;
width: 345px;
height: 90%;
height: 100%;
text-align: center;
background-color: #ffffff;
.currentprofitlabel {
position: absolute;
top: 136px;
width: 100%;
font-size: 18px;
color: #333333;
}
.currentprofit {
position: absolute;
width: 100%;
top: 178px;
}
.balance-img {
position: absolute;
top: 72px;
......@@ -146,6 +134,10 @@ export default {
font-size: 28px;
color: #333333;
}
.month-income-arrow {
width: 11px;
height: 18px;
}
.bottom-box {
position: absolute;
......@@ -159,6 +151,10 @@ export default {
img {
width: 30px;
height: 29px;
&.arrow {
width: 12px;
height: 18px;
}
}
.income-item {
display: flex;
......
......@@ -5,7 +5,6 @@
</template>
<script>
import { inviteCode } from "@/api/invite";
var userId = "13933770749";
export default {
data() {
return {
......@@ -22,7 +21,7 @@ export default {
forbidClick: true,
message: "加载中..."
});
inviteCode(userId).then(res => {
inviteCode(this.$userId).then(res => {
if (loading) _this.$toast.clear();
_this.imgSrc = _this.getUserPhoto(res);
});
......
......@@ -21,7 +21,6 @@
</template>
<script>
var userId = 13100911369;
import { getMyTeam } from "@/api/grade";
export default {
name: "leagueNums",
......@@ -76,7 +75,7 @@ export default {
},
methods: {
getMyTeam() {
getMyTeam(userId).then(res => {
getMyTeam(this.$userId).then(res => {
if (res.data) {
this.list.forEach(v => {
v.num = res.data[v["field"]];
......
......@@ -2,9 +2,6 @@
<div class="modefy-avatar">
<img class="avatar" :src="avatar" alt />
<div class="btn">
<van-button type="primary" plain style="height:44px;top:11px" @click="checkBtn"
>确定</van-button
>
<van-uploader
:max-count="1"
:before-delete="onDeleteAvatar"
......@@ -12,6 +9,13 @@
>
<van-button type="primary">上传新头像</van-button>
</van-uploader>
<van-button
type="primary"
:class="!canSubmit && 'deactive-btn'"
plain
@click="checkBtn"
>确定</van-button
>
</div>
</div>
</template>
......@@ -23,21 +27,29 @@ export default {
name: "ModefyAvatar",
data() {
return {
canSubmit: false,
avatar: "",
imageUrl: ""
};
},
mounted() {
console.log("123");
if (!this.avatar) {
console.log(this.$route.query);
const headImage = this.$route.query.headImage;
if (headImage) {
this.avatar = process.env.VUE_APP_BASE_URL + headImage;
} else {
this.avatar = require("@/assets/images/no_avatar.png");
}
},
methods: {
checkBtn() {
if (!this.canSubmit) {
return;
}
this.canSubmit = false;
const params = {
headImage: this.imageUrl,
userId: "18757121665"
userId: this.$userId
};
setAvatar(params).then(res => {
if (res.code === 0) {
......@@ -57,6 +69,7 @@ export default {
uploadImage(params, fd).then(res => {
console.log(res);
this.imageUrl = res.zxUrl;
this.canSubmit = true;
});
},
onDeleteAvatar(file, detail) {
......@@ -84,7 +97,7 @@ export default {
.modefy-avatar {
box-sizing: border-box;
text-align: center;
padding-top: 115px;
padding-top: 25px;
}
.avatar {
width: 345px;
......@@ -92,11 +105,33 @@ export default {
margin-bottom: 52px;
border-radius: 4px;
}
.btn {
box-sizing: border-box;
display: flex;
justify-content: space-around;
justify-content: space-between;
align-content: center;
width: 345px;
height: 44px;
margin: 0 auto;
.van-uploader {
.van-button {
position: absolute;
top: 0;
left: 0;
}
::v-deep input {
width: 165px;
height: 44px;
}
}
.van-button {
width: 165px;
}
.deactive-btn {
color: #969595e9;
background-color: #dcd6d6;
border-color: #dcd6d6;
}
}
</style>
......@@ -20,7 +20,7 @@ export default {
methods: {
getMoment() {
const params = {
userId: "13100911369"
userId: this.$userId
};
findByUserId(params).then(res => {
console.log(res);
......
......@@ -51,7 +51,7 @@ export default {
fd.append("files", file.file);
});
fd.append("zxField", this.message);
fd.append("userId", "13100911369");
fd.append("userId", this.$userId);
uploadImage(fd).then();
},
openPopup() {
......
......@@ -9,7 +9,7 @@
>
<div class="userAvatar">
<div class="avatar-box">
<img class="avatar" src="@/assets/images/avatar.png" alt="头像" />
<img class="avatar" :src="avatar" alt="头像" />
<img class="level-img" src="@/assets/images/等级展示框.png" alt />
<span class="avatar-level">Lv.{{ userRecommendInfo.userlevel }}</span>
</div>
......@@ -88,6 +88,7 @@ export default {
},
data() {
return {
avatar: process.env.VUE_APP_BASE_URL + this.$userAvatar,
inviteeArr: [],
userRecommendInfo: {},
activeTab: "",
......@@ -159,7 +160,7 @@ export default {
},
getRecommendInfo() {
const params = {
userId: "13933770749"
userId: this.$userId
};
recomendInfo(params).then(res => {
if (res.code === 0) {
......@@ -177,7 +178,7 @@ export default {
},
getRecommendDetail(level) {
const params = {
userid: "13933770749",
userId: this.$userId,
userlevel: level
};
recommendDetail(params).then(res => {
......
......@@ -78,7 +78,7 @@ export default {
data() {
return {
form: {
userId: "",
userId: this.$userId,
sms: "",
beInvitedCode: ""
},
......
<template>
<div class="fastest-progress">
<div class="bg">
<van-icon name="arrow-left" @click="$router.go(-1)" />
<van-icon name="arrow-left" @click="handlerBack" />
<span class="title">本月进步最大奖励池</span>
<span class="award">{{ growthTotal }}</span>
</div>
......@@ -45,10 +45,36 @@ export default {
prizeVos: []
};
},
beforeRouteEnter(to, from, next) {
console.log("路由前");
try {
this.$bridgeToAppFun.showBottomBar(false);
} catch {
console.log("无法请求App");
next();
}
},
beforeRouteLeave(to, form, next) {
console.log("离开");
try {
this.$bridgeToAppFun.showBottomBar(true);
} catch {
console.log("未能和App交互");
next();
}
},
mounted() {
this.getProgressPrizes();
},
methods: {
handlerBack() {
try {
this.$bridgeToAppFun.navigateBack();
} catch {
console.log("不能和App交互");
this.$router.go(-1);
}
},
getProgressPrizes() {
const _this = this;
getProgressPrizes().then(res => {
......
......@@ -38,7 +38,7 @@
:duration="3000"
style="font-weight: bold"
></countTo>
<p style="font-size: 14px;color:#333333">
<p v-if="awardInfo" style="font-size: 14px;color:#333333">
历史累计奖金:¥{{ awardInfo.awardTotal.toFixed(2) || 0 }}
</p>
</div>
......@@ -102,7 +102,7 @@ export default {
methods: {
getData() {
const params = {
userId: "18757121665"
userId: this.$userId
};
monthRewards(params).then(res => {
if (res.code === 0) {
......
<template>
<div class="settings">
<van-cell-group class="group-1">
<van-cell title="用户名" value="135****1234" />
<van-cell title="用户名" :value="$userId" />
<van-cell is-link center title="头像" @click="onModefy">
<img
class="avatar-img"
src="@/assets/images/no_avatar.png"
alt="头像"
/>
<img class="avatar-img" :src="imgBaseUrl + avatar" alt="头像" />
</van-cell>
</van-cell-group>
<van-cell-group>
<van-cell
is-link
title="邀请人邀请码"
title="推荐人邀请码"
:value="inviteeCode"
@click="fillInviterCode"
/>
<van-cell is-link title="软件更新" value="版本v1.2" />
<van-cell is-link title="用户协议" @click="jumpToInstructions" />
</van-cell-group>
<van-button size="large" class="logout-btn" @click="logout"
>退出登录</van-button
>
<a href="redirect://xts.com/login_activity?hideBack=true">
<van-button size="large" class="logout-btn" @click="logout"
>退出登录</van-button
>
</a>
<base-dialog
base-dialog-title="推荐人邀请码"
......@@ -46,6 +45,7 @@
</template>
<script>
import { getUserInfo2 } from "@/api/user";
import { logoutToApp } from "@/utils/bridgeToAppFun";
import { logout } from "@/api/user";
import { fillInviteCode } from "@/api/user";
......@@ -55,25 +55,49 @@ export default {
name: "Settings",
data() {
return {
imgBaseUrl: "",
avatar: "",
fileList: [],
fillCode: "",
inviteeCode: "未填写",
inviteeCodeDialog: false
};
},
mounted() {
this.imgBaseUrl = process.env.VUE_APP_BASE_URL;
this.getUser();
},
methods: {
logout() {
getUser() {
const params = {
token: "qwedskdljlkjlklkjlkjlkjl"
userId: this.$userId
};
logout(params).then();
console.log("setting-userId", params);
getUserInfo2(params).then(res => {
if (res.userId) {
localStorage.setItem("user", JSON.stringify(res));
this.$nextTick(() => {
this.inviteeCode = res.inviteCode;
this.avatar = res.headImage;
});
}
});
},
logout() {
localStorage.removeItem("token");
logout().then();
logoutToApp();
},
jumpToInstructions() {
this.$router.push("/instructions");
},
onModefy() {
this.$router.push("/modefy-avatar");
this.$router.push({
path: "/modefy-avatar",
query: {
headImage: this.avatar
}
});
},
onCloseDialog() {
this.inviteeCodeDialog = false;
......@@ -83,7 +107,7 @@ export default {
this.inviteeCode = this.fillCode;
const params = {
inviteCode: this.fillCode,
userId: "18757121665"
userId: this.$userId
};
fillInviteCode(params).then();
},
......
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