|
@@ -91,7 +91,7 @@
|
|
|
</div>
|
|
|
<!-- 开始体验 -->
|
|
|
<div v-if="isLogin" class="tiyan" @click="toindex">立即登录</div>
|
|
|
- <div v-else class="tiyan">开始体验</div>
|
|
|
+ <div v-else class="tiyan" @click="register">开始体验</div>
|
|
|
</div>
|
|
|
<div class="bottom_line"></div>
|
|
|
<div class="bottom_login">
|
|
@@ -137,7 +137,7 @@ const __topic__ = async () => {
|
|
|
try {
|
|
|
const { data } = await loginApi.login({
|
|
|
mobile: phone.value,
|
|
|
- password: 123456,
|
|
|
+ code:code.value,
|
|
|
});
|
|
|
if (route.query.index) {
|
|
|
router.go(-1);
|
|
@@ -147,10 +147,6 @@ const __topic__ = async () => {
|
|
|
});
|
|
|
}
|
|
|
localStorage.setItem("access_token", JSON.stringify(data.token));
|
|
|
- router.push({
|
|
|
- name: "home",
|
|
|
- });
|
|
|
- localStorage.setItem("access_token", JSON.stringify(data.token));
|
|
|
localStorage.setItem("userInfo", JSON.stringify(data));
|
|
|
localStorage.setItem("USER_STORE", JSON.stringify(data));
|
|
|
} catch (error) {}
|
|
@@ -160,7 +156,7 @@ const getQrCode = () => {
|
|
|
loginApi
|
|
|
.getCode({
|
|
|
mobile: phone.value,
|
|
|
- type: "register",
|
|
|
+ type: isLogin ? "login" : "register",
|
|
|
})
|
|
|
.then((res) => {
|
|
|
console.log(res);
|
|
@@ -185,6 +181,36 @@ const toindex = () => {
|
|
|
__topic__();
|
|
|
}
|
|
|
};
|
|
|
+//注册
|
|
|
+const register = () => {
|
|
|
+ if (checked1.value == "") {
|
|
|
+ ElMessage({
|
|
|
+ message: "请勾选协议",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ __register__();
|
|
|
+ }
|
|
|
+};
|
|
|
+//注册接口
|
|
|
+const __register__ = async () => {
|
|
|
+ try {
|
|
|
+ const { data } = await loginApi.code_register({
|
|
|
+ mobile: phone.value,
|
|
|
+ code:code.value,
|
|
|
+ });
|
|
|
+ if (route.query.index) {
|
|
|
+ router.go(-1);
|
|
|
+ } else {
|
|
|
+ router.push({
|
|
|
+ name: "home",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ localStorage.setItem("access_token", JSON.stringify(data.token));
|
|
|
+ localStorage.setItem("userInfo", JSON.stringify(data));
|
|
|
+ localStorage.setItem("USER_STORE", JSON.stringify(data));
|
|
|
+ } catch (error) {}
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.image {
|