Merge branch 'master' of ssh://192.168.0.10:29418/pcalife/PAM
| | |
| | | } |
| | | .message-content{ |
| | | max-height: 150px; |
| | | overflow: auto; |
| | | max-width: 100%; |
| | | word-wrap: break-word; |
| | | overflow-y: auto; |
| | | margin-top: 10px; |
| | | color: $PRIMARY_BLACK; |
| | | letter-spacing: 2px; |
| | |
| | | text-align: center; |
| | | font-size: 20px; |
| | | font-weight: bolder; |
| | | line-height: 1.5; |
| | | color: $PRIMARY_BLACK; |
| | | } |
| | | } |
| | |
| | | switch (error.response.status) { |
| | | case 401: |
| | | Promise.all([ErrorMessageBox('登入逾時'),window.$nuxt.$store.dispatch('localStorage/actionStorageClear')]).then(()=>{ |
| | | location.href='/'; |
| | | _.isEqual(window.$nuxt.$route.name, 'index') ? location.reload() : window.$nuxt.$router.push('/'); |
| | | }); |
| | | break; |
| | | |
| | |
| | | import { MessageBox } from 'element-ui'; |
| | | import { MessageBoxData } from 'element-ui/types/message-box'; |
| | | import * as _ from 'lodash'; |
| | | |
| | | export default function ErrorMessageBox(errorMsg?:string, errorObj?: any):Promise<MessageBoxData>{ |
| | | errorMsg && console.info('Error: ', errorMsg); |
| | |
| | | |
| | | return MessageBox({ |
| | | message: errorMsg |
| | | ? errorMsg |
| | | ? `${breakTextByComma(errorMsg)}` |
| | | : `<div class="message-header"> 系統發生錯誤: ${errorObj?.response?.status} </div> |
| | | <div class="message-content">${errorObj?.response?.data?.detail}</div>`, |
| | | dangerouslyUseHTMLString: true, |
| | |
| | | closeOnClickModal:false, |
| | | }); |
| | | } |
| | | // 暫時用逗號去斷行 |
| | | function breakTextByComma(errorMsg:string):string{ |
| | | return _.split(errorMsg,",").join('<br>'); |
| | | } |
| | |
| | | this.loginWithConsultant() |
| | | }else{ |
| | | this.clearValue(); |
| | | this.regenerateImgOfVerification(); |
| | | ErrorMessageBox('驗證碼輸入錯誤'); |
| | | } |
| | | }); |
| | |
| | | } |
| | | private checkHttpErrorStatus(error:any):void{ |
| | | this.clearValue(); |
| | | this.regenerateImgOfVerification(); |
| | | switch (error.response.status) { |
| | | case 401: |
| | | const errorMsg = error.response.data.detail; |