简历上传,pdf简历下载
This commit is contained in:
+12
-5
@@ -264,15 +264,22 @@ export default createStore<RootState>({
|
||||
},
|
||||
|
||||
/**
|
||||
* 保存求职意向到后端,成功后同步更新 store
|
||||
* 保存求职意向:已登录时调接口保存并更新 store,未登录时仅更新 store
|
||||
* @param data 求职意向数据
|
||||
*/
|
||||
async saveJobIntention({ commit }, data: JobIntention) {
|
||||
const res = await saveJobIntention(data)
|
||||
if (res.code === '0') {
|
||||
async saveJobIntention({ commit, state }, data: JobIntention) {
|
||||
if (state.isAuthenticated) {
|
||||
// 已登录 — 调接口持久化,成功后同步 store
|
||||
const res = await saveJobIntention(data)
|
||||
if (res.code === '0') {
|
||||
commit('SET_JOB_INTENTION', data)
|
||||
}
|
||||
return res
|
||||
} else {
|
||||
// 未登录 — 仅本地更新 store,不请求接口
|
||||
commit('SET_JOB_INTENTION', data)
|
||||
return { code: '0', message: 'ok' }
|
||||
}
|
||||
return res
|
||||
},
|
||||
},
|
||||
modules: {},
|
||||
|
||||
Reference in New Issue
Block a user