From 1b0134f57814e12265f2c94fe4a89c7763a7d336 Mon Sep 17 00:00:00 2001
From: mch <1332099529@qq.com>
Date: Tue, 12 Sep 2023 17:00:20 +0800
Subject: [PATCH] 1
---
src/views/common-settings/ItemType.vue | 4 +
src/views/login/Login.vue | 197 +------------------------
src/views/user-list/UserList.vue | 5 +-
3 files changed, 13 insertions(+), 193 deletions(-)
diff --git a/src/views/common-settings/ItemType.vue b/src/views/common-settings/ItemType.vue
index f3efa6c..871f484 100644
--- a/src/views/common-settings/ItemType.vue
+++ b/src/views/common-settings/ItemType.vue
@@ -64,6 +64,10 @@
width="40%"
:close-on-click-modal="false"
>
+
-
+
@@ -67,10 +67,6 @@ export default {
onSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
- // let res = await getapi("/api/identity/users/login", {
- // username: this.form.Username,
- // password: this.form.Password,11
- // });
var msgs = "";
postapi(`/api/identity/users/login`, {
userName: this.form.Username,
@@ -96,191 +92,14 @@ export default {
}
console.log(res, "res");
- // if (res.code != -1 && res.data.code == 1) {
- // window.sessionStorage.setItem("peisid", res.data.peisid); //设置当前人员所属体检中心
-
- // return this.$axios.post(
- // mm.apiurl + "/connect/token",
- // {
- // client_id: "Peis_App",
- // grant_type: "password",
- // username: this.form.Username,
- // password: this.form.Password,
- // scope: "Peis offline_access",
- // },
- // {
- // headers: {
- // "Content-Type": "application/x-www-form-urlencoded",
- // },
- // }
- // );
- // } else {
- // this.$message.warning(ret.data.msg);
- // }
})
- // .then((res) => {
- // writetoken(res.data.expires_in);
- // window.localStorage.setItem("token", res.data.access_token);
- // window.localStorage.setItem(
- // "refresh_token",
- // res.data.refresh_token
- // );
- // window.localStorage.setItem("tokentype", res.data.token_type);
- // window.localStorage.setItem("user", this.form.Username);
- // this.$router.push({ path: "home" });
- // this.$store.state.changepassword = this.form.Password;
- // })
.catch((err) => {});
-
- // console.log(res);
- // if (res.data.code == 1 && res.code == 1) {
- // console.log(res.data.msg);
- // postapi()
- // let ress = await this.$axios.post(
- // mm.apiurl + "/connect/token",
- // {
- // client_id: "Peis_App",
- // grant_type: "password",
- // username: this.form.Username,
- // password: this.form.Password,
- // scope: "Peis offline_access",
- // },
- // {
- // headers: {
- // "Content-Type": "application/x-www-form-urlencoded",
- // },
- // }
- // );
- // if (ress.status == 200) {
- // writetoken(ress.data.expires_in);
- // window.localStorage.setItem("token", ress.data.access_token);
- // window.localStorage.setItem(
- // "refresh_token",
- // ress.data.refresh_token
- // );
- // window.localStorage.setItem("tokentype", ress.data.token_type);
- // window.localStorage.setItem("user", this.form.Username);
- // this.$message.success(res.data.msg, "登录成功");
- // this.$router.push({ path: "home" });
- // }
- // } else {
- // console.log();
- // this.$message.warning(res.data.msg);
- // }
- // } catch (err) {
- // console.log(err);
- // }
-
- // await getapi("/api/identity/users/login", {
- // username: this.form.Username,
- // password: this.form.Password,
- // }).then((ress) => {
- // if (ress.data.code == 1 && ress.code == 1) {
- // // console.log(msg);
- // postapi(mm.apiurl + "/connect/token", {
- // client_id: "Peis_App",
- // grant_type: "password",
- // username: this.form.Username,
- // password: this.form.Password,
- // scope: "Peis offline_access",
- // }).then((res) => {
- // console.log(res);
-
- // writetoken(res.data.expires_in);
- // window.localStorage.setItem("token", res.data.access_token);
- // window.localStorage.setItem(
- // "refresh_token",
- // res.data.refresh_token
- // );
- // window.localStorage.setItem("tokentype", res.data.token_type);
- // window.localStorage.setItem("user", this.form.Username);
- // this.$message.success("登录成功");
- // this.$router.push({ path: "home" });
-
- // this.$store.state.changepassword = this.form.Password;
- // });
- // } else {
- // this.$message.warning(res.data.msg);
- // }
- // });
-
- // this.$axios
- // .post(
- // mm.apiurl + "/connect/token",
- // {
- // client_id: "Peis_App",
- // grant_type: "password",
- // username: this.form.Username, //admin
- // password: this.form.Password, //1q2w3E
- // scope: "Peis offline_access",
- // },
- // {
- // headers: {
- // "Content-Type": "application/x-www-form-urlencoded",
- // },
- // }
- // )
- // .then((res) => {
- // console.log(res, "222222");
-
- // if (res.status == 200) {
- // //console.log(res.data)
- // writetoken(res.data.expires_in);
- // window.localStorage.setItem("token", res.data.access_token);
- // window.localStorage.setItem(
- // "refresh_token",
- // res.data.refresh_token
- // );
- // // window.localStorage.setItem("expires_in", res.data.expires_in);
- // window.localStorage.setItem("tokentype", res.data.token_type);
- // window.localStorage.setItem("user", this.form.Username);
- // this.$message.success("登录成功");
- // this.$router.push({ path: "home" });
- // // this.$store.dispatch('changepassword',this.form.Password)
- // this.$store.state.changepassword = this.form.Password;
- // } else {
- // this.$message.warning("用户名或密码错误");
- // }
- // });
}
});
},
- tuichui() {
- let token = localStorage.getItem("token");
- let tokentype = localStorage.getItem("tokentype");
- this.$axios
- .get("http://192.168.1.108:44394/api/identity/users", {
- params: {
- SkipCount: 1,
- MaxResultCount: 1,
- },
- headers: {
- Authorization: `${tokentype} ${token}`,
- },
- })
- .then((res) => {
- console.log(res);
- });
- },
- users() {
- this.$axios.put(
- "http://192.168.1.108:44394/api/permission-management/permissions",
- {
- providerName: "R",
- providerKey: "sdsaf",
- }
- );
- },
- },
- created() {
- // let date = moment();
- // date.add(3600, 's');
- // console.log(parseInt(new Date(date).getTime() / 1000) + '')
- // // console.log(this.$moment);
- // console.log('33');
- // console.log(parseInt(new Date().getTime() / 1000) + '');
},
+ created() {},
};