Commit cc3652f3 authored by nature's avatar nature

vw替换rem

parent e24861d0
...@@ -7,11 +7,7 @@ module.exports = merge(prodEnv, { ...@@ -7,11 +7,7 @@ module.exports = merge(prodEnv, {
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true, debug: true,
isMobilePlatform: false, isMobilePlatform: false,
hmapUrl:'"http://hippius.hand-china.com/hmap220"',
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="', basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"', appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"' currentVersion: '"1.0.0"'
}); });
...@@ -4,11 +4,7 @@ module.exports = { ...@@ -4,11 +4,7 @@ module.exports = {
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: false, debug: false,
isMobilePlatform: true, isMobilePlatform: true,
hmapUrl:'"http://hippius.hand-china.com/hmap220"',
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="', basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"', appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"' currentVersion: '"1.0.0"'
} }
...@@ -4,11 +4,7 @@ module.exports = { ...@@ -4,11 +4,7 @@ module.exports = {
CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV), CONFIG_ENV: JSON.stringify(process.env.CONFIG_ENV),
debug: true, debug: true,
isMobilePlatform: true, isMobilePlatform: true,
hmapUrl:'"http://hippius.hand-china.com/hmap220"',
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="', basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"', appId: '"com.hls.easy.car"',
currentVersion: '"1.0.0"' currentVersion: '"1.0.0"'
} }
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) --> <!-- safari私有meta标签 允许全屏模式浏览 指定safari顶部状态栏样式(黑色) -->
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<script type="text/javascript" src="./static/prototype.js"></script>
<title>车租易</title> <title>车租易</title>
</head> </head>
<body> <body>
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vux": "^2.9.2", "vux": "^2.9.2",
"axios": "^0.21.1",
"vuex": "^3.6.2",
"hls-easy-ui": "https://hel.hand-china.com/easyUI/hls-easy-ui.git" "hls-easy-ui": "https://hel.hand-china.com/easyUI/hls-easy-ui.git"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</template> </template>
<script> <script>
import {mapActions} from 'vuex'
export default { export default {
data () { data () {
return { return {
...@@ -39,8 +40,12 @@ ...@@ -39,8 +40,12 @@
}, },
}, },
mounted () { mounted () {
this.getUserInfo()
}, },
methods: { methods: {
...mapActions([
'getUserInfo',
]),
onSwipeLeft () { onSwipeLeft () {
this.$router.go(-1) this.$router.go(-1)
}, },
......
// The Vue build version to load with the `import` command // The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue' import Vue from 'vue'
// import FastClick from 'fastclick'
import App from './App' import App from './App'
import router from './router/index' import router from './router/index'
// import flexible from './common/ydui.flexible'
import {componentInstall, hlsPopup, directives, filter, prototype} from 'hls-easy-ui'
import {componentInstall, hlsPopup, directives, filter} from 'hls-easy-ui'
import store from './store'
/** /**
* http * http
*/ */
...@@ -31,10 +29,8 @@ Vue.use(filter) ...@@ -31,10 +29,8 @@ Vue.use(filter)
*/ */
Vue.use(componentInstall) Vue.use(componentInstall)
Vue.use(prototype)
Vue.prototype.hlsPopup = window.hlsPopup = hlsPopup Vue.prototype.hlsPopup = window.hlsPopup = hlsPopup
Vue.prototype.$devicePixelRatio = 2
let hlsHttp = { let hlsHttp = {
get: get, get: get,
...@@ -77,10 +73,6 @@ let hlsExit = function () { ...@@ -77,10 +73,6 @@ let hlsExit = function () {
} }
Vue.prototype.$hlsExit = hlsExit Vue.prototype.$hlsExit = hlsExit
// FastClick.attach(document.body)
Vue.config.productionTip = true
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
data () { data () {
...@@ -90,6 +82,7 @@ new Vue({ ...@@ -90,6 +82,7 @@ new Vue({
} }
}, },
router, router,
store,
watch: { // 监听路由变化 watch: { // 监听路由变化
$route (to, from) { $route (to, from) {
document.body.scrollTop = 0 document.body.scrollTop = 0
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import axios from 'axios' import axios from 'axios'
import {hlsPopup} from 'hls-easy-ui' import {hlsPopup} from 'hls-easy-ui'
import router from '../router/index' import router from '../router/index'
import qs from 'qs'
let promiseArr = {} let promiseArr = {}
let cancel = {} let cancel = {}
const CancelToken = axios.CancelToken const CancelToken = axios.CancelToken
...@@ -99,9 +100,11 @@ axios.interceptors.response.use(response => { ...@@ -99,9 +100,11 @@ axios.interceptors.response.use(response => {
}) })
axios.defaults.baseURL = '' axios.defaults.baseURL = ''
axios.defaults.timeout = 100000 axios.defaults.timeout = 100000
axios.defaults.paramsSerializer = (params) => {
return qs.stringify(params, {arrayFormat: 'repeat'})
}
// get请求 // get请求
export function get (url) { export function get (url, param = {}) {
let param = {}
let headers = {} let headers = {}
if (window.localStorage.access_token) { if (window.localStorage.access_token) {
headers = { headers = {
......
This diff is collapsed.
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
userInfo: '',
accessToken: '',
userId: '',
loginAccount: '',
employeeId: '',
employeeName: '',
employeeNum: '',
tenantId: '',
tenantName: '',
},
getters: {
getUserInfo: state => {
return state.userInfo
},
getToken: state => {
return state.accessToken
},
getUserId: state => {
return state.userId
},
getLoginAccount: state => {
return state.loginAccount
},
getEmployeeId: state => {
return state.employeeId
},
getEmployeeName: state => {
return state.employeeName
},
getEmployeeNum: state => {
return state.employeeNum
},
getTenantId: state => {
return state.tenantId
},
getTenantName: state => {
return state.tenantName
},
},
mutations: {
setUserInfo: (state, userInfo) => {
state.userInfo = userInfo
this.commit('setToken', userInfo.token)
this.commit('setUserId', userInfo.userId)
this.commit('setLoginAccount', userInfo.loginAccount)
this.commit('setEmployeeId', userInfo.employeeId)
this.commit('setEmployeeName', userInfo.employeeName)
this.commit('setEmployeeNum', userInfo.employeeNum)
this.commit('setTenantId', userInfo.tenantId)
this.commit('setTenantName', userInfo.tenantName)
},
setToken: (state, token) => {
localStorage.setItem('access_token', token)
state.accessToken = token
},
setUserId: (state, userId) => {
state.userId = userId
},
setLoginAccount: (state, loginAccount) => {
state.loginAccount = loginAccount
},
setEmployeeId: (state, employeeId) => {
state.roles = employeeId
},
setEmployeeName: (state, employeeName) => {
state.employeeName = employeeName
},
setEmployeeNum: (state, employeeNum) => {
state.employeeNum = employeeNum
},
setTenantId: (state, tenantId) => {
localStorage.setItem('tenantId', tenantId)
state.tenantId = tenantId
},
setTenantName: (state, tenantName) => {
state.tenantName = tenantName
},
},
actions: {
// 登录
getUserInfo ({ commit }) {
window.onSuccess = function (message) {
let userInfo = JSON.parse(message)
commit('setUserInfo', userInfo)
}
window.onError = function (message) {
var argument = {
className: 'BaseBridge',
function: 'closeWebView',
successCallBack: 'closeSuccess',
failCallBack: 'closeError',
}
HandBridge.postMessage(JSON.stringify(argument))
}
let params = {
className: 'BaseBridge',
function: 'getBaseInfo',
successCallBack: 'onSuccess',
failCallBack: 'onError',
}
HandBridge.postMessage(JSON.stringify(params))
},
},
})
export default store
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