Commit 6300bfda authored by hanfeng zhang's avatar hanfeng zhang

321

parent 51d6bef7
module.exports = {
root: true,
env: {
node: true
"env": {
"browser": true,
"es6": true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
"parser":"vue-eslint-parser",
"extends": [
"eslint:recommended",
"plugin:vue/essential",
"plugin:@typescript-eslint/eslint-recommended"
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,7 +12,8 @@ export default Vue.extend({
// 'app-icon':()=>import('./components/common/Icon.vue'),
// 'main-page': () => import('@/layout/main-page.vue')
},
name: 'App'
name: 'App',
})
</script>
......
interface Punch{
date:String,
time:String,
isLocal:Boolean,
location?:String,
note?:String,
date:string,
time:string,
isLocal:boolean,
location?:string,
note?:string
}
/*
......@@ -17,7 +17,7 @@ note?:备注
/*
state:今日考勤状态 '异常','正常','早退'
*/
const state:string = '异常'
const state:'异常'|'正常'|'早退' = '异常'
const punchList:Array<Punch>=[
{
......
......@@ -6,12 +6,12 @@ import store from './store'
import "tailwindcss/tailwind.css"
import './style.less'
import utils from '@/util'
import service from './service'
import { Dialog, Toast, Notify }from 'vant'
Vue.config.productionTip = false
Vue.use(Dialog).use(Toast).use(Notify)
Vue.use(utils)
Vue.use(utils).use(service)
new Vue({
router,
......
......@@ -5,11 +5,10 @@ import router from '@/router'
import { Toast } from 'vant'
export class Service {
export default class BaseService {
public service: AxiosInstance;
constructor() {
this.service = axios.create({
this.service = axios.create({
baseURL:'/proxyApi',
timeout: 15000,
})
......@@ -21,23 +20,13 @@ export class Service {
return ret.data;
}
return ret
}/*else {
if(ret.code === 401){
await logoutUser().then(()=>{
router.push({name:'Login'})
})
}
Toast.fail(typeof ret.data === "string" ? ret.data : ret.message)
throw new Error(ret.message)
}*/
}
}
this.service.get = (...res) => get(...res).then(ret => resolveData(ret.data)).catch(err => {
resolveData(err.response.data)
})
this.service.post = (...res) => post(...res).then(ret => resolveData(ret.data)).catch(err => {
resolveData(err.response.data)
});
}
}
\ No newline at end of file
import { UserService } from './moudles/userService'
import Staff from './moudles/Staff'
export const service = {
staff: new Staff()
}
export default{
install(Vue:any)
{
Vue.prototype.$service = {
userService: new UserService()
}
Vue.prototype.$service = service
}
}
......
import {Service} from '../base'
import BaseService from '../base'
export class UserService extends Service {
router = {
// sendCode:{ path:'/verificationCode/send/sms', dataType:'application/x-www-form-urlencoded'},
export default class Staff extends BaseService {
router: any= {
accept:{ path:'/v1/enterprise/accept-join'},
create:{ path:'/v1/enterprise/create'},
delete:{ path:'/v1/enterprise/delete'},
info:{ path:'/v1/enterprise/info'},
update:{ path:'/v1/enterprise/update'},
leader:{ path:'/v1/enterprise/update-leader'}
}
constructor(){
super()
}
private getAuth(){
return 'Bearer' +''
}
/**
* 获取验证码
* @param phone
* @param codeType 短信模板, 1:登录短信 2:修改密码 3:修改手机号
*/
async getVerificationCode(telephone:string,codetype:string){
// return await this.service.post(this.router.sendCode.path,{},{
// headers:{"Content-Type": this.router.sendCode.dataType},
// params:{"telephone":telephone, "codetype":codetype}
// })
getVerificationCode(){
console.log(this.router);
}
}
......
import Vue from 'vue'
import { Common } from './service/common'
import { Service } from './service/index'
import { NFTService } from './service/nftService/nftService'
import { UserService } from './service/userService'
import {service} from './service'
import { UTIL_INTERFACE } from '@/util/util.types'
import VueRouter, { Route } from 'vue-router'
interface ServiceType {
userService: UserService
nftService: NFTService
common:Common
}
type Service = typeof service
declare module 'vue/types/vue' {
interface Vue {
$service: ServiceType,
$service: Service,
$router: VueRouter,
$util:UTIL_INTERFACE
}
......
......@@ -45,11 +45,11 @@ export default Vue.extend({
default: false
},
files: {
type: Array as PropType<Array<File>>,
type: Array as PropType<File[]>,
default: []
},
selected: {
type: Array as PropType<Array<Number>>,
type: Array as PropType<number[]>,
default: []
},
multiple: {
......
......@@ -69,6 +69,10 @@ export default Vue.extend({
teamName: '企业名称',
}
},
mounted(){
this.$service.staff.getVerificationCode()
},
methods: {
editTeamName() {
console.log('edit')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment