From 19f72099bf2c1298ea6d7295ddf9c8ef6dd6b0cb Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Sun, 18 May 2025 11:30:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(login):=20=E5=AE=9E=E7=8E=B0=E9=94=80?= =?UTF-8?q?=E5=94=AE=E7=AB=AF=E5=92=8C=E5=AD=A6=E5=91=98=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 api.js 文件,定义了 personnelLogin 和 memberEdit 方法 - 修改 config.js,更新了 API 地址 - 重构了 login 页面的登录逻辑,支持不同用户类型的登录 --- api/api.js | 23 +++++++++ common/config.js | 10 ++-- pages/student/login/login.vue | 90 ++++++++++++++++++++--------------- 3 files changed, 80 insertions(+), 43 deletions(-) create mode 100644 api/api.js diff --git a/api/api.js b/api/api.js new file mode 100644 index 0000000..81f343e --- /dev/null +++ b/api/api.js @@ -0,0 +1,23 @@ +import http from '../common/axios.js' + +//全部api接口 +export default { + //教师端登陆 + personnelLogin(data = {}) { + let url = '/personnelLogin' + return http.post(url, data).then(res => { + return res; + }) + }, + + //修改销售人员详情 + memberEdit(data = {}) { + let url = '/member/member_edit' + return http.post(url, data).then(res => { + return res; + }) + }, + + + +} \ No newline at end of file diff --git a/common/config.js b/common/config.js index 949925a..9e76a6b 100644 --- a/common/config.js +++ b/common/config.js @@ -1,10 +1,10 @@ -// 线上地址 -const Api_url='http://146.56.228.75:20021/api' -const img_domian = 'http://146.56.228.75:20021/' +// 线上测试地址 +// const Api_url='http://aaaaaaaa.hksywl.cn/api' +// const img_domian = 'http://aaaaaaaa.hksywl.cn/' //本地测试地址 -// const Api_url='http://zhjw.cc/api' -// const img_domian = 'http://zhjw.cc/' +const Api_url='http://zhjw.cc/api' +const img_domian = 'http://zhjw.cc/' const IsDemo = false diff --git a/pages/student/login/login.vue b/pages/student/login/login.vue index a7a4e20..80ca008 100644 --- a/pages/student/login/login.vue +++ b/pages/student/login/login.vue @@ -37,16 +37,19 @@