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

321

parent 51d6bef7
module.exports = { module.exports = {
root: true, root: true,
env: { "env": {
node: true "browser": true,
"es6": true
}, },
'extends': [ "parser":"vue-eslint-parser",
'plugin:vue/essential', "extends": [
'eslint:recommended', "eslint:recommended",
'@vue/typescript/recommended' "plugin:vue/essential",
], "plugin:@typescript-eslint/eslint-recommended"
parserOptions: { ]
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
} }
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({ ...@@ -12,7 +12,8 @@ export default Vue.extend({
// 'app-icon':()=>import('./components/common/Icon.vue'), // 'app-icon':()=>import('./components/common/Icon.vue'),
// 'main-page': () => import('@/layout/main-page.vue') // 'main-page': () => import('@/layout/main-page.vue')
}, },
name: 'App' name: 'App',
}) })
</script> </script>
......
interface Punch{ interface Punch{
date:String, date:string,
time:String, time:string,
isLocal:Boolean, isLocal:boolean,
location?:String, location?:string,
note?:String, note?:string
} }
/* /*
...@@ -17,7 +17,7 @@ note?:备注 ...@@ -17,7 +17,7 @@ note?:备注
/* /*
state:今日考勤状态 '异常','正常','早退' state:今日考勤状态 '异常','正常','早退'
*/ */
const state:string = '异常' const state:'异常'|'正常'|'早退' = '异常'
const punchList:Array<Punch>=[ const punchList:Array<Punch>=[
{ {
......
...@@ -6,12 +6,12 @@ import store from './store' ...@@ -6,12 +6,12 @@ import store from './store'
import "tailwindcss/tailwind.css" import "tailwindcss/tailwind.css"
import './style.less' import './style.less'
import utils from '@/util' import utils from '@/util'
import service from './service'
import { Dialog, Toast, Notify }from 'vant' import { Dialog, Toast, Notify }from 'vant'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Dialog).use(Toast).use(Notify) Vue.use(Dialog).use(Toast).use(Notify)
Vue.use(utils) Vue.use(utils).use(service)
new Vue({ new Vue({
router, router,
......
...@@ -5,9 +5,8 @@ import router from '@/router' ...@@ -5,9 +5,8 @@ import router from '@/router'
import { Toast } from 'vant' import { Toast } from 'vant'
export class Service { export default class BaseService {
public service: AxiosInstance; public service: AxiosInstance;
constructor() { constructor() {
this.service = axios.create({ this.service = axios.create({
baseURL:'/proxyApi', baseURL:'/proxyApi',
...@@ -21,23 +20,13 @@ export class Service { ...@@ -21,23 +20,13 @@ export class Service {
return ret.data; return ret.data;
} }
return ret 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 => { this.service.post = (...res) => post(...res).then(ret => resolveData(ret.data)).catch(err => {
resolveData(err.response.data) resolveData(err.response.data)
}); });
} }
} }
\ No newline at end of file
import Staff from './moudles/Staff'
import { UserService } from './moudles/userService' export const service = {
staff: new Staff()
}
export default{ export default{
install(Vue:any) install(Vue:any)
{ {
Vue.prototype.$service = { Vue.prototype.$service = service
userService: new UserService()
}
} }
} }
......
import {Service} from '../base' import BaseService from '../base'
export class UserService extends Service { export default class Staff extends BaseService {
router = { router: any= {
// sendCode:{ path:'/verificationCode/send/sms', dataType:'application/x-www-form-urlencoded'}, 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(){ constructor(){
super() super()
} }
private getAuth(){
return 'Bearer' +''
}
/** /**
* 获取验证码 * 获取验证码
* @param phone * @param phone
* @param codeType 短信模板, 1:登录短信 2:修改密码 3:修改手机号 * @param codeType 短信模板, 1:登录短信 2:修改密码 3:修改手机号
*/ */
async getVerificationCode(telephone:string,codetype:string){ getVerificationCode(){
// return await this.service.post(this.router.sendCode.path,{},{ console.log(this.router);
// headers:{"Content-Type": this.router.sendCode.dataType},
// params:{"telephone":telephone, "codetype":codetype}
// })
} }
} }
......
import Vue from 'vue' import Vue from 'vue'
import { Common } from './service/common' import {service} from './service'
import { Service } from './service/index'
import { NFTService } from './service/nftService/nftService'
import { UserService } from './service/userService'
import { UTIL_INTERFACE } from '@/util/util.types' import { UTIL_INTERFACE } from '@/util/util.types'
import VueRouter, { Route } from 'vue-router' import VueRouter, { Route } from 'vue-router'
interface ServiceType { type Service = typeof service
userService: UserService
nftService: NFTService
common:Common
}
declare module 'vue/types/vue' { declare module 'vue/types/vue' {
interface Vue { interface Vue {
$service: ServiceType, $service: Service,
$router: VueRouter, $router: VueRouter,
$util:UTIL_INTERFACE $util:UTIL_INTERFACE
} }
......
...@@ -45,11 +45,11 @@ export default Vue.extend({ ...@@ -45,11 +45,11 @@ export default Vue.extend({
default: false default: false
}, },
files: { files: {
type: Array as PropType<Array<File>>, type: Array as PropType<File[]>,
default: [] default: []
}, },
selected: { selected: {
type: Array as PropType<Array<Number>>, type: Array as PropType<number[]>,
default: [] default: []
}, },
multiple: { multiple: {
......
...@@ -69,6 +69,10 @@ export default Vue.extend({ ...@@ -69,6 +69,10 @@ export default Vue.extend({
teamName: '企业名称', teamName: '企业名称',
} }
}, },
mounted(){
this.$service.staff.getVerificationCode()
},
methods: { methods: {
editTeamName() { editTeamName() {
console.log('edit') 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