|
@@ -57,44 +57,54 @@
|
|
|
},
|
|
|
methods: {
|
|
|
loginbtn() {
|
|
|
- if (this.account == "") {
|
|
|
+
|
|
|
+ if(this.isChecked==false){
|
|
|
this.$refs.uToast.show({
|
|
|
type: "error",
|
|
|
- message: "请输入账号",
|
|
|
+ message: "请同意用户协议和隐私政策",
|
|
|
});
|
|
|
- } else if (this.password == "") {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: "error",
|
|
|
- message: "请输入密码",
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- let formData = {
|
|
|
- username: this.account,
|
|
|
- password: this.password,
|
|
|
- };
|
|
|
- //登录功能
|
|
|
- this.$api.post("/login", formData).then((res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- uni.setStorageSync("tokendata", res.data.data.token); //token
|
|
|
- uni.setStorageSync("Userinformation", formData); //用户信息
|
|
|
- //获取用户的信息,如组织架构,个人信息,权限等
|
|
|
- Promise.all([
|
|
|
- this.getpermissions(),
|
|
|
- this.getDictList(),
|
|
|
- this.getuserInfo(),
|
|
|
- ]).then(() => {
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/index/index",
|
|
|
- });
|
|
|
+ }else{
|
|
|
+ if (this.account == "") {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: "error",
|
|
|
+ message: "请输入账号",
|
|
|
});
|
|
|
- } else {
|
|
|
+ return false
|
|
|
+ } else if (this.password == "") {
|
|
|
this.$refs.uToast.show({
|
|
|
type: "error",
|
|
|
- message: "账号或者密码错误,请重新输入",
|
|
|
+ message: "请输入密码",
|
|
|
});
|
|
|
+ return false
|
|
|
}
|
|
|
- });
|
|
|
+
|
|
|
+ let formData = {
|
|
|
+ username: this.account,
|
|
|
+ password: this.password,
|
|
|
+ };
|
|
|
+ //登录功能
|
|
|
+ this.$api.post("/login", formData).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ uni.setStorageSync("tokendata", res.data.data.token); //token
|
|
|
+ uni.setStorageSync("Userinformation", formData); //用户信息
|
|
|
+ //获取用户的信息,如组织架构,个人信息,权限等
|
|
|
+ Promise.all([
|
|
|
+ this.getpermissions(),
|
|
|
+ this.getDictList(),
|
|
|
+ this.getuserInfo(),
|
|
|
+ ]).then(() => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/index/index",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: "error",
|
|
|
+ message: "账号或者密码错误,请重新输入",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
getpermissions() {
|
|
|
console.log("权限功能");
|
|
@@ -178,6 +188,13 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+ .Userprotocol{
|
|
|
+ margin-top: 100rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
.form-box {
|
|
|
width: 91%;
|
|
|
background: #fff;
|
|
@@ -213,7 +230,7 @@
|
|
|
}
|
|
|
|
|
|
.login-btn {
|
|
|
- margin-top: 50px;
|
|
|
+ margin-top: 20px;
|
|
|
font-size: 16px;
|
|
|
letter-spacing: 7px;
|
|
|
color: #ffffff;
|