master
parent
ae4b8fa2b5
commit
d03b032036
@ -1,3 +1,3 @@
|
||||
NODE_ENV = 'production'
|
||||
VUE_APP_URL = 'https://saas.kaidalai.cn/api/admin/'
|
||||
VUE_APP_STATIC = 'https://saas.kaidalai.cn/api/admin/'
|
||||
VUE_APP_URL = 'https://saas.kaidalai.cn/api/admin'
|
||||
VUE_APP_STATIC = 'https://saas.kaidalai.cn/api/admin'
|
@ -0,0 +1,24 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
],
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"vue"
|
||||
],
|
||||
"rules": {
|
||||
indent: ['error', 'tab'],
|
||||
'no-console': 'off',
|
||||
}
|
||||
};
|
@ -1,10 +0,0 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
// 登录
|
||||
export function loginTel(params) {
|
||||
return httpService({
|
||||
url: `/manage/loginTelCode`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
import httpService from "@/request"
|
||||
|
||||
// 注册
|
||||
export function register(params) {
|
||||
return httpService({
|
||||
url: `/register`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
// 登录
|
||||
export function loginPWD(params) {
|
||||
return httpService({
|
||||
url: `/loginPWD`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
// 登录
|
||||
export function loginTelCode(params) {
|
||||
return httpService({
|
||||
url: `/loginTelCode`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
// 验证码
|
||||
export function sendTelCode(params) {
|
||||
return httpService({
|
||||
url: `/sendTelCode`,
|
||||
method: 'post',
|
||||
data: params,
|
||||
})
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
import axios from 'axios'
|
||||
import qs from 'qs'
|
||||
export default {
|
||||
install: function (Vue) {
|
||||
//axios
|
||||
Vue.prototype.$axios = axios
|
||||
Vue.prototype.qs = qs
|
||||
// 上传
|
||||
Vue.prototype.$upload = process.env.VUE_APP_URL + 'admin/user/upload/uploadImg'
|
||||
// 静态地址
|
||||
Vue.prototype.$ImgUrl = (src) => {
|
||||
return process.env.VUE_APP_STATIC + '/' + src
|
||||
}
|
||||
// 时间格式化
|
||||
Vue.prototype.formatDate = (time, fmt) => {
|
||||
if (time > 0) {
|
||||
let date = new Date(time * 1000)
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
}
|
||||
let o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
}
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + ''
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length))
|
||||
}
|
||||
}
|
||||
return fmt
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue