forked from jamielhf/vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
676 additions
and
1,190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,8 @@ vue学习项目 宠物领养 | |
<code> | ||
npm i && npm run dev | ||
</code> | ||
|
||
>1.0.3 | ||
>修改了vue-resource,使用axios | ||
>修改vuex,写法更规范点 | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Created by linhaifeng on 2016/11/16. | ||
*/ | ||
import axios from 'axios'; | ||
|
||
export default { | ||
|
||
/* | ||
* 获取首页列表信息 | ||
* */ | ||
indexGetList:function (cb) { | ||
|
||
axios.get('/index/getList').then(function (res) { | ||
if(res.data.data.code ==1000){ | ||
|
||
cb(res.data.data.data); | ||
} | ||
|
||
}); | ||
|
||
}, | ||
/* | ||
* 获取首页图片 | ||
* */ | ||
indexGetImg:function (cb) { | ||
axios.get('/index/getImgList').then(function (res) { | ||
if(res.data.data.code ==1000){ | ||
cb(res.data.data.data); | ||
} | ||
|
||
}); | ||
}, | ||
/* | ||
* 获取文章详情 | ||
* @param id 文章id | ||
* */ | ||
articleGetContent:function (id,cb) { | ||
axios.get('/article/getData',{ | ||
"articleId":id | ||
}).then(function (res) { | ||
if(res.data.data.code ==1000){ | ||
cb(res.data.data.data[0]); | ||
} | ||
}) | ||
}, | ||
/* | ||
* 提交评论 | ||
* @param id 文章id | ||
* */ | ||
articleSubmit:function (val,uid,rname,aid,commentId,cb) { | ||
axios.get('/article/submit',{val:val,uid:uid,rid:rname,aid:aid,commentId:commentId}).then(function (res) { | ||
console.log(val); | ||
if(res.data.data.code ==1000){ | ||
cb(res.data.data.data[0]); | ||
}}) | ||
|
||
} | ||
|
||
|
||
|
||
|
||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.