|
@@ -29,7 +29,7 @@
|
|
密码
|
|
密码
|
|
<div class="input-container">
|
|
<div class="input-container">
|
|
<input
|
|
<input
|
|
- type="text"
|
|
|
|
|
|
+ type="password"
|
|
placeholder="请输入密码"
|
|
placeholder="请输入密码"
|
|
class="input"
|
|
class="input"
|
|
v-model="password"
|
|
v-model="password"
|
|
@@ -42,6 +42,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { mapActions } from "vuex";
|
|
import { mapActions } from "vuex";
|
|
|
|
+import axios from "axios";
|
|
export default {
|
|
export default {
|
|
name: "loginPage",
|
|
name: "loginPage",
|
|
data() {
|
|
data() {
|
|
@@ -50,7 +51,7 @@ export default {
|
|
account: "",
|
|
account: "",
|
|
password: "",
|
|
password: "",
|
|
loading: false,
|
|
loading: false,
|
|
- redirect:this.$route.query['redirect']
|
|
|
|
|
|
+ redirect: this.$route.query["redirect"],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -70,15 +71,25 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let orgValue = this.org ? "@" + this.org : "@cocorobo.cc";
|
|
|
|
+ let email = "";
|
|
|
|
+ const regEmail = new RegExp("^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$");
|
|
|
|
+ let str = this.account.replace(/(^\s*)|(\s*$)/g, "");
|
|
|
|
+ if (!regEmail.test(str)) {
|
|
|
|
+ email = str + orgValue;
|
|
|
|
+ } else {
|
|
|
|
+ email = str;
|
|
|
|
+ }
|
|
let params = {
|
|
let params = {
|
|
geetest_challenge: "",
|
|
geetest_challenge: "",
|
|
geetest_validate: "",
|
|
geetest_validate: "",
|
|
geetest_seccode: "",
|
|
geetest_seccode: "",
|
|
- loginUsername: this.account.trim(),
|
|
|
|
|
|
+ loginUsername: email.trim(),
|
|
loginPassword: window.btoa(this.password.trim()),
|
|
loginPassword: window.btoa(this.password.trim()),
|
|
};
|
|
};
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- this.$ajax
|
|
|
|
|
|
+ axios.defaults.withCredentials = true;
|
|
|
|
+ axios
|
|
.post("https://beta.api.cocorobo.cn/api/user", params)
|
|
.post("https://beta.api.cocorobo.cn/api/user", params)
|
|
.then(async (res) => {
|
|
.then(async (res) => {
|
|
console.log("res", res);
|
|
console.log("res", res);
|
|
@@ -117,7 +128,7 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getLoading();
|
|
|
|
|
|
+ // this.getLoading();
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|