diff --git a/src/components/Csslearn.vue b/src/components/Csslearn.vue index 29f0983655953a915f765561f66349967c4fe855..cdb332a24e7661644d017a329cc2de806f57807c 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 529fede525da4428a4d5ab2be1ae406181fbdb60..52f4c135621f8852322b897eb827129c6625228f 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; +}