|
@@ -35,7 +35,7 @@
|
|
|
/>
|
|
|
</svg>
|
|
|
</el-input>
|
|
|
- <el-input placeholder="密码" type="password" autocomplete="off" v-model="password">
|
|
|
+ <el-input placeholder="密码" type="password" autocomplete="off" v-model="password">
|
|
|
<svg
|
|
|
class="loginInputIcon"
|
|
|
slot="prefix"
|
|
@@ -120,19 +120,35 @@ export default {
|
|
|
this.$message.info("请输入密码");
|
|
|
return false;
|
|
|
}
|
|
|
- // 登录校验成功后
|
|
|
- if (this.RememberYourPassword) {
|
|
|
- localStorage.setItem("RememberYourPassword", true);
|
|
|
- localStorage.setItem("_USER_NAME", this.userName);
|
|
|
- localStorage.setItem("_PASSWORD", publicFun.Encrypt(this.password));
|
|
|
- }
|
|
|
- this.$router.push("/");
|
|
|
- const h = this.$createElement;
|
|
|
-
|
|
|
- this.$notify({
|
|
|
- title: "登录成功",
|
|
|
- message: h("i", { style: "color: teal" }, this.userName + ",欢迎回来!")
|
|
|
- });
|
|
|
+ let param = new FormData();
|
|
|
+ param.append("userName", this.userName);
|
|
|
+ param.append("password", this.password);
|
|
|
+ param.append("clientId", "1");
|
|
|
+ this.$Post("/oauth/user/login", param).then(
|
|
|
+ res => {
|
|
|
+ // 登录成功
|
|
|
+ if (res.code == 200) {
|
|
|
+ // 登录校验成功后
|
|
|
+ if (this.RememberYourPassword) {
|
|
|
+ localStorage.setItem("RememberYourPassword", true);
|
|
|
+ localStorage.setItem("_USER_NAME", this.userName);
|
|
|
+ localStorage.setItem("_PASSWORD", publicFun.Encrypt(this.password));
|
|
|
+ }
|
|
|
+ localStorage.setItem("TOKEN", res.message);
|
|
|
+ this.$router.push("/");
|
|
|
+ const h = this.$createElement;
|
|
|
+ this.$notify({
|
|
|
+ title: "登录成功",
|
|
|
+ message: h("i", { style: "color: teal" }, this.userName + ",欢迎回来!")
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
forgetYouPassword() {
|
|
|
this.$message.info("正在开发中,敬请期待!");
|