diff --git a/api/api.js b/api/api.js new file mode 100644 index 0000000..73884c4 --- /dev/null +++ b/api/api.js @@ -0,0 +1,8 @@ +import {post, upload} from "../utils/request"; +// 已重构接口 +export const getUserInfoV1 = (params) => post("/app/sys/user/getXgfUserInfo", params) // 获取用户信息 +export const setUserInitV1 = (params) => post("/app/sys/user/xgfInit", params) //更新用户信息 +export const getDicLevel = (params) => post("/app/sys/dictionaries/getLevels", params) // 获取数据字典 +export const getEmpLog = (params) => post("/app/sys/user/getEmpLog", params) // 获取就职记录 +export const uploadFile = (params) => upload("/app/sys/file/uploadFile", params); +export const setRefreshToken = (params) => post("/sys/refreshToken", params ); // 刷新token diff --git a/api/refreshToken.js b/api/refreshToken.js new file mode 100644 index 0000000..77ab822 --- /dev/null +++ b/api/refreshToken.js @@ -0,0 +1,14 @@ +import dayjs from "dayjs"; +import store from "../store"; +import {setRefreshToken} from "./api"; + +export default async function () { + const userStore = store.state.userInfo; + if (userStore.getTokenTime) { + if (dayjs().diff(dayjs(userStore.getTokenTime), "minute") >= 5) { + await userStore.setTokenTime(dayjs().format("YYYY-MM-DD HH:mm:ss")); + await setRefreshToken(); + } + } + +} diff --git a/package-lock.json b/package-lock.json index 1cd7706..36ed9ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,8 @@ }, "devDependencies": { "@types/html5plus": "^1.0.2", - "@types/uni-app": "^1.4.4" + "@types/uni-app": "^1.4.4", + "dayjs": "^1.11.13" } }, "node_modules/@babel/parser": { @@ -59,6 +60,13 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "dev": true, + "license": "MIT" + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -215,6 +223,12 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, + "dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "dev": true + }, "deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", diff --git a/package.json b/package.json index 10161aa..79817bc 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "license": "ISC", "devDependencies": { "@types/html5plus": "^1.0.2", - "@types/uni-app": "^1.4.4" + "@types/uni-app": "^1.4.4", + "dayjs": "^1.11.13" } } diff --git a/pages/employed_by/index.vue b/pages/employed_by/index.vue index 4fe1361..a78bbb0 100644 --- a/pages/employed_by/index.vue +++ b/pages/employed_by/index.vue @@ -4,48 +4,48 @@ - 单位名称:{{ item.RELEVANT_UNIT_NAME }} + 单位名称:{{ item.relevantUnitName }} - - 就职时间:{{ item.START_DATE }}-{{ item.END_DATE || '至今' }} + + 就职时间:{{ item.startDate }}-{{ item.endDate || '至今' }} - + 就职状态: - - - - - + + + + + 单位在职申请审核状态: - - - + + + - + 单位离职申请审核状态: - - - + + + - - 审核意见:{{ item.AUDIT_REMARKS }} + + 审核意见:{{ item.auditRemarks }} + @click="fnView(item.employmentApplyManagementId, item.corpinfoId, item.departState)"> + v-if="item.departState === '0'" + @click="fnResignationApplication(item.employmentApplyManagementId,item.relevantUnitName)"> @@ -58,9 +58,7 @@