Commit b335d09e authored by honghuiliu's avatar honghuiliu 💬

Merge remote-tracking branch 'origin/master'

parents 6b6904ea 1e668922
#!/bin/sh -l
#cd phone
#npm i
#npm run build
#\cp -rfp dist/* ../dist_phone
cd server
bee pack -a "qsh-wc-test" -exp=".git:.idea:phone:pc" exs="Dockerfile:build.sh"
\ No newline at end of file
#!/bin/sh -l
cd phone
npm i
npm run build
mv dist/env/prod.js dist/env.js
\cp -rfp dist/* ../dist_phone
cd ../
bee pack -a "cf_data_monitor_prod" -exp=".git:.idea:phone:pc" exs="Dockerfile:build.sh"
\ No newline at end of file
...@@ -5,10 +5,9 @@ import { ElMessage } from 'element-plus' ...@@ -5,10 +5,9 @@ import { ElMessage } from 'element-plus'
import {useStore} from '@/store/modules/app'; import {useStore} from '@/store/modules/app';
import myPublic from '@/utils/public'; import myPublic from '@/utils/public';
let id = 0; let id = 0;
const API_HOST = ''; const API_HOST = '/api';
const list = [ const list = [
'phone/sms/sendCode', 'web/login/login'
'phone/login/login'
]; ];
axios.interceptors.request.use(config => { axios.interceptors.request.use(config => {
// loading // loading
...@@ -53,7 +52,7 @@ function checkCode(res,url) { ...@@ -53,7 +52,7 @@ function checkCode(res,url) {
}); });
} }
if (res.code == 1000) { if (res.code == 1000) {
localStorage.removeItem('token'); localStorage.removeItem('qsh-wc-token');
location.href = location.origin+location.pathname+'#/login'; location.href = location.origin+location.pathname+'#/login';
return res return res
} }
......
import test from './test'; import http from '../getData';
export default { export default {
test:test, //用户登录
login(params) {
return http.post('web/login/login', params)
},
//公厕详情
getToiletDetail(params) {
return http.post('web/toilet/getToiletDetail', params)
},
//公厕列表
toiletList(params) {
return http.post('web/toilet/toiletList', params)
},
//工单列表
getPatrolList(params) {
return http.post('web/toilet/getPatrolList', params)
}
} }
import http from '../getData';
export default {
//待检查车辆
// getToCheck(params) {
// return http.post('phone/back_detail/getToCheck', params)
// }
}
...@@ -34,24 +34,27 @@ const router = createRouter({ ...@@ -34,24 +34,27 @@ const router = createRouter({
history: createWebHashHistory(process.env.BASE_URL), history: createWebHashHistory(process.env.BASE_URL),
routes routes
}); });
router.beforeEach((to, from, next) => { router.beforeEach(async (to, from, next) => {
const store = useStore(); const store = useStore();
// let token = myPublic.getStorage('token'); let token = myPublic.getStorage('qsh-wc-token')?myPublic.getStorage('qsh-wc-token'):myPublic.getUrlKey('token');
// if(!token){ if(!token){
// if(to.path!='/login'){ store.FirstGO(0);
// next({path:'/login'}) if(to.path!='/login'){
// }else{ next({path:'/login'})
// next(); }else{
// } next();
// }else{ }
// if(!store.state.token){ }else{
// store.commit('token',token); if(!store.token){
// } store.TOKEN(token);
// if(store.state.firstGo){ if(token!=myPublic.getStorage('qsh-wc-token')){
// myPublic.setStorage('qsh-wc-token',token);
// } }
// next() }
// } if(store.firstGo<3){
store.FirstGO(1);
}
next() next()
}
}); });
export default router export default router
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<p class="account-title">账户登录</p> <p class="account-title">账户登录</p>
<div class="row"> <div class="row">
<span class="icon icon-16"></span> <span class="icon icon-16"></span>
<input class="input" type="text" v-model="name" placeholder="请输入您的账号" /> <input class="input" type="text" v-model="username" placeholder="请输入您的账号" />
</div> </div>
<div class="row"> <div class="row">
<span class="icon icon-17"></span> <span class="icon icon-17"></span>
<input class="input" type="password" v-model="password" placeholder="请输入密码" /> <input class="input" type="password" v-model="password" placeholder="请输入密码" />
</div> </div>
<div class="opt"> <div class="opt">
<span class="btn">登录</span> <span class="btn" @click="submit">登录</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -23,16 +23,48 @@ ...@@ -23,16 +23,48 @@
<script> <script>
// @ is an alias to /src // @ is an alias to /src
import {reactive,ref} from "vue" import {reactive,toRefs} from "vue"
import {ElMessage} from "element-plus"
import api from "@/api/methods/index"
import myPublic from "@/utils/public"
import {useRouter} from "vue-router"
export default { export default {
name: 'login', name: 'login',
setup(props,{emit}){ setup(props,{emit}){
const router = useRouter();
const state = reactive({ const state = reactive({
name:'', username:'',
password:'' password:''
}); });
function submit() {
if(!state.username){
return ElMessage({
type:'warning',
message:'请输入用户名'
})
}
if(!state.password){
return ElMessage({
type:'warning',
message:'请输入密码'
})
}
api.login({
username:state.username,
password:state.password,
}).then(async (res)=>{
if(res.code==0){
if(res.data){
myPublic.setStorage("qsh-wc-token",res.data);
await router.replace({path:"/home"});
window.reload();
}
}
})
}
return { return {
...ref(state) ...toRefs(state),
submit
} }
}, },
components: {} components: {}
......
...@@ -59,16 +59,17 @@ module.exports = { ...@@ -59,16 +59,17 @@ module.exports = {
}, },
devServer:{ devServer:{
open:true, open:true,
// proxy: { port:80,
// '/phone_html/phone': { proxy: {
// target: 'http://127.0.0.1:14101/phone', '/api': {
// changeOrigin: true, target: 'http://qsh-wc-test.linanquan.com/api',
// pathRewrite: { changeOrigin: true,
// // '^/apis': ''表示把/apis替换为‘’(空字符串),这样既能使用代理, pathRewrite: {
// // 又能在请求接口api时去掉/apis,获得正确的短信api路径。 // '^/apis': ''表示把/apis替换为‘’(空字符串),这样既能使用代理,
// '^/phone_html/phone': '' // 又能在请求接口api时去掉/apis,获得正确的短信api路径。
// }, '^/api': ''
// } },
// } }
}
} }
}; };
...@@ -123,7 +123,7 @@ redis: ...@@ -123,7 +123,7 @@ redis:
password: "rRk2k3nf9JJi283lk119Jvwz" password: "rRk2k3nf9JJi283lk119Jvwz"
system: system:
env: public env: public
addr: 8888 addr: 9801
db-type: mysql db-type: mysql
oss-type: local oss-type: local
use-multipoint: false use-multipoint: false
......
{
"apps": [
{
"name": "cf-data-monitor-prod",
"exec_mode": "fork",
"autorestart": true,
"instances": 1,
"script": "cf_data_monitor_prod",
"node_args": [],
"args": [
],
"env": {
"GO_RUN_MODE": "prod"
}
}
]
}
{
"apps": [
{
"name": "qsh-wc-test",
"exec_mode": "fork",
"autorestart": true,
"instances": 1,
"script": "qsh-wc-test",
"node_args": [],
"args": [
],
"env": {
"GO_RUN_MODE": "test"
}
}
]
}
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