|
|
@ -1,19 +1,9 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view class="register absolute"> |
|
|
|
<view class="register absolute"> |
|
|
|
<view class="shading"> |
|
|
|
|
|
|
|
<view class="pictrue acea-row row-center-wrapper"> |
|
|
|
|
|
|
|
<image src="@/static/images/logo.png" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="whiteBg" v-if="formItem === 1"> |
|
|
|
<view class="whiteBg" v-if="formItem === 1"> |
|
|
|
<view class="title acea-row row-center-wrapper"> |
|
|
|
<view class="title acea-row row-between-wrapper"> |
|
|
|
<view |
|
|
|
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" |
|
|
|
class="item" |
|
|
|
@click="navTap(index)" :key="index">{{ item }}</view> |
|
|
|
:class="current === index ? 'on' : ''" |
|
|
|
|
|
|
|
v-for="(item, index) in navList" |
|
|
|
|
|
|
|
@click="navTap(index)" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
>{{ item }}</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list" :hidden="current !== 0"> |
|
|
|
<view class="list" :hidden="current !== 0"> |
|
|
|
<form @submit.prevent="submit"> |
|
|
|
<form @submit.prevent="submit"> |
|
|
@ -50,12 +40,8 @@ |
|
|
|
<use xlink:href="#icon-code_1" /> |
|
|
|
<use xlink:href="#icon-code_1" /> |
|
|
|
</svg>--> |
|
|
|
</svg>--> |
|
|
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> |
|
|
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> |
|
|
|
<button |
|
|
|
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" |
|
|
|
class="code" |
|
|
|
@click="code">{{ text }}</button> |
|
|
|
:disabled="disabled" |
|
|
|
|
|
|
|
:class="disabled === true ? 'on' : ''" |
|
|
|
|
|
|
|
@click="code" |
|
|
|
|
|
|
|
>{{ text }}</button> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -67,7 +53,9 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="whiteBg" v-else> |
|
|
|
<view class="whiteBg" v-else> |
|
|
|
<view class="title">注册账号</view> |
|
|
|
<view class="title acea-row row-between-wrapper"> |
|
|
|
|
|
|
|
<view class="item on">注册账号</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="list"> |
|
|
|
<view class="list"> |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
|
<view> |
|
|
|
<view> |
|
|
@ -83,12 +71,8 @@ |
|
|
|
<use xlink:href="#icon-code_1" /> |
|
|
|
<use xlink:href="#icon-code_1" /> |
|
|
|
</svg>--> |
|
|
|
</svg>--> |
|
|
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> |
|
|
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> |
|
|
|
<button |
|
|
|
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" |
|
|
|
class="code" |
|
|
|
@click="code">{{ text }}</button> |
|
|
|
:disabled="disabled" |
|
|
|
|
|
|
|
:class="disabled === true ? 'on' : ''" |
|
|
|
|
|
|
|
@click="code" |
|
|
|
|
|
|
|
>{{ text }}</button> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
@ -99,6 +83,7 @@ |
|
|
|
<input type="password" placeholder="填写您的登录密码" v-model="password" /> |
|
|
|
<input type="password" placeholder="填写您的登录密码" v-model="password" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- #ifndef H5 --> |
|
|
|
<view class="item"> |
|
|
|
<view class="item"> |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
<!-- <svg class="icon" aria-hidden="true"> |
|
|
|
<!-- <svg class="icon" aria-hidden="true"> |
|
|
@ -107,6 +92,8 @@ |
|
|
|
<input type="text" placeholder="输入邀请码" v-model="inviteCode" /> |
|
|
|
<input type="text" placeholder="输入邀请码" v-model="inviteCode" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="logon" @click="register">注册</view> |
|
|
|
<view class="logon" @click="register">注册</view> |
|
|
|
<view class="tip"> |
|
|
|
<view class="tip"> |
|
|
@ -114,216 +101,242 @@ |
|
|
|
<text @click="formItem = 1" class="font-color-red">立即登录</text> |
|
|
|
<text @click="formItem = 1" class="font-color-red">立即登录</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="bottom"></view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import sendVerifyCode from "@/mixins/SendVerifyCode"; |
|
|
|
import sendVerifyCode from "@/mixins/SendVerifyCode"; |
|
|
|
import { login, loginMobile, registerVerify, register } from "@/api/user"; |
|
|
|
import { |
|
|
|
import attrs, { required, alpha_num, chs_phone } from "@/utils/validate"; |
|
|
|
login, |
|
|
|
import { validatorDefaultCatch } from "@/utils/dialog"; |
|
|
|
loginMobile, |
|
|
|
import dayjs from "dayjs"; |
|
|
|
registerVerify, |
|
|
|
import cookie from "@/utils/store/cookie"; |
|
|
|
register |
|
|
|
|
|
|
|
} from "@/api/user"; |
|
|
|
|
|
|
|
import attrs, { |
|
|
|
|
|
|
|
required, |
|
|
|
|
|
|
|
alpha_num, |
|
|
|
|
|
|
|
chs_phone |
|
|
|
|
|
|
|
} from "@/utils/validate"; |
|
|
|
|
|
|
|
import { |
|
|
|
|
|
|
|
validatorDefaultCatch |
|
|
|
|
|
|
|
} from "@/utils/dialog"; |
|
|
|
|
|
|
|
import dayjs from "dayjs"; |
|
|
|
|
|
|
|
import cookie from "@/utils/store/cookie"; |
|
|
|
|
|
|
|
|
|
|
|
import { handleGetUserInfo } from "@/utils"; |
|
|
|
import { |
|
|
|
|
|
|
|
handleGetUserInfo |
|
|
|
|
|
|
|
} from "@/utils"; |
|
|
|
|
|
|
|
|
|
|
|
const BACK_URL = "login_back_url"; |
|
|
|
const BACK_URL = "login_back_url"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "Login", |
|
|
|
name: "Login", |
|
|
|
mixins: [sendVerifyCode], |
|
|
|
mixins: [sendVerifyCode], |
|
|
|
data: function() { |
|
|
|
data: function () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
navList: ["账号登录"], |
|
|
|
navList: ["账号登录"], |
|
|
|
current: 0, |
|
|
|
current: 0, |
|
|
|
account: "", |
|
|
|
account: "", |
|
|
|
password: "", |
|
|
|
password: "", |
|
|
|
captcha: "", |
|
|
|
captcha: "", |
|
|
|
inviteCode: "", |
|
|
|
inviteCode: "", |
|
|
|
formItem: 1, |
|
|
|
formItem: 1, |
|
|
|
type: "login" |
|
|
|
type: "login" |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
async loginMobile() { |
|
|
|
async loginMobile() { |
|
|
|
var that = this; |
|
|
|
var that = this; |
|
|
|
const { account, captcha } = that; |
|
|
|
const { |
|
|
|
try { |
|
|
|
account, |
|
|
|
await that |
|
|
|
captcha |
|
|
|
.$validator({ |
|
|
|
} = that; |
|
|
|
account: [ |
|
|
|
try { |
|
|
|
required(required.message("手机号码")), |
|
|
|
await that |
|
|
|
chs_phone(chs_phone.message()) |
|
|
|
.$validator({ |
|
|
|
], |
|
|
|
account: [ |
|
|
|
captcha: [ |
|
|
|
required(required.message("手机号码")), |
|
|
|
required(required.message("验证码")), |
|
|
|
chs_phone(chs_phone.message()) |
|
|
|
alpha_num(alpha_num.message("验证码")) |
|
|
|
], |
|
|
|
] |
|
|
|
captcha: [ |
|
|
|
|
|
|
|
required(required.message("验证码")), |
|
|
|
|
|
|
|
alpha_num(alpha_num.message("验证码")) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.validate({ |
|
|
|
|
|
|
|
account, |
|
|
|
|
|
|
|
captcha |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
return validatorDefaultCatch(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
loginMobile({ |
|
|
|
|
|
|
|
phone: that.account, |
|
|
|
|
|
|
|
captcha: that.captcha, |
|
|
|
|
|
|
|
spread: cookie.get("spread") |
|
|
|
}) |
|
|
|
}) |
|
|
|
.validate({ |
|
|
|
.then(res => { |
|
|
|
account, |
|
|
|
var data = res.data; |
|
|
|
captcha |
|
|
|
that.$store.commit("login", data.token, dayjs(data.expires_time)); |
|
|
|
|
|
|
|
handleGetUserInfo(); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
}, |
|
|
|
return validatorDefaultCatch(e); |
|
|
|
async register() { |
|
|
|
} |
|
|
|
var that = this; |
|
|
|
loginMobile({ |
|
|
|
const { |
|
|
|
phone: that.account, |
|
|
|
account, |
|
|
|
captcha: that.captcha, |
|
|
|
captcha, |
|
|
|
spread: cookie.get("spread") |
|
|
|
password |
|
|
|
}) |
|
|
|
} = that; |
|
|
|
.then(res => { |
|
|
|
try { |
|
|
|
var data = res.data; |
|
|
|
await that |
|
|
|
that.$store.commit("login", data.token, dayjs(data.expires_time)); |
|
|
|
.$validator({ |
|
|
|
handleGetUserInfo(); |
|
|
|
account: [ |
|
|
|
}) |
|
|
|
required(required.message("手机号码")), |
|
|
|
.catch(err => { |
|
|
|
chs_phone(chs_phone.message()) |
|
|
|
uni.showToast({ |
|
|
|
], |
|
|
|
title: err.msg || err.response.data.msg|| err.response.data.message, |
|
|
|
captcha: [ |
|
|
|
icon: "none", |
|
|
|
required(required.message("验证码")), |
|
|
|
duration: 2000 |
|
|
|
alpha_num(alpha_num.message("验证码")) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
password: [ |
|
|
|
|
|
|
|
required(required.message("密码")), |
|
|
|
|
|
|
|
attrs.range([6, 16], attrs.range.message("密码")), |
|
|
|
|
|
|
|
alpha_num(alpha_num.message("密码")) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.validate({ |
|
|
|
|
|
|
|
account, |
|
|
|
|
|
|
|
captcha, |
|
|
|
|
|
|
|
password |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
return validatorDefaultCatch(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
register({ |
|
|
|
|
|
|
|
account: that.account, |
|
|
|
|
|
|
|
captcha: that.captcha, |
|
|
|
|
|
|
|
password: that.password, |
|
|
|
|
|
|
|
inviteCode: that.inviteCode, |
|
|
|
|
|
|
|
spread: cookie.get("spread") |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.msg, |
|
|
|
|
|
|
|
icon: "success", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
that.formItem = 1; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
async code() { |
|
|
|
async register() { |
|
|
|
var that = this; |
|
|
|
var that = this; |
|
|
|
const { |
|
|
|
const { account, captcha, password } = that; |
|
|
|
account |
|
|
|
try { |
|
|
|
} = that; |
|
|
|
await that |
|
|
|
try { |
|
|
|
.$validator({ |
|
|
|
await that |
|
|
|
|
|
|
|
.$validator({ |
|
|
|
|
|
|
|
account: [ |
|
|
|
|
|
|
|
required(required.message("手机号码")), |
|
|
|
|
|
|
|
chs_phone(chs_phone.message()) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.validate({ |
|
|
|
|
|
|
|
account |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
return validatorDefaultCatch(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (that.formItem == 2) that.type = "register"; |
|
|
|
|
|
|
|
await registerVerify({ |
|
|
|
|
|
|
|
phone: that.account, |
|
|
|
|
|
|
|
type: that.type |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.msg, |
|
|
|
|
|
|
|
icon: "success", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
that.sendCode(); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
navTap: function (index) { |
|
|
|
|
|
|
|
this.current = index; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async submit() { |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
account, |
|
|
|
|
|
|
|
password |
|
|
|
|
|
|
|
} = this; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$validator({ |
|
|
|
account: [ |
|
|
|
account: [ |
|
|
|
required(required.message("手机号码")), |
|
|
|
required(required.message("账号")), |
|
|
|
chs_phone(chs_phone.message()) |
|
|
|
attrs.range([5, 16], attrs.range.message("账号")), |
|
|
|
], |
|
|
|
alpha_num(alpha_num.message("账号")) |
|
|
|
captcha: [ |
|
|
|
|
|
|
|
required(required.message("验证码")), |
|
|
|
|
|
|
|
alpha_num(alpha_num.message("验证码")) |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
password: [ |
|
|
|
password: [ |
|
|
|
required(required.message("密码")), |
|
|
|
required(required.message("密码")), |
|
|
|
attrs.range([6, 16], attrs.range.message("密码")), |
|
|
|
attrs.range([6, 16], attrs.range.message("密码")), |
|
|
|
alpha_num(alpha_num.message("密码")) |
|
|
|
alpha_num(alpha_num.message("密码")) |
|
|
|
] |
|
|
|
] |
|
|
|
}) |
|
|
|
}).validate({ |
|
|
|
.validate({ |
|
|
|
|
|
|
|
account, |
|
|
|
account, |
|
|
|
captcha, |
|
|
|
|
|
|
|
password |
|
|
|
password |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
return validatorDefaultCatch(e); |
|
|
|
return validatorDefaultCatch(e); |
|
|
|
} |
|
|
|
} |
|
|
|
register({ |
|
|
|
|
|
|
|
account: that.account, |
|
|
|
|
|
|
|
captcha: that.captcha, |
|
|
|
|
|
|
|
password: that.password, |
|
|
|
|
|
|
|
inviteCode: that.inviteCode, |
|
|
|
|
|
|
|
spread: cookie.get("spread") |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.msg, |
|
|
|
|
|
|
|
icon: "success", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
that.formItem = 1; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: err.msg || err.response.data.msg|| err.response.data.message, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async code() { |
|
|
|
|
|
|
|
var that = this; |
|
|
|
|
|
|
|
const { account } = that; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await that |
|
|
|
|
|
|
|
.$validator({ |
|
|
|
|
|
|
|
account: [ |
|
|
|
|
|
|
|
required(required.message("手机号码")), |
|
|
|
|
|
|
|
chs_phone(chs_phone.message()) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.validate({ |
|
|
|
|
|
|
|
account |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
return validatorDefaultCatch(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (that.formItem == 2) that.type = "register"; |
|
|
|
|
|
|
|
await registerVerify({ |
|
|
|
|
|
|
|
phone: that.account, |
|
|
|
|
|
|
|
type: that.type |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.msg, |
|
|
|
|
|
|
|
icon: "success", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
that.sendCode(); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: err.msg || err.response.data.msg|| err.response.data.message, |
|
|
|
|
|
|
|
icon: "none", |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
navTap: function(index) { |
|
|
|
|
|
|
|
this.current = index; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async submit() { |
|
|
|
|
|
|
|
const { account, password } = this; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$validator({ |
|
|
|
|
|
|
|
account: [ |
|
|
|
|
|
|
|
required(required.message("账号")), |
|
|
|
|
|
|
|
attrs.range([5, 16], attrs.range.message("账号")), |
|
|
|
|
|
|
|
alpha_num(alpha_num.message("账号")) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
password: [ |
|
|
|
|
|
|
|
required(required.message("密码")), |
|
|
|
|
|
|
|
attrs.range([6, 16], attrs.range.message("密码")), |
|
|
|
|
|
|
|
alpha_num(alpha_num.message("密码")) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}).validate({ |
|
|
|
|
|
|
|
account, |
|
|
|
|
|
|
|
password |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
return validatorDefaultCatch(e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
login({ |
|
|
|
login({ |
|
|
|
username: account, |
|
|
|
username: account, |
|
|
|
password, |
|
|
|
password, |
|
|
|
spread: cookie.get("spread") |
|
|
|
spread: cookie.get("spread") |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(({ data }) => { |
|
|
|
.then(({ |
|
|
|
this.$store.commit("login", data.token, dayjs(data.expires_time)); |
|
|
|
data |
|
|
|
handleGetUserInfo(); |
|
|
|
}) => { |
|
|
|
// let replace=this.$yroute.query.replace |
|
|
|
this.$store.commit("login", data.token, dayjs(data.expires_time)); |
|
|
|
// if(replace){ |
|
|
|
handleGetUserInfo(); |
|
|
|
|
|
|
|
// let replace=this.$yroute.query.replace |
|
|
|
|
|
|
|
// if(replace){ |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.$yrouter.replace({ |
|
|
|
// this.$yrouter.replace({ |
|
|
|
// path: this.$yroute.query.replace || '/pages/home/index' |
|
|
|
// path: this.$yroute.query.replace || '/pages/home/index' |
|
|
|
// }); |
|
|
|
// }); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
|
console.log(err); |
|
|
|
console.log(err); |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: err.msg || err.response.data.msg|| err.response.data.message, |
|
|
|
title: err.msg || err.response.data.msg || err.response.data.message, |
|
|
|
icon: "none", |
|
|
|
icon: "none", |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
</script> |
|
|
|
</script> |
|
|
|