Pārlūkot izejas kodu

修改点击消息,更新消息

gcj 3 gadi atpakaļ
vecāks
revīzija
60802cae0b

BIN
public/favicon.ico


BIN
public/favicon1.ico


+ 21 - 15
public/index.html

@@ -1,17 +1,23 @@
 <!DOCTYPE html>
 <html>
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
-    <title><%= webpackConfig.name %></title>
-  </head>
-  <body>
-    <noscript>
-      <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
-    </noscript>
-    <div id="app"></div>
-    <!-- built files will be auto injected -->
-  </body>
-</html>
+
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
+  <!-- <link id="icon" rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
+  <title>
+    <%= webpackConfig.name %>
+  </title>
+</head>
+
+<body>
+  <noscript>
+    <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it
+        to continue.</strong>
+  </noscript>
+  <div id="app"></div>
+  <!-- built files will be auto injected -->
+</body>
+
+</html>

+ 9 - 1
src/components/Personalcenter/Mymessage.vue

@@ -161,7 +161,6 @@ export default {
     },
     //查看消息详情
     viewDetail(msgItem) {
-      debugger;
       msgItem.isShow = !msgItem.isShow;
       let date = msgItem.send_time.split(" ");
       if (msgItem.is_read == "false") {
@@ -171,6 +170,7 @@ export default {
         };
         getLearnWebContent(MethodName, data).then((res) => {
           msgItem.is_read = "true";
+          this.getNotReadMessage();
           if (msgItem.message_type == 101) {
             window.location.href = `/GCLS-Learn/#/EnterSys?tab=TaskList&enter=main&dateStamp=${date[0]}`;
           }
@@ -181,6 +181,14 @@ export default {
         }
       }
     },
+    //是否存在我未阅读的消息
+    getNotReadMessage() {
+      let MethodName = "message-message_manager-IsExistMyMessage_NotRead";
+      let data = {};
+      getLearnWebContent(MethodName, data).then((res) => {
+        this.$store.dispatch("message/updateIsExist", res.is_exist);
+      });
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},

+ 3 - 3
src/components/common/Header.vue

@@ -96,7 +96,6 @@ export default {
   props: [],
   data() {
     return {
-      is_exist: "false",
       activeIndex: "2", // 主导航索引
       LoginNavIndex: 0, //下拉框导航索引
       projectName: "个人中心",
@@ -160,7 +159,7 @@ export default {
   },
   watch: {},
   computed: {
-    ...mapGetters(["language_type"]),
+    ...mapGetters(["language_type", "is_exist"]),
   },
   methods: {
     // 前往个人中心
@@ -177,7 +176,8 @@ export default {
       let MethodName = "message-message_manager-IsExistMyMessage_NotRead";
       let data = {};
       getLearnWebContent(MethodName, data).then((res) => {
-        this.is_exist = res.is_exist;
+        // this.is_exist = res.is_exist;
+        this.$store.dispatch("message/updateIsExist", res.is_exist);
       });
     },
     // 切换导航

+ 8 - 0
src/settings.js

@@ -5,8 +5,16 @@ let config = Cookies.get('GCLS_Config')
 if (config) {
   let configObj = JSON.parse(config);
   title = configObj.title
+
+  var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
+  link.type = 'image/x-icon';
+  link.rel = 'shortcut icon';
+  link.href = configObj.title_icon_url;
+  document.getElementsByTagName('head')[0].appendChild(link);
+
 }
 console.log(title);
+
 module.exports = {
   title: title,
 

+ 1 - 0
src/store/getters.js

@@ -2,5 +2,6 @@ const getters = {
   sidebar: state => state.app.sidebar,
   device: state => state.app.device,
   language_type: state => state.lang.language_type,
+  is_exist: state => state.message.is_exist,
 }
 export default getters

+ 3 - 1
src/store/index.js

@@ -4,6 +4,7 @@ import getters from './getters'
 import app from './modules/app'
 import settings from './modules/settings'
 import lang from './modules/lang'
+import message from './modules/message'
 
 Vue.use(Vuex)
 
@@ -11,7 +12,8 @@ const store = new Vuex.Store({
   modules: {
     app,
     settings,
-    lang
+    lang,
+    message
   },
   getters
 })

+ 24 - 0
src/store/modules/message.js

@@ -0,0 +1,24 @@
+const state = {
+  is_exist: "false"
+}
+
+const mutations = {
+  SET_IS_EXIST: (state, is_exist) => {
+    state.is_exist = is_exist;
+  },
+}
+
+const actions = {
+  // 用户更换语言类型
+  updateIsExist({ commit }, is_exist) {
+    commit('SET_IS_EXIST', is_exist)
+  },
+}
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}
+

+ 1 - 1
src/utils/get-page-title.js

@@ -1,6 +1,6 @@
 import defaultSettings from '@/settings'
 
-const title = defaultSettings.title || 'Vue Admin Template'
+const title = defaultSettings.title || '个人中心'
 
 export default function getPageTitle(pageTitle) {
   if (pageTitle) {

+ 3 - 3
vue.config.js

@@ -15,7 +15,7 @@ const name = defaultSettings.title || '个人中心' // page title
 // For example, Mac: sudo npm run
 // You can change the port by the following methods:
 // port = 9528 npm run dev OR npm run dev --port = 9528
-const port = process.env.port || process.env.npm_config_port || 9528 // dev port
+const port = process.env.port || process.env.npm_config_port || 9590 // dev port
 
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
@@ -42,8 +42,8 @@ module.exports = {
       // change xxx-api/login => mock/login
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        //target: `http://gcls.utschool.cn/`,
-        target: `https://gcls.helxsoft.cn/`,
+        target: `http://gcls.utschool.cn/`,
+        //target: `https://gcls.helxsoft.cn/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''