|
@@ -119,6 +119,7 @@ export default {
|
|
|
// { validator: validateYZM, trigger: "blur" },
|
|
// { validator: validateYZM, trigger: "blur" },
|
|
|
// ],
|
|
// ],
|
|
|
},
|
|
},
|
|
|
|
|
+ id: 1,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -184,29 +185,27 @@ export default {
|
|
|
// console.log(data.code);
|
|
// console.log(data.code);
|
|
|
if (data.code == 200 && data.msg == "成功") {
|
|
if (data.code == 200 && data.msg == "成功") {
|
|
|
// 记住密码/不记住密码
|
|
// 记住密码/不记住密码
|
|
|
- _this.$cookies.set("id", data.data.id);
|
|
|
|
|
- _this.$cookies.set("telephone", _this.ruleForm.telephone);
|
|
|
|
|
- _this.$cookies.set("password", _this.ruleForm.password);
|
|
|
|
|
- _this.$cookies.set("userName", data.data.userName);
|
|
|
|
|
- if (_this.ruleForm.checked) {
|
|
|
|
|
- //_this.$cookies.set('remPassword',true,{expires:7});
|
|
|
|
|
- _this.$cookies.set("remPassword", true);
|
|
|
|
|
- } else {
|
|
|
|
|
- _this.$cookies.set("remPassword", false, { expires: -1 });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // _this.$cookies.set("id", data.data.id);
|
|
|
|
|
+ // _this.$cookies.set("telephone", _this.ruleForm.telephone);
|
|
|
|
|
+ // _this.$cookies.set("password", _this.ruleForm.password);
|
|
|
|
|
+ // _this.$cookies.set("userName", data.data.userName);
|
|
|
|
|
+ // if (_this.ruleForm.checked) {
|
|
|
|
|
+ // //_this.$cookies.set('remPassword',true,{expires:7});
|
|
|
|
|
+ // _this.$cookies.set("remPassword", true);
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // _this.$cookies.set("remPassword", false, { expires: -1 });
|
|
|
|
|
+ // }
|
|
|
// 提示信息
|
|
// 提示信息
|
|
|
_this.$message({
|
|
_this.$message({
|
|
|
message: "登录成功!",
|
|
message: "登录成功!",
|
|
|
type: "success",
|
|
type: "success",
|
|
|
});
|
|
});
|
|
|
- if (
|
|
|
|
|
- _this.$cookies.get("id") != null ||
|
|
|
|
|
- _this.$cookies.get("id") != undefined
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ console.log(_this.$cookies.get("id"));
|
|
|
|
|
+ if (_this.id != null || _this.id != undefined) {
|
|
|
let token = data.data.token;
|
|
let token = data.data.token;
|
|
|
localStorage.setItem("cardToken", token);
|
|
localStorage.setItem("cardToken", token);
|
|
|
- _this.$cookies.set("factoryList", data.data);
|
|
|
|
|
- localStorage.setItem("factoryId", data.data.factoryId);
|
|
|
|
|
|
|
+ // _this.$cookies.set("factoryList", data.data);
|
|
|
|
|
+ // localStorage.setItem("factoryId", data.data.factoryId);
|
|
|
// roleId 1:超级管理员 19:厂家管理员
|
|
// roleId 1:超级管理员 19:厂家管理员
|
|
|
if (
|
|
if (
|
|
|
data.data.roleId == 3 ||
|
|
data.data.roleId == 3 ||
|
|
@@ -215,7 +214,7 @@ export default {
|
|
|
) {
|
|
) {
|
|
|
_this.$router.push({
|
|
_this.$router.push({
|
|
|
path: "/cardHome",
|
|
path: "/cardHome",
|
|
|
- query: { roleId: data.data.roleId },
|
|
|
|
|
|
|
+ // query: { roleId: data.data.roleId },
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
_this.$message({
|
|
_this.$message({
|