Browse Source

前端-智能简历

armg 10 months ago
parent
commit
d79cfc5148

+ 2 - 2
ruoyi-ui/src/App.vue

@@ -24,8 +24,8 @@ export default {
     let isMobileEnv = this.isMobile();
     // 储存
     this.$store.commit("app/SET_IS_MOBILE_ENV", isMobileEnv);
-    console.log("页面链接=", window.location.href);
-    console.log("页面corpId=", this.getUrlParam("corpId"));
+    // console.log("页面链接=", window.location.href);
+    // console.log("页面corpId=", this.getUrlParam("corpId"));
     if (this.getUrlParam("corpId")) {
       // 存储corpId
       this.$store.commit("app/SET_CORPID", this.getUrlParam("corpId"));

+ 16 - 3
ruoyi-ui/src/permission.js

@@ -3,7 +3,7 @@ import store from './store'
 import { Message } from 'element-ui'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
-import { getToken } from '@/utils/auth'
+import { getToken, setToken } from '@/utils/auth'
 import { isRelogin } from '@/utils/request'
 
 NProgress.configure({ showSpinner: false })
@@ -11,7 +11,7 @@ NProgress.configure({ showSpinner: false })
 const whiteList = ['/login', '/register']
 
 router.beforeEach((to, from, next) => {
-  console.log("====", to, from)
+  console.log("====", to, from, getToken())
   NProgress.start()
   if (getToken()) {
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
@@ -74,12 +74,25 @@ router.beforeEach((to, from, next) => {
       }
     }
   } else {
+    console.log("==无token", whiteList.indexOf(to.path) !== -1)
     // 没有token
     if (whiteList.indexOf(to.path) !== -1) {
       // 在免登录白名单,直接进入
       next()
     } else {
-      next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
+      // next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
+      if (to.path === "/") {
+        setToken("111")
+        // console.log("-----77777")
+        if (store.state.app.isMobileEnv) {
+          next({ path: '/mobile/resume/index' })
+        } else {
+          next({ path: '/system/resume/index' })
+        }
+      } else {
+        // console.log("-----888888")
+        next()
+      }
       NProgress.done()
     }
   }

+ 14 - 10
ruoyi-ui/src/views/mobile/resume/index.vue

@@ -97,6 +97,7 @@ export default {
       loading: false,
       finished: false,
       noDate: false,
+      firstLoad: true,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -105,10 +106,7 @@ export default {
       },
     };
   },
-  async created() {
-    // console.log("======created===========")
-    await this.getLogin();
-  },
+  created() {},
   mounted() {},
   methods: {
     toDetail(id) {
@@ -127,7 +125,12 @@ export default {
     onSearch() {
       this.getList();
     },
-    onLoad() {
+    async onLoad() {
+      if (this.firstLoad) {
+        this.firstLoad = false;
+        await this.getLogin();
+      }
+
       this.getList();
     },
     getList() {
@@ -144,7 +147,7 @@ export default {
       listResume(that.queryParams)
         .then((response) => {
           if (response.code == 200) {
-            console.log("移动端=", response);
+            // console.log("移动端=", response);
             that.$toast.clear();
             let data = response.rows,
               total = response.total;
@@ -158,7 +161,7 @@ export default {
             } else {
               that.finished = false;
               that.list.push(...data);
-              that.queryParams.page += 1;
+              that.queryParams.pageNum += 1;
             }
             that.loading = false;
           }
@@ -170,12 +173,13 @@ export default {
     async getLogin() {
       let that = this;
       // 取值-同步
+      // console.log("dd.env.platform=", dd.env.platform);
       // console.log("是否是移动端=", this.$store.state.app.isMobileEnv);
       if (dd.env.platform !== "notInDingTalk") {
         return new Promise((resolve, reject) => {
           dd.ready(function () {
             // 钉钉免登录认证-第三方企业
-            let corpId = that.$store.state.app.corpId || "ding870ccf3c4d8fc1bc";
+            let corpId = that.$store.state.app.corpId;
             // 唤起授权--统一授权套件SDK
             openAuth({
               clientId: "suiteyjd6ikxpg8629ydr", // 应用ID(唯一标识)
@@ -185,12 +189,12 @@ export default {
               type: 0, // 0 标识授权个人信息;1 标识授权组织信息
             }).then((res) => {
               // 处理返回数据
-              console.log("统一授权套件SDK==res=", res);
+              // console.log("统一授权套件SDK==res=", res);
               //cropLogin
               //authLogin
               authLogin({ code: res.result.authCode, corpId: corpId })
                 .then((res) => {
-                  console.log("===登录授权=", res);
+                  // console.log("===登录授权=", res);
                   // let userInfo = res.sysUser;
                   setToken(res.msg);
                   that.$store.commit("SET_TOKEN", res.msg);

+ 10 - 9
ruoyi-ui/src/views/system/resume/index.vue

@@ -364,6 +364,9 @@ export default {
   async created() {
     // console.log("======created===========")
     await this.getLogin();
+    this.resumeList = [];
+    // console.log("======mounted===========")
+    this.getList();
   },
   activated() {
     this.resumeList = [];
@@ -373,18 +376,16 @@ export default {
   // created() {
   //   this.getList();
   // },
-  mounted() {
-    this.resumeList = [];
-    // console.log("======mounted===========")
-    this.getList();
+  destroyed(){
+    this.$store.dispatch('LogOut').then(() => {})
   },
   methods: {
     /** 查询简历管理列表 */
     getList() {
-      console.log("======getList=====");
+      // console.log("======getList=====");
       this.loading = true;
       listResume(this.queryParams).then((response) => {
-        console.log("pc端=", response);
+        // console.log("pc端=", response);
         this.resumeList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -516,7 +517,7 @@ export default {
           dd.ready(function () {
             // 钉钉免登录认证-第三方企业
             let corpId = that.$store.state.app.corpId;
-            console.log("corpId====", corpId);
+            // console.log("corpId====", corpId);
             // 唤起授权--统一授权套件SDK
             openAuth({
               clientId: "suiteyjd6ikxpg8629ydr", // 应用ID(唯一标识)
@@ -526,12 +527,12 @@ export default {
               type: 0, // 0 标识授权个人信息;1 标识授权组织信息
             }).then((res) => {
               // 处理返回数据
-              console.log("统一授权套件SDK==res=", res);
+              // console.log("统一授权套件SDK==res=", res);
               //cropLogin
               //authLogin
               authLogin({ code: res.result.authCode, corpId: corpId })
                 .then((res) => {
-                  console.log("===登录授权=", res);
+                  // console.log("===登录授权=", res);
                   // let userInfo = res.sysUser;
                   setToken(res.msg);
                   that.$store.commit("SET_TOKEN", res.msg);