diff --git a/.env.development b/.env.development index 6740be0..b1ab04f 100644 --- a/.env.development +++ b/.env.development @@ -3,17 +3,12 @@ ENV = 'development' # 接口地址 #内网服务地址 -VUE_APP_BASE_API = 'http://192.168.99.107:7070' -VUE_APP_WS_API = 'ws://192.168.99.107:7071' -VUE_APP_CAMERA_API = '192.168.99.107' - -# 刘力-本地服地址 -#VUE_APP_BASE_API = 'http://192.168.99.65:7070' -#VUE_APP_WS_API = 'ws://192.168.99.65:7071' +#VUE_APP_BASE_API = 'http://120.76.47.59:8080' +#VUE_APP_WS_API = 'ws://120.76.47.59:8080' # 许镇-本地服地址 -#VUE_APP_BASE_API = 'http://192.168.99.84:7070' -#VUE_APP_WS_API = 'ws://192.168.99.84:7070' +VUE_APP_BASE_API = 'http://192.168.99.84:8080' +VUE_APP_WS_API = 'ws://192.168.99.84:8080' # 是否启用 babel-plugin-dynamic-import-node插件 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/bookshelf.js b/src/api/bookshelf.js new file mode 100644 index 0000000..522c68e --- /dev/null +++ b/src/api/bookshelf.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' +// import qs from 'qs' + +// 数字资源 +export function initNumberResoures(params) { + return request({ + url: '/dxhtsg/initNumberResoures', + method: 'get', + params: params + }) +} + +// 新书推荐 +export function FetchNewBookRecommend(params) { + return request({ + url: '/dxhtsg/newBookRecommend', + method: 'get', + params: params + }) +} + +// 通过isbn获取图书封面 +export function FetchCoverByISBN(params) { + return request({ + url: '/dxhtsg/getCoverByISBN', + method: 'get', + params: params, + responseType: 'blob' + }) +} + +export default { + FetchNewBookRecommend, + FetchCoverByISBN, + initNumberResoures +} diff --git a/src/assets/images/default-img.png b/src/assets/images/default-img.png new file mode 100644 index 0000000..8952025 Binary files /dev/null and b/src/assets/images/default-img.png differ diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index dcd7ff0..378adeb 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -205,17 +205,23 @@ .list-small{ display: flex; - justify-content: space-between; justify-items: center; + margin-left: -40px; .list-item{ width: 200px; border: none; - img{ - display: block; + margin-left: 40px; + .book-img{ + display: flex; + align-items: center; width: 100%; height: 240px; margin-bottom: 10px; } + img{ + display: block; + width: 100%; + } .book-title{ margin-bottom: 0; } diff --git a/src/main.js b/src/main.js index b552072..7d85aa3 100644 --- a/src/main.js +++ b/src/main.js @@ -18,6 +18,9 @@ import './assets/fonts/fonts.css' import axios from 'axios' Vue.prototype.$axios = axios +// 馆代码 1201为东西湖馆代码 / 本地测试用FTZN +Vue.prototype.libcode = '1201' + // 引入echart import echarts from 'echarts' Vue.prototype.$echarts = echarts diff --git a/src/utils/request.js b/src/utils/request.js index 99f050b..1ec0cde 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -29,14 +29,20 @@ service.interceptors.request.use( // response 拦截器 service.interceptors.response.use( response => { - const errorMsg = response.data.message - if (response.data.code === 200) { - return response.data.data + const errorMsg = response.data.errMsg + if (response.status === 200) { + // console.log(response.data.data) + if (response.data instanceof Blob) { + return response.data + } else { + return response.data.data + } } else { Message.error({ message: errorMsg, duration: 5000 }) + Promise.reject() } }, error => { diff --git a/src/views/data.json b/src/views/data.json index c622ed2..43af638 100644 --- a/src/views/data.json +++ b/src/views/data.json @@ -1,53 +1,53 @@ { "bookList":[ { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定1", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定1", "ranking": 1, "num": 2000 }, { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定2", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定2", "ranking": 2, "num": 1200 }, { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定3", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定3", "ranking": 3, "num": 1100 } ], "newList":[ { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定1", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定1", "ranking": 1, "num": 2000 }, { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定2", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定2", "ranking": 2, "num": 1200 }, { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定3", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定3", "ranking": 3, "num": 1100 }, { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定4", + "cover":"https://qiniu.aiyxlib.com/bg.png", + "nbName": "大个子狗与小个子猫", + "nbAuthor": "高小定4", "ranking": 4, "num": 1100 } diff --git a/src/views/index.vue b/src/views/index.vue index c2ae49f..37b6b52 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -64,6 +64,7 @@