From a2432a9433240177db30486216577ab6057d583a Mon Sep 17 00:00:00 2001 From: yma16 <17685043634@163.com> Date: Wed, 20 Apr 2022 00:19:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:css=E8=B7=AF=E5=BE=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Csslearn.vue | 7 ++----- src/service/user.service.js | 29 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/Csslearn.vue b/src/components/Csslearn.vue index 29f0983..cdb332a 100644 --- a/src/components/Csslearn.vue +++ b/src/components/Csslearn.vue @@ -92,14 +92,11 @@ export default { axios .get(that.baseurl + "css/") .then((res) => { - console.log("get返回", res); let getdata = res.data; let csspath = getdata.path; let csstitle = getdata.title; - console.log(csspath, csstitle); csspath.map((o) => { - let temp = that.baseurl + o; - that.css_path.push(temp); + that.css_path.push(o); }); // 标题传递 // eslint-disable-next-line camelcase @@ -112,7 +109,7 @@ export default { that.now_title = csstitle.length > 0 ? 1 + ". " + csstitle[0] : ""; // 标题加序号 }) .catch((error) => { - console.log("get错误!", error); + throw Error(error); }); }, }, diff --git a/src/service/user.service.js b/src/service/user.service.js index 529fede..52f4c13 100644 --- a/src/service/user.service.js +++ b/src/service/user.service.js @@ -1,16 +1,19 @@ -import axios from 'axios' +import axios from "axios"; export function loginUser(data) { - console.log('用户登录service!', data) - let baseurl='http://yongma16.xyz/user/login/' - let res=null - axios.post(baseurl, data).then(o => { - res=o - console.log('成功认证', res) - localStorage.setItem("yma16siteUserInfoName",res.name) - localStorage.setItem("yma16siteUserInfoPwd",res.password) - }).catch(r=>{ - console.log('登录失败!',r) + console.log("用户登录service!", data); + let baseurl = "/api/user/login/"; + let res = null; + axios + .post(baseurl, data) + .then((o) => { + res = o; + console.log("成功认证", res); + localStorage.setItem("yma16siteUserInfoName", res.name); + localStorage.setItem("yma16siteUserInfoPwd", res.password); }) - return res -} \ No newline at end of file + .catch((r) => { + console.log("登录失败!", r); + }); + return res; +} -- GitLab