|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="intro">登录</div>
|
|
|
- <b-notification type="is-danger" :active.sync="isServerError">
|
|
|
+ <!-- <b-notification type="is-danger" :active.sync="isServerError">
|
|
|
{{ errorMassage }}
|
|
|
</b-notification>
|
|
|
<b-field
|
|
|
@@ -28,7 +28,7 @@
|
|
|
password-reveal
|
|
|
>
|
|
|
</b-input>
|
|
|
- </b-field>
|
|
|
+ </b-field> -->
|
|
|
<!--<p class="control level" style="padding-top: 20px">-->
|
|
|
<div style="padding-top: 40px;">
|
|
|
<button
|
|
|
@@ -54,10 +54,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { required, email } from "vuelidate/lib/validators";
|
|
|
-import { login } from "@/api/auth";
|
|
|
-import { SET_PROFILE } from "@/store/type/mutations.type";
|
|
|
-import { destroyToken, saveToken } from "@/util/tokenStorage";
|
|
|
-import { HOME } from "@/router/name";
|
|
|
+// import { login } from "@/api/auth";
|
|
|
+// import { SET_PROFILE } from "@/store/type/mutations.type";
|
|
|
+// import { destroyToken, saveToken } from "@/util/tokenStorage";
|
|
|
+// import { HOME } from "@/router/name";
|
|
|
+import { destroyToken } from "@/util/tokenStorage";
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -83,27 +84,30 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async loginAction() {
|
|
|
- if (this.submitting) return;
|
|
|
+ window.location = `http://p.seecoder.cn/api/interaction?scope=openid&client_id=seec-seec&redirect_uri=${encodeURI(
|
|
|
+ "http://seec.seecoder.cn/api/auth/receive"
|
|
|
+ )}`;
|
|
|
+ // if (this.submitting) return;
|
|
|
|
|
|
- this.isServerError = false;
|
|
|
- this.$v.$touch();
|
|
|
- if (!this.$v.$invalid) {
|
|
|
- const { username = "", password = "" } = this;
|
|
|
- try {
|
|
|
- this.submitting = true;
|
|
|
- const {
|
|
|
- data,
|
|
|
- _header: { Authorization }
|
|
|
- } = await login({ username, password });
|
|
|
- saveToken(Authorization);
|
|
|
- this.$store.commit(SET_PROFILE, data);
|
|
|
- this.$router.push({ name: HOME });
|
|
|
- } catch (e) {
|
|
|
- this.errorMassage = e.message || "登录失败";
|
|
|
- this.isServerError = true;
|
|
|
- this.submitting = false;
|
|
|
- }
|
|
|
- }
|
|
|
+ // this.isServerError = false;
|
|
|
+ // this.$v.$touch();
|
|
|
+ // if (!this.$v.$invalid) {
|
|
|
+ // const { username = "", password = "" } = this;
|
|
|
+ // try {
|
|
|
+ // this.submitting = true;
|
|
|
+ // const {
|
|
|
+ // data,
|
|
|
+ // _header: { Authorization }
|
|
|
+ // } = await login({ username, password });
|
|
|
+ // saveToken(Authorization);
|
|
|
+ // this.$store.commit(SET_PROFILE, data);
|
|
|
+ // this.$router.push({ name: HOME });
|
|
|
+ // } catch (e) {
|
|
|
+ // this.errorMassage = e.message || "登录失败";
|
|
|
+ // this.isServerError = true;
|
|
|
+ // this.submitting = false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
};
|