瀏覽代碼

找回密码

luyanan 6 年之前
父節點
當前提交
7e337dd8ef

+ 12 - 2
src/components/bench-views/WorkHead.vue

@ -17,8 +17,8 @@
17 17
                  <div class="triangle"></div>
18 18
                  <ul>
19 19
                    <li @click="updateInfo"> <span class="icon1"></span>修改资料</li>
20
                    <li> <span class="icon2"></span>账户设置</li>
21
                    <li> <span class="icon3"></span>退出登录</li>
20
                    <li @click="accoountInfo"> <span class="icon2"></span>账户设置</li>
21
                    <li @click="exitOut"> <span class="icon3"></span>退出登录</li>
22 22
                  </ul>
23 23
                </div>
24 24
              </el-collapse-transition>
@ -50,6 +50,16 @@
50 50
      },
51 51
      updateInfo() {
52 52
        this.$router.push({path: '/updateInfo'});
53
      },
54
      accoountInfo() {
55
        this.$router.push({path: '/AccountSettings'});
56
      },
57
      exitOut() {
58
        Cookies.set('plf_user', null, { path: '/' });
59
        Cookies.set('plf_name', null, { path: '/' });
60
        Cookies.set('plf_logo', null, { path: '/' });
61
        Cookies.set('plf_email', null, { path: '/' });
62
        this.$router.push({path: '/home'});
53 63
      }
54 64
    },
55 65
    created() {

+ 20 - 20
src/components/bench-views/contentManagement/News.vue

@ -13,24 +13,24 @@
13 13

14 14
<script>
15 15
  import ArticleTemplate from '../ArticleTemplate.vue';
16
   export default {
17
     data() {
18
      return {
19
        keyValue: '',
20
        url: '/ajax/article/pageQuery',
21
        inValue: ''
22
       };
23
     },
24
     components: {
25
          ArticleTemplate
26
     },
27
     methods: {
28
     	 goPublishArt() {
29
         this.$router.push({path: '/PublishArticle'});
30
       },
31
       search() {
32
         this.keyValue = this.inValue;
33
       }
34
     }
35
   };
16
    export default {
17
      data() {
18
        return {
19
          keyValue: '',
20
          url: '/ajax/article/pageQuery',
21
          inValue: ''
22
        };
23
      },
24
      components: {
25
        ArticleTemplate
26
      },
27
      methods: {
28
        goPublishArt() {
29
          this.$router.push({path: '/PublishArticle'});
30
        },
31
        search() {
32
          this.keyValue = this.inValue;
33
        }
34
      }
35
    };
36 36
</script>

+ 106 - 44
src/components/form-views/findPwd.vue

@ -13,20 +13,20 @@
13 13
        </div>
14 14

15 15
        <div class="step-contain">
16
          <el-form v-show="!isStepShow" :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
16
          <el-form v-show="stepFisrt" :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
17 17
            <el-form-item prop="mail">
18 18
              <el-input v-model="ruleForm.mail" placeholder="请输入邮箱账号"></el-input>
19 19
            </el-form-item>
20 20
            <el-form-item></el-form-item>
21
            <el-form-item>
22
              <el-button type="primary" :disabled="isDisabl" @click="nextStep">下一步</el-button>
23
              <el-button type="text" @click="goLogin">又想起来了</el-button>
21
            <el-form-item class="textButton-box">
22
              <el-button type="primary" :disabled="isDisabl" @click="nextStep('ruleForm')">下一步</el-button>
23
              <el-button class="textButton" type="text" @click="goLogin">又想起来了</el-button>
24 24
            </el-form-item>
25 25
          </el-form>
26
          <el-form v-show="isStepShow" class="demo-ruleForm">
26
          <el-form v-show="stepSecond" class="demo-ruleForm">
27 27
            <el-form-item>
28 28
              <p class="importTip">密码找回邮件已发送至:<br />
29
                <span class="mainTip" id="emailShow">jdksgjksdgjsdhgs</span>
29
                <span class="mainTip" id="emailShow">{{ruleForm.mail}}</span>
30 30
              </p>
31 31
              <p class="smallTip">请您在10分钟内登录您的企业邮箱,接收邮件,<br />点击链接后即可重置密码。</p>
32 32
            </el-form-item>
@ -35,7 +35,7 @@
35 35
              <el-button type="primary" @click="goToMail">登录邮箱</el-button>
36 36
            </el-form-item>
37 37
          </el-form>
38
          <el-form v-show="!isStepShow" :model="ruleForm2" :rules="rules2" ref="ruleForm2" class="demo-ruleForm">
38
          <el-form v-show="stepThird" :model="ruleForm2" :rules="rules2" ref="ruleForm2" class="demo-ruleForm">
39 39
            <el-form-item prop="pass">
40 40
              <el-input type="password" v-model="ruleForm2.pass" placeholder="请设置您的新密码" auto-complete="off"></el-input>
41 41
            </el-form-item>
@ -44,7 +44,7 @@
44 44
            </el-form-item>
45 45
            <el-form-item></el-form-item>
46 46
            <el-form-item>
47
              <el-button type="primary" :disabled="isDisabl" @click="resetPwd">重置密码</el-button>
47
              <el-button type="primary" :disabled="isDisabl" @click="resetPwd('ruleForm2')">重置密码</el-button>
48 48
            </el-form-item>
49 49
          </el-form>
50 50
        </div>
@ -54,8 +54,12 @@
54 54
</template>
55 55

56 56
<script type="text/ecmascript-6">
57
  import Cookies from 'js-cookie';
58
  import httpUrl from '@/libs/http';
59
  import util from '@/libs/util';
60

57 61
  export default {
58
     data() {
62
    data() {
59 63
      var validatePass = (rule, value, callback) => {
60 64
        if (value === '') {
61 65
          callback(new Error('请设置您的新密码'));
@ -78,8 +82,13 @@
78 82
        }
79 83
      };
80 84
      return {
85
        platId: '',
86
        resetStepNum: '',
87
        resetCode: '',
81 88
        stepVal: 0,
82
        isStepShow: true,
89
        stepFisrt: true,
90
        stepSecond: false,
91
        stepThird: false,
83 92
        isDisabl: false,
84 93
        ruleForm: {
85 94
          mail: ''
@ -104,42 +113,98 @@
104 113
        }
105 114
      };
106 115
    },
116
    created() {
117
      this.platId = Cookies.get('platId');
118
      this.resetStepNum = util.urlParse('step');
119
      this.resetCode = util.urlParse('sc');
120
      if (this.resetStepNum === '2') {
121
        this.stepFisrt = false;
122
        this.stepSecond = false;
123
        this.stepThird = true;
124
        this.stepVal = 2;
125
      }
126
    },
107 127
    methods: {
108
      nextStep() {
109
        return this.stepVal++ > 2;
128
      nextStep(formName) {
129
        this.$refs[formName].validate((valid) => {
130
          if (valid) {
131
            this.$axios.post(httpUrl.hQuery.sign.reqResetPw, {
132
              id: this.platId,
133
              mail: this.ruleForm.mail,
134
              url: httpUrl.platUrl + '/findPwd?step=2&sc'
135
            }).then(res => {
136
              console.log(res);
137
              if (res.success) {
138
                this.stepFisrt = false;
139
                this.stepSecond = true;
140
                this.stepVal = 1;
141
              } else {
142
                let errorCode = [{
143
                  code: -600001,
144
                  msg: '用户不存在'
145
                }, {
146
                  code: -600002,
147
                  msg: '发送邮箱错误'
148
                }];
149
                for (let i = 0; i < errorCode.length; i++) {
150
                  if (res.code === errorCode[i].code) {
151
                    this.$message.error(errorCode[i].msg);
152
                    return;
153
                  };
154
                };
155
              }
156
            });
157
          } else {
158
            return false;
159
          }
160
        });
161
      },
162
      goToMail() {
163
        var url = this.ruleForm.mail.split('@')[1];
164
        if (util.mailHash[url] === undefined) {
165
          window.open('http://mail.' + url);
166
        } else {
167
          window.open(util.mailHash[url]);
168
        }
110 169
      },
111 170
      resetPwd(formName) {
112 171
        this.$refs[formName].validate((valid) => {
113 172
          if (valid) {
114
            // this.$axios.post(httpUrl.workbench.fingPwd, paramsData).then(res => {
115
            //   this.logining = false;
116
            //   console.log(res);
117
            //   if (res.success) {
118
            //     this.$router.push({path: '/loginPlat'});
119
            //   } else {
120
            //     let errorCode = [{
121
            //       code: -600001,
122
            //       msg: '用户不存在'
123
            //     }, {
124
            //       code: -600002,
125
            //       msg: '密码不正确'
126
            //     }, {
127
            //       code: -600003,
128
            //       msg: '平台信息不存在'
129
            //     }, {
130
            //       code: -600004,
131
            //       msg: '用户被禁用'
132
            //     }];
133
            //     for (let i = 0; i < errorCode.length; i++) {
134
            //       if (res.code === errorCode[i].code) {
135
            //         this.$message.error(errorCode[i].msg);
136
            //         return;
137
            //       };
138
            //     };
139
            //   }
140
            // }).catch(error => {
141
            //   console.log(error);
142
            // });
173
            this.$axios.post(httpUrl.hQuery.sign.resetpw, {
174
              code: this.resetCode,
175
              pw: this.ruleForm2.pass
176
            }).then(res => {
177
              console.log(res);
178
              if (res.success) {
179
                this.$alert('您可以使用新密码登录您的账户了', '恭喜您,您的密码重置成功!', {
180
                  confirmButtonText: '重新登录',
181
                  type: 'success',
182
                  center: true,
183
                  callback: action => {
184
                    if (action === 'confirm') {
185
                      this.$router.push({path: '/loginPlat'});
186
                    };
187
                  }
188
                });
189
              } else {
190
                if (res.code === -600001) {
191
                  this.$alert('小提示:邮件内的链接有效时长为10分钟', '很抱歉,当前的链接已失效。', {
192
                    confirmButtonText: '重新找回密码',
193
                    type: 'warning',
194
                    center: true,
195
                    callback: action => {
196
                      if (action === 'confirm') {
197
                        this.stepFisrt = true;
198
                        this.stepSecond = false;
199
                        this.stepThird = false;
200
                        this.stepVal = 0;
201
                      };
202
                    }
203
                  });
204
                  return;
205
                };
206
              };
207
            });
143 208
          } else {
144 209
            return false;
145 210
          }
@ -147,9 +212,6 @@
147 212
      },
148 213
      goLogin() {
149 214
        this.$router.push({path: '/loginPlat'});
150
      },
151
      goToMail() {
152
        this.$router.push({path: '/loginPlat'});
153 215
      }
154 216
    }
155 217
  };

+ 12 - 1
src/components/form-views/style.styl

@ -37,8 +37,20 @@
37 37

38 38
  .step-wrapper
39 39
    margin-bottom:30px
40
    .el-step__head.is-process
41
      color: $mainColor
42
      border-color: $mainColor
43
    .el-step__title.is-process
44
      color: $mainColor
45
    .el-step__description.is-process
46
      color: $mainColor
40 47
  .step-contain
41 48
    text-align:center
49
    .textButton-box
50
      height:60px
51
      .textButton
52
        position:absolute
53
        left:0
42 54
    .importTip
43 55
      font-size: 18px
44 56
      margin: 10px 0
@ -48,4 +60,3 @@
48 60
      color:$secondaryFont
49 61
      line-height:16px
50 62
      font-size:13px
51


+ 1 - 1
src/components/main-views/TheFooter.vue

@ -48,7 +48,7 @@
48 48
        this.plf_user = Cookies.get('plf_user');
49 49
      },
50 50
      goWorkBench() {
51
        if (this.plf_user) {
51
        if (this.plf_user && this.plf_user != "null" && this.plf_user != null) {
52 52
          this.$router.push({path: '/WorkHome'});
53 53
        } else {
54 54
          this.$router.push({path: '/loginPlat'});

+ 8 - 0
src/components/sub-component/BaseArticle.vue

@ -23,6 +23,11 @@
23 23
        type: Object
24 24
      }
25 25
    },
26
    // data() {
27
    //   return: {
28
    //     ownerInfo: util.ownerInfo(this, item.articleType, item.owmerId)
29
    //   };
30
    // },
26 31
    methods: {
27 32
      articleUrl(item) {
28 33
        return item.articleImg ? util.ImageUrl('article/' + item.articleImg) : util.defaultSet.img.article;
@ -30,6 +35,9 @@
30 35
      linkArticle(item) {
31 36
        return util.pageUrl('a', item);
32 37
      },
38
      // ownerBeyond(item) {
39
      //   return util.ownerInfo(this, item.articleType, item.owmerId);
40
      // },
33 41
      formTime(item) {
34 42
        return util.commenTime(item.publishTime);
35 43
      }

+ 5 - 4
src/libs/http.js

@ -3,9 +3,10 @@ let http = { };
3 3
4 4
// const kexiuUrl = 'https://www.ekexiu.com';
5 5
const kexiuUrl = 'http://192.168.3.233:81';
6
const platUrl = 'http://localhost:7070';
7
const utilUrl = platUrl + '/ajax';
6 8
7
const utilUrl = 'http://localhost:7070/ajax';
8
9
http.platUrl = platUrl;
9 10
http.utilUrl = utilUrl;
10 11
http.kexiuUrl = kexiuUrl;
11 12
@ -55,7 +56,7 @@ http.hQuery = {
55 56
    },
56 57
    demand: {
57 58
      nopq: utilUrl + '/demand/search/platform', // 查询在平台发布的需求
58
      add: utilUrl + '/demand/publishInPlatform', // 平台新增需求
59
      add: utilUrl + '/demand/publishInPlatform' // 平台新增需求
59 60
    },
60 61
    addOrgs: utilUrl + '/platform/add/info', // 增加企业
61 62
    queryWare: utilUrl + '/platform/info/wares', // 找服务
@ -71,7 +72,7 @@ http.kxQurey = {
71 72
      imgVC: utilUrl + '/PictureVC' // 图形验证
72 73
    },
73 74
    demand: {
74
      add: utilUrl + '/demand', // 新增需求
75
      add: utilUrl + '/demand' // 新增需求
75 76
    },
76 77
    article: {
77 78
      save: utilUrl + '/article/save', // 新增文章

+ 74 - 2
src/libs/util.js

@ -1,6 +1,6 @@
1
import http from './http.js';
1
import httpUrl from './http.js';
2 2
3
let ekexiuUrl = http.kexiuUrl;
3
let ekexiuUrl = httpUrl.kexiuUrl;
4 4
5 5
let util = {
6 6
@ -36,6 +36,48 @@ util.pageUrl = function(type, item) {
36 36
  return (ekexiuUrl + '/shtml/' + type + '/' + item.createTime.substring(0, 8) + '/' + item.shareId + '.html');
37 37
};
38 38
39
/**
40
 * 正则匹配邮箱、手机
41
 * flag === 'mail' 是邮箱, flag === 'tel' 是手机
42
 */
43
util.regular = function(str, flag) {
44
  if (flag === 'mail') {
45
    var regMail = /^[a-zA-Z0-9_-] + @[a-zA-Z0-9_-] + (\.[a-zA-Z0-9_-]+) + $/;
46
    return regMail.test(str);
47
  } else if (flag === 'tel') {
48
    var regTel = /^1[3|4|5|7|8][0-9]\d{8}$/;
49
    return regTel.test(str);
50
  };
51
};
52
53
/**
54
 * 邮箱mailHash
55
 */
56
util.mailHash = {
57
  'qq.com': 'http://mail.qq.com',
58
  'gmail.com': 'http://mail.google.com',
59
  'sina.com': 'http://mail.sina.com.cn',
60
  '163.com': 'http://mail.163.com',
61
  '126.com': 'http://mail.126.com',
62
  'yeah.net': 'http://www.yeah.net/',
63
  'sohu.com': 'http://mail.sohu.com/',
64
  'tom.com': 'http://mail.tom.com/',
65
  'sogou.com': 'http://mail.sogou.com/',
66
  '139.com': 'http://mail.10086.cn/',
67
  'hotmail.com': 'http://www.hotmail.com',
68
  'live.com': 'http://login.live.com/',
69
  'live.cn': 'http://login.live.cn/',
70
  'live.com.cn': 'http://login.live.com.cn',
71
  '189.com': 'http://webmail16.189.cn/webmail/',
72
  'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
73
  'yahoo.cn': 'http://mail.cn.yahoo.com/',
74
  'eyou.com': 'http://www.eyou.com/',
75
  '21cn.com': 'http://mail.21cn.com/',
76
  '188.com': 'http://www.188.com/',
77
  'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
78
  'foxmail.coom': 'http://www.foxmail.com'
79
};
80
39 81
/**
40 82
 * 数据字典
41 83
 */
@ -217,4 +259,34 @@ util.dateFormatter = function(str, fl, bol) { // 默认返回yyyy-MM-dd HH-mm-ss
217 259
    }
218 260
};
219 261
262
util.dateChange = function(startTime) { // 默认返回yyyy月MM日dd HH:mm
263
    var nowTimg = new Date();
264
    if (nowTimg.getFullYear() !== startTime.substring(0, 4)) {
265
        return startTime.substring(4, 6).replace(/\b(0+)/gi, '') + '月' + startTime.substring(6, 8).replace(/\b(0+)/gi, '') + '日 ' + startTime.substring(8, 10) + ':' + startTime.substring(10, 12);
266
    } else {
267
        return startTime.substring(0, 4) + '年' + startTime.substring(4, 6).replace(/\b(0+)/gi, '') + '月' + startTime.substring(6, 8).replace(/\b(0+)/gi, '') + '日 ' + startTime.substring(8, 10) + ':' + startTime.substring(10, 12);
268
    }
269
};
270
271
/**
272
 * 获取ownerInfo(org\professor)
273
 * fl === 'professor' 或者 fl === 'org'
274
 */
275
util.ownerInfo = function(vm, type, ownerId) {
276
  var url;
277
  if (type === '1') {
278
    url = httpUrl.kxQurey.professor.query;
279
  } else if (type === '2') {
280
    url = httpUrl.kxQurey.org.query;
281
  };
282
283
  vm.$axios.get(url + '/' + ownerId, {
284
  }).then((res) => {
285
    if (res.success) {
286
      var $info = res.data;
287
      return $info;
288
    };
289
  });
290
};
291
220 292
export default util;

+ 2 - 1
src/router/index.js

@ -7,7 +7,8 @@ Vue.use(VueRouter);
7 7
8 8
// 路由配置
9 9
const RouterConfig = {
10
    // mode: 'history',
10
		hashbang: false,
11
    mode: 'history',
11 12
    routes: routers
12 13
};
13 14