Browse Source

打卡详情

tall4
xuesinan 4 years ago
parent
commit
f6c2ee7043
  1. 6
      .env.development
  2. 6
      .env.production
  3. 14
      src/App.vue
  4. 10
      src/config/api.js
  5. 2
      src/plugins/axios.js
  6. 9
      src/store/modules/home/mutations.js
  7. 1
      src/store/modules/home/state.js

6
.env.development

@ -1,10 +1,10 @@
VUE_APP_MODE=development VUE_APP_MODE=development
VUE_APP_NODE_ENV=development VUE_APP_NODE_ENV=development
VUE_APP_SCENE=checkwork VUE_APP_SCENE=checkwork
VUE_APP_BASE_URL=https://test.tall.wiki VUE_APP_BASE_URL=http://101.201.226.163
VUE_APP_API_URL=https://test.tall.wiki/checkwork/gateway VUE_APP_API_URL=http://101.201.226.163/checkwork/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/checkwork VUE_APP_PUBLIC_PATH=/checkwork
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://101.201.226.163/websocket/message/v4.0/ws
VUE_APP_TITLE=考勤管理 VUE_APP_TITLE=考勤管理
VUE_APP_DESCRIPTION=考勤管理 VUE_APP_DESCRIPTION=考勤管理

6
.env.production

@ -1,10 +1,10 @@
VUE_APP_MODE=production VUE_APP_MODE=production
VUE_APP_NODE_ENV=production VUE_APP_NODE_ENV=production
VUE_APP_SCENE=checkwork VUE_APP_SCENE=checkwork
VUE_APP_BASE_URL=https://www.tall.wiki VUE_APP_BASE_URL=http://101.201.226.163
VUE_APP_API_URL=https://www.tall.wiki/checkwork/gateway VUE_APP_API_URL=http://101.201.226.163//checkwork/gateway
VUE_APP_PROXY_URL=/gateway VUE_APP_PROXY_URL=/gateway
VUE_APP_PUBLIC_PATH=/checkwork VUE_APP_PUBLIC_PATH=/checkwork
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws VUE_APP_MSG_URL=wss://101.201.226.163/websocket/message/v4.0/ws
VUE_APP_TITLE=考勤管理 VUE_APP_TITLE=考勤管理
VUE_APP_DESCRIPTION=考勤管理 VUE_APP_DESCRIPTION=考勤管理

14
src/App.vue

@ -20,17 +20,23 @@ export default {
this.$router.onReady(async () => { this.$router.onReady(async () => {
const userId = this.$route.query.uid; const userId = this.$route.query.uid;
const roleId = this.$route.query.rid; const roleId = this.$route.query.rid;
const params = { userId }; const token = this.$route.query.token;
await this.getUserId(params); const url = this.$route.query.url;
// const params = { userId };
// await this.getUserId(params);
await this.sign(token);
await this.setRoleId(roleId); await this.setRoleId(roleId);
await this.setUrl(url);
await this.getAllMembers({ projectId: this.$route.query.pid }); await this.getAllMembers({ projectId: this.$route.query.pid });
this.setProjectId(this.$route.query.pid); this.setProjectId(this.$route.query.pid);
}); });
}, },
methods: { methods: {
...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId']), ...mapMutations('home', ['setProjectId', 'setMembers', 'setRoleId', 'setUrl']),
...mapActions('user', ['getUserId']), ...mapMutations('user', ['sign']),
// ...mapActions('user', ['getUserId']),
...mapActions('home', ['getAllMembers']), ...mapActions('home', ['getAllMembers']),
}, },
}; };

10
src/config/api.js

@ -4,19 +4,19 @@ const baseUrl = process.env.VUE_APP_BASE_URL;
const defaultwbs = `${baseUrl}/gateway/defaultwbs`; const defaultwbs = `${baseUrl}/gateway/defaultwbs`;
// 查询考勤信息 // 查询考勤信息
export const clockQuery = params => axios.post(`${defaultwbs}/clock/query`, params); export const clockQuery = params => axios.post(`clock/query`, params);
// 查询考勤信息 // 查询考勤信息
export const clockPunch = params => axios.post(`${defaultwbs}/clock/punch`, params); export const clockPunch = params => axios.post(`clock/punch`, params);
// 查询所有成员 // 查询所有成员
export const queryChecker = params => axios.post(`${defaultwbs}/deliver/queryChecker`, params); export const queryChecker = params => axios.post(`deliver/queryChecker`, params);
// 查询所有成员 // 查询所有成员
export const clockAudit = params => axios.post(`${defaultwbs}/clock/audit`, params); export const clockAudit = params => axios.post(`clock/audit`, params);
// 导出考勤excel // 导出考勤excel
export const clockExport = params => axios.post(`${defaultwbs}/clock/export`, params); export const clockExport = params => axios.post(`clock/export`, params);
// 查询所有成员工资信息 // 查询所有成员工资信息
export const queryMemberSalary = params => axios.post(`${defaultwbs}/salary/queryMemberSalary`, params); export const queryMemberSalary = params => axios.post(`${defaultwbs}/salary/queryMemberSalary`, params);

2
src/plugins/axios.js

@ -19,6 +19,8 @@ const _axios = axios.create(config);
axios.interceptors.request.use( axios.interceptors.request.use(
function(config) { function(config) {
let token = store.state.anyringToken || sessionStorage.getItem('anyringToken'); let token = store.state.anyringToken || sessionStorage.getItem('anyringToken');
config.url = store.state.home.url + '/' + config.url;
console.log(config)
if (token) { if (token) {
config.headers.Authorization = `Bearer ${token}`; config.headers.Authorization = `Bearer ${token}`;

9
src/store/modules/home/mutations.js

@ -69,6 +69,15 @@ const mutations = {
setRoleId(state, data) { setRoleId(state, data) {
state.roleId = data; state.roleId = data;
}, },
/**
* 设置url信息
* @param {object} state
* @param {String} data
*/
setUrl(state, data) {
state.url = data;
},
}; };
export default mutations; export default mutations;

1
src/store/modules/home/state.js

@ -14,6 +14,7 @@ const state = {
memberIdList: [], memberIdList: [],
roleId: '', roleId: '',
checkers: [], // 审核人列表 checkers: [], // 审核人列表
url: ''
}; };
export default state; export default state;

Loading…
Cancel
Save