diff --git a/package.json b/package.json index 8a77d71..ba1e881 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,8 @@ "sass-loader": "10.1.1", "script-ext-html-webpack-plugin": "2.1.5", "svg-sprite-loader": "5.1.1", - "vue-template-compiler": "2.6.12" + "vue-template-compiler": "2.6.12", + "vue-wxlogin": "^1.0.4" }, "engines": { "node": ">=8.9", diff --git a/public/index.html b/public/index.html index 64becb8..c1b5d7d 100644 --- a/public/index.html +++ b/public/index.html @@ -93,6 +93,7 @@ securityJsCode:'420463f2f8c849ab78b9d29548aff7d3', } + diff --git a/src/api/login.js b/src/api/login.js index 8c24dc9..dfb52e0 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -18,6 +18,17 @@ export function login(username, password, code, uuid) { }); } +export function wxLogin(data) { + return request({ + url: '/wx/login', + headers: { + isToken: false + }, + method: 'post', + data: data + }); +} + // 注册方法 export function register(data) { return request({ diff --git a/src/api/zs/office.js b/src/api/zs/office.js new file mode 100644 index 0000000..e4dcc20 --- /dev/null +++ b/src/api/zs/office.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询报名点列表 +export function listOffice(query) { + return request({ + url: '/zs/office/list', + method: 'get', + params: query + }) +} + +// 查询报名点详细 +export function getOffice(officeId) { + return request({ + url: '/zs/office/' + officeId, + method: 'get' + }) +} + +// 新增报名点 +export function addOffice(data) { + return request({ + url: '/zs/office', + method: 'post', + data: data + }) +} + +// 修改报名点 +export function updateOffice(data) { + return request({ + url: '/zs/office', + method: 'put', + data: data + }) +} + +// 删除报名点 +export function delOffice(officeId) { + return request({ + url: '/zs/office/' + officeId, + method: 'delete' + }) +} diff --git a/src/api/zs/officeSign.js b/src/api/zs/officeSign.js new file mode 100644 index 0000000..ca2d01b --- /dev/null +++ b/src/api/zs/officeSign.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询报名点成交登记列表 +export function listSign(query) { + return request({ + url: '/zs/officesign/list', + method: 'get', + params: query + }) +} + +// 查询报名点成交登记详细 +export function getSign(officesignId) { + return request({ + url: '/zs/officesign/' + officesignId, + method: 'get' + }) +} + +// 新增报名点成交登记 +export function addSign(data) { + return request({ + url: '/zs/officesign', + method: 'post', + data: data + }) +} + +// 修改报名点成交登记 +export function updateSign(data) { + return request({ + url: '/zs/officesign', + method: 'put', + data: data + }) +} + +// 删除报名点成交登记 +export function delSign(officesignId) { + return request({ + url: '/zs/officesign/' + officesignId, + method: 'delete' + }) +} + +//审核登记 +export function checkSign(data) { + return request({ + url: '/zs/officesign/check', + method: 'put', + data: data + }) +} diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 0b52bad..b8b4c8d 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -238,3 +238,8 @@ aside { z-index: 9999; } +.impowerBox .qrcode { + width: 80px; + margin-top: 15px; + border: 1px solid #e2e2e2; +} \ No newline at end of file diff --git a/src/assets/styles/wx.scss b/src/assets/styles/wx.scss new file mode 100644 index 0000000..5a97fa1 --- /dev/null +++ b/src/assets/styles/wx.scss @@ -0,0 +1,5 @@ +.impowerBox .qrcode {width: 200px;} +.impowerBox .title {display: none;} +.impowerBox .info {width: 200px;} +.status_icon {display: none} +.impowerBox .status {text-align: center;} \ No newline at end of file diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 83f6b01..9c64792 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,5 +1,14 @@ -import { login, logout, getInfo } from '@/api/login'; -import { getToken, setToken, removeToken } from '@/utils/auth'; +import { + login, + logout, + getInfo, + wxLogin +} from '@/api/login'; +import { + getToken, + setToken, + removeToken +} from '@/utils/auth'; const user = { state: { @@ -30,7 +39,9 @@ const user = { actions: { // 登录 - Login({ commit }, userInfo) { + Login({ + commit + }, userInfo) { const username = userInfo.username.trim(); const password = userInfo.password; const code = userInfo.code; @@ -47,9 +58,29 @@ const user = { }); }); }, + // 登录 + WXLogin({ + commit + }, userInfo) { + return new Promise((resolve, reject) => { + wxLogin(userInfo) + .then((res) => { + setToken(res.token); + commit('SET_TOKEN', res.token); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); + }, + // 获取用户信息 - GetInfo({ commit, state }) { + GetInfo({ + commit, + state + }) { return new Promise((resolve, reject) => { getInfo() .then((res) => { @@ -74,7 +105,10 @@ const user = { }, // 退出系统 - LogOut({ commit, state }) { + LogOut({ + commit, + state + }) { return new Promise((resolve, reject) => { logout(state.token) .then(() => { @@ -91,7 +125,9 @@ const user = { }, // 前端 登出 - FedLogOut({ commit }) { + FedLogOut({ + commit + }) { return new Promise((resolve) => { commit('SET_TOKEN', ''); removeToken(); diff --git a/src/views/login.vue b/src/views/login.vue index 778ea29..b39c4fc 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,36 +1,23 @@