Update#170413: [前端] 串接 /api/access_analysis/insert
| | |
| | | import { Vue, Component, State, Action, Watch, namespace } from 'nuxt-property-decorator'; |
| | | |
| | | import appointmentService from '~/shared/services/appointment.service'; |
| | | import utilService, {AccessFroms} from '~/shared/services/utils.service'; |
| | | import reviewsService from '~/shared/services/reviews.service'; |
| | | import UtilsService from '~/shared/services/utils.service'; |
| | | import myConsultantService from '~/shared/services/my-consultant.service'; |
| | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | mounted() { |
| | | if (this.$route.query.from) { |
| | | utilService.insertAccessFrom(this.$route.query.from as AccessFroms); |
| | | } |
| | | if (this.isAdminLogin) { |
| | | this.$router.push('/myAppointmentList/appointmentList'); |
| | | } else { |
| | |
| | | '/eService/authenticate', |
| | | '/login/validate/get_img_code', |
| | | '/login/validate/verify_img_code', |
| | | '/api/access_analysis/insert' |
| | | ]; |
| | | |
| | | export const http = axios.create({ |
| | | baseURL: process.env.BASE_URL, |
| | | withCredentials: true |
| | | withCredentials: true, |
| | | }); |
| | | |
| | | let apiNumber = 0; |
| | |
| | | |
| | | function addHttpHeader(config: AxiosRequestConfig): void { |
| | | config.headers = { |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token') |
| | | Authorization: 'Bearer ' + localStorage.getItem('id_token'), |
| | | 'content-type': 'application/json' |
| | | } |
| | | } |
| | | |
| | |
| | | import { http } from "./httpClient"; |
| | | import {AppointmentMemoInfo, createdMemoInfo} from "~/shared/models/appointment.model"; |
| | | class UtilsService { |
| | | |
| | | isMobileDevice(): boolean { |
| | |
| | | return mobileDevices.some(e => navigator.userAgent.match(e)); |
| | | } |
| | | |
| | | insertAccessFrom(from: AccessFroms): void { |
| | | http.post('/access_analysis/insert', from); |
| | | } |
| | | |
| | | } |
| | | |
| | | export default new UtilsService(); |
| | | |
| | | export enum AccessFroms { |
| | | FILM_1 = 'FILM_1', |
| | | FILM_2 = 'FILM_2', |
| | | } |