|
|
|
@ -28,9 +28,9 @@ |
|
|
|
prefix-icon="el-icon-unlock" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<button type="primary" class="btn" @click="onSubmit(form)"> |
|
|
|
<el-button type="primary" class="btn" @click="onSubmit(form)"> |
|
|
|
用户登录 |
|
|
|
</button> |
|
|
|
</el-button> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -65,12 +65,9 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
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 +93,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() {}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
@ -323,7 +143,12 @@ export default { |
|
|
|
width: 100%; |
|
|
|
min-height: 100vh; |
|
|
|
} |
|
|
|
|
|
|
|
.el-form-item.is-error .el-input__inner { |
|
|
|
color: none; |
|
|
|
} |
|
|
|
.inputcolor { |
|
|
|
border: none; |
|
|
|
} |
|
|
|
.box { |
|
|
|
width: 400px; |
|
|
|
height: 300px; |
|
|
|
@ -331,7 +156,7 @@ export default { |
|
|
|
// background: #fff; |
|
|
|
// background: rgb(185, 251, 211); |
|
|
|
// box-shadow: 0 6px #99907e; |
|
|
|
// background: rgba(186, 251, 185, 1); |
|
|
|
// background: #fff; |
|
|
|
// opacity: 0.4; |
|
|
|
position: absolute; |
|
|
|
left: 50%; |
|
|
|
@ -346,7 +171,8 @@ export default { |
|
|
|
text-align: center; |
|
|
|
font-weight: 700; |
|
|
|
font-size: 20px; |
|
|
|
color: rgba(73, 73, 73, 1); |
|
|
|
// color: rgba(73, 73, 73, 1); |
|
|
|
color: #000; |
|
|
|
opacity: 0.7; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -358,8 +184,12 @@ export default { |
|
|
|
// .btn :hover { |
|
|
|
// // background-color: rgb(0, 183, 92); |
|
|
|
// } |
|
|
|
::v-deep .el-input__icon { |
|
|
|
font-size: 18px; |
|
|
|
} |
|
|
|
.btn { |
|
|
|
background-color: rgb(0, 183, 92); |
|
|
|
font-size: 17px; |
|
|
|
// background-color: #ccc; |
|
|
|
border: none; |
|
|
|
color: #fff; |
|
|
|
|