diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f4be7a0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/public/favicon.ico b/public/favicon.ico index 41cb8b8..6dcf6db 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/App.vue b/src/App.vue index ec9032c..11607d9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,7 +5,24 @@ diff --git a/src/api/system/ossLogin.js b/src/api/system/ossLogin.js new file mode 100644 index 0000000..3cc7f60 --- /dev/null +++ b/src/api/system/ossLogin.js @@ -0,0 +1,10 @@ +import request from "@/utils/request"; +import store from '@/store'; +export function ossLogin(data){ + return request({ + isLoading:false, + method:'post', + url:'/api/admin/auth/oss-login', + data + }) +} diff --git a/src/assets/center/brrow_step_on.png b/src/assets/center/brrow_step_on.png index 26fa887..bb5e763 100644 Binary files a/src/assets/center/brrow_step_on.png and b/src/assets/center/brrow_step_on.png differ diff --git a/src/assets/center/icon_arrow.png b/src/assets/center/icon_arrow.png index ff0b482..0c9c90d 100644 Binary files a/src/assets/center/icon_arrow.png and b/src/assets/center/icon_arrow.png differ diff --git a/src/assets/center/index_bottom.png b/src/assets/center/index_bottom.png index 1b93afd..44fa4b1 100644 Binary files a/src/assets/center/index_bottom.png and b/src/assets/center/index_bottom.png differ diff --git a/src/assets/center/index_bottom_right.png b/src/assets/center/index_bottom_right.png index 7b978a6..e450bc4 100644 Binary files a/src/assets/center/index_bottom_right.png and b/src/assets/center/index_bottom_right.png differ diff --git a/src/assets/center/index_brrow.png b/src/assets/center/index_brrow.png index f403aed..cdad561 100644 Binary files a/src/assets/center/index_brrow.png and b/src/assets/center/index_brrow.png differ diff --git a/src/assets/center/index_logo.png b/src/assets/center/index_logo.png index 4b46b9f..8b0e909 100644 Binary files a/src/assets/center/index_logo.png and b/src/assets/center/index_logo.png differ diff --git a/src/assets/center/index_name.png b/src/assets/center/index_name.png index c85594a..610cdb8 100644 Binary files a/src/assets/center/index_name.png and b/src/assets/center/index_name.png differ diff --git a/src/assets/center/index_return.png b/src/assets/center/index_return.png new file mode 100644 index 0000000..5c82d5a Binary files /dev/null and b/src/assets/center/index_return.png differ diff --git a/src/assets/center/people.png b/src/assets/center/people.png index 1264e3c..b13e830 100644 Binary files a/src/assets/center/people.png and b/src/assets/center/people.png differ diff --git a/src/permission.js b/src/permission.js index 003a4a9..8421f9b 100644 --- a/src/permission.js +++ b/src/permission.js @@ -20,6 +20,7 @@ router.beforeEach(async(to, from, next) => { // determine whether the user has logged in const hasToken = getToken() + if (hasToken) { if (to.path === '/login') { // if is logged in, redirect to the home page diff --git a/src/settings.js b/src/settings.js index e99652b..4760348 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,6 +1,6 @@ module.exports = { - title: '同心读书会自助借阅系统', + title: '自助借阅系统', /** * @type {boolean} true | false diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 5decf12..84d3ff8 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -17,6 +17,8 @@ const getDefaultState = () => { token: getToken(), name: '', avatar: '', + userId:'', + username:'', roles: [] } } @@ -33,6 +35,12 @@ const mutations = { SET_NAME: (state, name) => { state.name = name }, + SET_USERNAME:(state,username) => { + state.username = username + }, + SET_USERID:(state,id) => { + state.userId = id + }, SET_AVATAR: (state, avatar) => { state.avatar = avatar }, @@ -84,11 +92,13 @@ const actions = { const { roles, name, + id, + username, avatar } = response - - + commit('SET_USERNAME',username) + commit('SET_USERID',id) commit('SET_ROLES', roles) commit('SET_NAME', name) commit('SET_AVATAR', avatar) diff --git a/src/utils/auth.js b/src/utils/auth.js index 09d84a1..b3fce42 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,6 @@ import Cookies from 'js-cookie' -const TokenKey = 'sqhj_book_token' +const TokenKey = 'hjjc_book_web_token' export function getToken() { return Cookies.get(TokenKey) diff --git a/src/views/bookRecord/recordIndex.vue b/src/views/bookRecord/recordIndex.vue index 4d33a27..4510968 100644 --- a/src/views/bookRecord/recordIndex.vue +++ b/src/views/bookRecord/recordIndex.vue @@ -43,7 +43,9 @@ del, show } from "@/api/bookRecord/recordIndex"; - + import { + getInfo + } from '../../api/user.js' export default { data() { @@ -52,6 +54,7 @@ page: 1, page_size: 20, keyword: '', + user_name: '' }, total: 0, list: [], @@ -117,6 +120,7 @@ } }, methods: { + doSearch() { this.select.page = 1; this.load(); @@ -127,9 +131,23 @@ this.load(); }, async load() { - const res = await index(this.select) - this.total = res.total - this.list = res.data + + var that = this; + let type = parseInt(this.$route.path.split("_")[1]); + if (type == 1) { + await getInfo().then(res => { + this.select.user_name = res.name; + const resData = index(this.select) + this.total = resData.total + this.list = resData.data + }) + } else { + const resData = await index(this.select) + this.total = resData.total + this.list = resData.data + + } + }, deleteitem(row) { del({ @@ -142,9 +160,9 @@ back(row) { save({ id: row.id, - status:1, - user_id:row.user?.id, - return_time:this.$moment().format("YYYY-MM-DD HH:mm:ss") + status: 1, + user_id: row.user?.id, + return_time: this.$moment().format("YYYY-MM-DD HH:mm:ss") }).then(res => { this.load(); this.$Message.success("归还成功"); diff --git a/src/views/bookStore/components/putIn.vue b/src/views/bookStore/components/putIn.vue index b63cb64..59753b2 100644 --- a/src/views/bookStore/components/putIn.vue +++ b/src/views/bookStore/components/putIn.vue @@ -8,7 +8,7 @@
入库数量
- +
@@ -24,17 +24,70 @@ + + + + + + + + + + - @@ -54,6 +107,13 @@ isShow: false, id: "", + options: [{ + value: 0, + label: '在库' + }, { + value: 1, + label: '借出' + }], bookid: "", type: "add", detail: { @@ -63,7 +123,12 @@ enter_date: "", remark: "", status: 0, - booknum: 1 + booknum: 1, + bookshelf: "", + line: "", + rows: "", + borrow_status: 0, + sort:"" }, rules: { enter_date: [{ @@ -79,11 +144,11 @@ if (newVal) { if (this.type === 'editor') { this.getDetail() + } else { + this.id = '' + this.type = '' + this.$refs['addActivity'].reset() } - } else { - this.id = '' - this.type = '' - this.$refs['addActivity'].reset() } } }, @@ -92,20 +157,31 @@ async getDetail() { let res = await showDetail({ id: this.id - }) - Object.assign(this.detail, res); + }); + console.log(res) + this.detail.book_id = res.book_id; + this.detail.id = res.id; + this.detail.no = res.no; + this.detail.enter_date = res.enter_date; + this.detail.remark = res.remark; + this.detail.status = res.status; + this.detail.bookshelf = res.bookshelf; + this.detail.line = res.line; + this.detail.rows = res.rows; + this.detail.borrow_status = res.borrow_status; + this.detail.sort = res.sort; + + }, editor() { - - for (var i = 1; i <= this.detail.booknum;i++) { - saveDetail(this.detail).then(res => { - - }) - } + console.log("this.detail", this.detail) + saveDetail(this.detail).then(res => { + this.isShow = false this.$Message.success("操作成功"); this.$emit('refresh') + }) }, diff --git a/src/views/bookStore/storeList.vue b/src/views/bookStore/storeList.vue index 17d1ea0..a144dee 100644 --- a/src/views/bookStore/storeList.vue +++ b/src/views/bookStore/storeList.vue @@ -10,6 +10,13 @@ 关键字 + + 借阅状态 + + + + +