|
@@ -42,13 +42,25 @@ const _sfc_main = {
|
|
|
if (options.scene) {
|
|
if (options.scene) {
|
|
|
const scene = decodeURIComponent(options.scene);
|
|
const scene = decodeURIComponent(options.scene);
|
|
|
console.log("解码后的scene:", scene);
|
|
console.log("解码后的scene:", scene);
|
|
|
- this.setTenantId(scene);
|
|
|
|
|
- const sceneParams = {};
|
|
|
|
|
- scene.split("&").forEach((pair) => {
|
|
|
|
|
- const [key, value] = pair.split("=");
|
|
|
|
|
- sceneParams[key] = value;
|
|
|
|
|
- });
|
|
|
|
|
- console.log("解析后的参数:", sceneParams);
|
|
|
|
|
|
|
+ let parsedTenantId = null;
|
|
|
|
|
+ if (scene.includes("=")) {
|
|
|
|
|
+ const sceneParams = {};
|
|
|
|
|
+ scene.split("&").forEach((pair) => {
|
|
|
|
|
+ const [key, value] = pair.split("=");
|
|
|
|
|
+ sceneParams[key] = value;
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log("解析后的参数:", sceneParams);
|
|
|
|
|
+ parsedTenantId = sceneParams.tenant_id || null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ parsedTenantId = scene;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (parsedTenantId) {
|
|
|
|
|
+ const storedTenantId = common_vendor.index.getStorageSync("tenant_id");
|
|
|
|
|
+ if (storedTenantId && storedTenantId !== parsedTenantId) {
|
|
|
|
|
+ this.silentLogout();
|
|
|
|
|
+ }
|
|
|
|
|
+ this.setTenantId(parsedTenantId);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
this.getTenantId();
|
|
this.getTenantId();
|
|
|
this.checkUserInfo();
|
|
this.checkUserInfo();
|
|
@@ -63,6 +75,15 @@ const _sfc_main = {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 静默清理登录态(不提示不跳转)
|
|
|
|
|
+ silentLogout() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ common_vendor.index.removeStorageSync("token");
|
|
|
|
|
+ common_vendor.index.removeStorageSync("userInfo");
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error("静默登出失败:", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 获取本地存储的tenant_id
|
|
// 获取本地存储的tenant_id
|
|
|
getTenantId() {
|
|
getTenantId() {
|
|
|
const tenantId = common_vendor.index.getStorageSync("tenant_id");
|
|
const tenantId = common_vendor.index.getStorageSync("tenant_id");
|
|
@@ -213,6 +234,67 @@ const _sfc_main = {
|
|
|
common_vendor.index.setStorageSync("selectedJob", JSON.stringify(job));
|
|
common_vendor.index.setStorageSync("selectedJob", JSON.stringify(job));
|
|
|
console.log("已选择职位:", job.id, job.title);
|
|
console.log("已选择职位:", job.id, job.title);
|
|
|
},
|
|
},
|
|
|
|
|
+ // 处理用户信息获取和页面跳转逻辑
|
|
|
|
|
+ handleUserInfoAndNavigation() {
|
|
|
|
|
+ const openid = JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid;
|
|
|
|
|
+ common_vendor.index.request({
|
|
|
|
|
+ url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=${this.tenant_id || JSON.parse(common_vendor.index.getStorageSync("userInfo")).tenant_id || 1}&openid=${openid}`,
|
|
|
|
|
+ method: "GET",
|
|
|
|
|
+ success: (infoRes) => {
|
|
|
|
|
+ if (infoRes.statusCode === 200 && infoRes.data && infoRes.data.data && infoRes.data.data.profile) {
|
|
|
|
|
+ const resumeUrl = infoRes.data.data.profile.resume_url || "";
|
|
|
|
|
+ if (!resumeUrl) {
|
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
|
+ url: "/pages/uploadResume/uploadResume",
|
|
|
|
|
+ // 假设跳转到上传简历页面
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error("页面跳转失败:", err);
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "页面跳转失败",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
|
+ url: "/pages/Personal/Personal",
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error("页面跳转失败:", err);
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "页面跳转失败",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
|
+ url: "/pages/Personal/Personal",
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error("页面跳转失败:", err);
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "页面跳转失败",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error("获取用户信息失败:", err);
|
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
|
+ url: "/pages/Personal/Personal",
|
|
|
|
|
+ fail: (err2) => {
|
|
|
|
|
+ console.error("页面跳转失败:", err2);
|
|
|
|
|
+ common_vendor.index.showToast({
|
|
|
|
|
+ title: "页面跳转失败",
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 获取当前职位配置
|
|
// 获取当前职位配置
|
|
|
getConfig() {
|
|
getConfig() {
|
|
|
common_vendor.index.request({
|
|
common_vendor.index.request({
|
|
@@ -229,64 +311,21 @@ const _sfc_main = {
|
|
|
if (res.statusCode === 200) {
|
|
if (res.statusCode === 200) {
|
|
|
if (res.data.code === 2e3) {
|
|
if (res.data.code === 2e3) {
|
|
|
common_vendor.index.setStorageSync("configData", JSON.stringify(res.data.data));
|
|
common_vendor.index.setStorageSync("configData", JSON.stringify(res.data.data));
|
|
|
- const openid = JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid;
|
|
|
|
|
- common_vendor.index.request({
|
|
|
|
|
- url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=${this.tenant_id || JSON.parse(common_vendor.index.getStorageSync("userInfo")).tenant_id || 1}&openid=${openid}`,
|
|
|
|
|
- method: "GET",
|
|
|
|
|
- success: (infoRes) => {
|
|
|
|
|
- if (infoRes.statusCode === 200 && infoRes.data && infoRes.data.data && infoRes.data.data.profile) {
|
|
|
|
|
- const resumeUrl = infoRes.data.data.profile.resume_url || "";
|
|
|
|
|
- if (!resumeUrl) {
|
|
|
|
|
- common_vendor.index.navigateTo({
|
|
|
|
|
- url: "/pages/uploadResume/uploadResume",
|
|
|
|
|
- // 假设跳转到上传简历页面
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error("页面跳转失败:", err);
|
|
|
|
|
- common_vendor.index.showToast({
|
|
|
|
|
- title: "页面跳转失败",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- common_vendor.index.navigateTo({
|
|
|
|
|
- url: "/pages/Personal/Personal",
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error("页面跳转失败:", err);
|
|
|
|
|
- common_vendor.index.showToast({
|
|
|
|
|
- title: "页面跳转失败",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- common_vendor.index.navigateTo({
|
|
|
|
|
- url: "/pages/Personal/Personal",
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error("页面跳转失败:", err);
|
|
|
|
|
- common_vendor.index.showToast({
|
|
|
|
|
- title: "页面跳转失败",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const configData = res.data.data;
|
|
|
|
|
+ const enableVideoPresentation = (configData == null ? void 0 : configData.enable_video_presentation) || false;
|
|
|
|
|
+ if (enableVideoPresentation) {
|
|
|
|
|
+ const videoUrl = (configData == null ? void 0 : configData.video_presentation_url) || "https://data.qicai321.com/minlong/latentsync/9791ad45-dd30-4f84-a1c6-0c07c4d08707_result.mp4";
|
|
|
|
|
+ const nextPage = "/pages/Personal/Personal";
|
|
|
|
|
+ common_vendor.index.navigateTo({
|
|
|
|
|
+ url: `/pages/video-briefing/video-briefing?src=${encodeURIComponent(videoUrl)}&next=${encodeURIComponent(nextPage)}`,
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error("跳转到视频宣讲页面失败:", err);
|
|
|
|
|
+ this.handleUserInfoAndNavigation();
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error("获取用户信息失败:", err);
|
|
|
|
|
- common_vendor.index.navigateTo({
|
|
|
|
|
- url: "/pages/Personal/Personal",
|
|
|
|
|
- fail: (err2) => {
|
|
|
|
|
- console.error("页面跳转失败:", err2);
|
|
|
|
|
- common_vendor.index.showToast({
|
|
|
|
|
- title: "页面跳转失败",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.handleUserInfoAndNavigation();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.hideLoading();
|