From 3d5fd892a501ad92eef43f91861a6f57a73ae0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Wed, 13 Nov 2024 19:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/mer_admin.js | 4 +- src/views/common/login.vue | 78 ++++++++++++++++++- .../logistics-template/index.vue | 14 +++- src/views/modules/product/index.vue | 21 +++-- 4 files changed, 102 insertions(+), 15 deletions(-) diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index 378d992..b7e7607 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -15,9 +15,8 @@ export const mer_admin = { * @returns */ loginByAccount: (params) => { - return $http.post(`/auth/login`, { + return $http.post(`/admin-api/auth/login`, { ...params, - type: 1, }); }, loginByMobile: (params) => { @@ -155,5 +154,4 @@ export const mer_admin = { params: { id }, }); }, - }; diff --git a/src/views/common/login.vue b/src/views/common/login.vue index b763c0e..8b921b9 100644 --- a/src/views/common/login.vue +++ b/src/views/common/login.vue @@ -3,9 +3,7 @@
-

- 大妈集市商户端 -

+

大妈集市商户端

@@ -13,6 +11,12 @@
@@ -144,6 +190,7 @@ import { getUUID } from "@/utils"; export default { data() { return { + value: true, loginWay: "code_login", loginType: "教育局", mobileCodeCountDown: 0, @@ -256,6 +303,31 @@ export default { }); }); }, + handleLogin() { + const _loginTypeMapper = { + 管理员: "ROLE_ADMIN", + 教育局: "ROLE_EDU", + 学校: "ROLE_SCHOOL", + 教师: "ROLE_TEACHER", + }; + this.$refs["dataForm"].validate((valid) => { + console.log("账号密码登录"); + this.$api.mer_admin + .loginByAccount({ + // role: _loginTypeMapper[this.loginType], + userName: this.dataForm.userName, + password: this.dataForm.password, + }) + .then(({ data }) => { + console.log("data", data); + this.$cookie.set("token", data.data.token); + this.$router.replace({ name: "home" }); + }) + .catch((err) => { + console.log(err); + }); + }); + }, //获取短信验证码 getCode() { //正则表达式校验手机号是否合法 diff --git a/src/views/modules/logistics-fare/logistics-template/index.vue b/src/views/modules/logistics-fare/logistics-template/index.vue index 2086987..4049b63 100644 --- a/src/views/modules/logistics-fare/logistics-template/index.vue +++ b/src/views/modules/logistics-fare/logistics-template/index.vue @@ -21,10 +21,7 @@ > - + 搜索 + 重置 添加运费模板