南网app登录配置

This commit is contained in:
BianLzhaoMin 2024-09-19 08:30:55 +08:00
parent 01e63e51d9
commit 579ad71cac
13 changed files with 668 additions and 665 deletions

View File

@ -18,29 +18,29 @@ class HttpConfig {
// baseUrl = "https://z.csgmall.com.cn/gl" // baseUrl = "https://z.csgmall.com.cn/gl"
// baseUrl = "http://192.168.2.160:39080" // 梁超 // baseUrl = "http://192.168.2.160:39080" // 梁超
// baseUrl = "http://192.168.2.218:39080" // 福 // baseUrl = "http://192.168.2.218:39080" // 福
target = "http://192.168.0.56:21627"; // 开发阶段后台ip target = "http://192.168.0.119:21624"; // 开发阶段后台ip
// #endif // #endif
// 基地址 (部署时使用 需要加 dev-api // 基地址 (部署时使用 需要加 dev-api
// authPath = `${this.baseUrl}/dev-api/auth` // authPath = `${this.baseUrl}/dev-api/auth`
// systemPath = `${this.baseUrl}/dev-api/system` // systemPath = `${this.baseUrl}/dev-api/system`
// basePath = `${this.baseUrl}/dev-api/base` // basePath = `${this.baseUrl}/dev-api/base`
// materialPath = `${this.baseUrl}/dev-api/material` // materialPath = `${this.baseUrl}/dev-api/material`
baseUrl = ENV === "production" ? "http://112.29.103.165:21626" : this.target; baseUrl = ENV === "production" ? "http://192.168.0.119:21624" : this.target;
authPath = authPath =
ENV === "production" ENV === "production"
? `${this.baseUrl}/dev-api/auth` ? `${this.baseUrl}/sgzbgl-api/auth`
: `${this.baseUrl}/auth`; : `${this.baseUrl}/auth`;
systemPath = systemPath =
ENV === "production" ENV === "production"
? `${this.baseUrl}/dev-api/system` ? `${this.baseUrl}/sgzbgl-api/system`
: `${this.baseUrl}/system`; : `${this.baseUrl}/system`;
basePath = basePath =
ENV === "production" ENV === "production"
? `${this.baseUrl}/dev-api/material/base` ? `${this.baseUrl}/sgzbgl-api/material/base`
: `${this.baseUrl}/material/base`; : `${this.baseUrl}/material/base`;
materialPath = materialPath =
ENV === "production" ENV === "production"
? `${this.baseUrl}/dev-api/material` ? `${this.baseUrl}/sgzbgl-api/material`
: `${this.baseUrl}/material`; : `${this.baseUrl}/material`;
// 短链 // 短链
serviceUrl = { serviceUrl = {

View File

@ -1,178 +1,183 @@
class Http { class Http {
get(baseUrl = '', url, data = {}, header = {}) { get(baseUrl = "", url, data = {}, header = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: baseUrl + url, url: baseUrl + url,
data: data, data: data,
method: "GET", method: "GET",
dataType: 'json', dataType: "json",
header: { header: {
'content-type': 'application/json', "content-type": "application/json",
'Authorization': uni.getStorageSync('token'), Authorization: uni.getStorageSync("token"),
...header ...header,
}, },
// 成功的回调 // 成功的回调
success(res) { success(res) {
if (res.data.code == 401) { if (res.data.code == 401) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '登录状态过期,请重新登录!', title: "登录状态过期,请重新登录!",
success: () => { success: () => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' // url: '/pages/login/login'
}) url: "/pages/nwLogin/index",
} });
}) },
} else { });
resolve(res) } else {
} resolve(res);
}, }
fail(err) { },
reject(err) fail(err) {
} reject(err);
}) },
}) });
} });
}
post(baseUrl = '', url, data = {}, header = {}) { post(baseUrl = "", url, data = {}, header = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: baseUrl + url, url: baseUrl + url,
data: data, data: data,
method: "POST", method: "POST",
dataType: 'json', dataType: "json",
header: { header: {
'content-type': 'application/json', "content-type": "application/json",
'Authorization': uni.getStorageSync('token'), Authorization: uni.getStorageSync("token"),
...header ...header,
}, },
// 成功的回调 // 成功的回调
success(res) { success(res) {
// console.log(res); // console.log(res);
if (res.data.code == 401) { if (res.data.code == 401) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '登录状态过期,请重新登录!', title: "登录状态过期,请重新登录!",
success: () => { success: () => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' // url: "/pages/login/login",
}) url: "/pages/nwLogin/index",
} });
}) },
} else { });
resolve(res) } else {
} resolve(res);
}, }
fail(err) { },
// console.log(err); fail(err) {
reject(err) // console.log(err);
} reject(err);
}) },
}) });
} });
}
put(baseUrl = '', url, data = {}, header = {}) { put(baseUrl = "", url, data = {}, header = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: baseUrl + url, url: baseUrl + url,
data: data, data: data,
method: "PUT", method: "PUT",
dataType: 'json', dataType: "json",
header: { header: {
'content-type': 'application/json', "content-type": "application/json",
'Authorization': uni.getStorageSync('token'), Authorization: uni.getStorageSync("token"),
...header ...header,
}, },
// 成功的回调 // 成功的回调
success(res) { success(res) {
if (res.data.code == 401) { if (res.data.code == 401) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '登录状态过期,请重新登录!', title: "登录状态过期,请重新登录!",
success: () => { success: () => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' // url: "/pages/login/login",
}) url: "/pages/nwLogin/index",
} });
}) },
} else { });
resolve(res) } else {
} resolve(res);
}, }
fail(err) { },
reject(err) fail(err) {
} reject(err);
}) },
}) });
} });
}
delete(baseUrl = '', url, data = {}, header = {}) { delete(baseUrl = "", url, data = {}, header = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: baseUrl + url, url: baseUrl + url,
data: data, data: data,
method: "DELETE", method: "DELETE",
dataType: 'json', dataType: "json",
header: { header: {
'content-type': 'application/json', "content-type": "application/json",
'Authorization': uni.getStorageSync('token'), Authorization: uni.getStorageSync("token"),
...header ...header,
}, },
// 成功的回调 // 成功的回调
success(res) { success(res) {
if (res.data.code == 401) { if (res.data.code == 401) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '登录状态过期,请重新登录!', title: "登录状态过期,请重新登录!",
success: () => { success: () => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' // url: "/pages/login/login",
}) url: "/pages/nwLogin/index",
} });
}) },
} else { });
resolve(res) } else {
} resolve(res);
}, }
fail(err) { },
reject(err) fail(err) {
} reject(err);
}) },
}) });
} });
}
upload(baseUrl = '', url, data = {}, header = {}) { upload(baseUrl = "", url, data = {}, header = {}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.uploadFile({ uni.uploadFile({
url: baseUrl + url, url: baseUrl + url,
filePath: data, filePath: data,
header: { header: {
'Authorization': uni.getStorageSync('token'), Authorization: uni.getStorageSync("token"),
...header ...header,
}, },
name: 'file', name: "file",
// 成功的回调 // 成功的回调
success(res) { success(res) {
if (res.data.code == 401) { if (res.data.code == 401) {
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '登录状态过期,请重新登录!', title: "登录状态过期,请重新登录!",
success: () => { success: () => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' // url: "/pages/login/login",
}) url: "/pages/nwLogin/index",
} });
}) },
} else { });
resolve(res) } else {
} resolve(res);
}, }
fail(err) { },
reject(err) fail(err) {
} reject(err);
}) },
}) });
} });
}
} }
export default new Http() export default new Http();

View File

@ -358,7 +358,8 @@ import { basePath } from '../../public'
uni.removeStorageSync('token') uni.removeStorageSync('token')
uni.removeStorageSync('userInfo') uni.removeStorageSync('userInfo')
uni.reLaunch({ uni.reLaunch({
url: '/pages/login/login' // url: '/pages/login/login'
url: '/pages/nwLogin/index'
}) })
} }
}) })

View File

@ -434,7 +434,8 @@
uni.removeStorageSync("token"); uni.removeStorageSync("token");
uni.removeStorageSync("userInfo"); uni.removeStorageSync("userInfo");
uni.reLaunch({ uni.reLaunch({
url: "/pages/login/login", // url: "/pages/login/login",
url: "/pages/nwLogin/index",
}); });
}, },
}); });

View File

@ -644,7 +644,8 @@
uni.removeStorageSync("token"); uni.removeStorageSync("token");
uni.removeStorageSync("userInfo"); uni.removeStorageSync("userInfo");
uni.reLaunch({ uni.reLaunch({
url: "/pages/login/login", // url: "/pages/login/login",
url: "/pages/nwLogin/index",
}); });
}, },
}); });

View File

@ -273,12 +273,12 @@
success: () => { success: () => {
uni.removeStorageSync("token"); uni.removeStorageSync("token");
uni.removeStorageSync("userInfo"); uni.removeStorageSync("userInfo");
uni.reLaunch({
url: "/pages/login/login",
});
// uni.reLaunch({ // uni.reLaunch({
// url: "/pages/nwLogin/index", // url: "/pages/login/login",
// }); // });
uni.reLaunch({
url: "/pages/nwLogin/index",
});
}, },
}); });
} }

View File

@ -456,7 +456,7 @@
? "测试环境或者线上ip" ? "测试环境或者线上ip"
: "本地调试ip"; : "本地调试ip";
uni.request({ uni.request({
url: "http://192.168.2.135:49080/code", url: "http://192.168.0.119:21624/sgzbgl-api/code",
method: "GET", method: "GET",
}).then((res) => { }).then((res) => {
this.phoneCodeUrlNew = this.phoneCodeUrlNew =

View File

@ -72,8 +72,8 @@
uni.removeStorageSync("token"); uni.removeStorageSync("token");
uni.removeStorageSync("userInfo"); uni.removeStorageSync("userInfo");
uni.reLaunch({ uni.reLaunch({
url: "/pages/login/login", // url: "/pages/login/login",
// url: "/pages/nwLogin/index", url: "/pages/nwLogin/index",
}); });
} }
}, },

915
router.js
View File

@ -1,469 +1,464 @@
import { RouterMount, createRouter } from 'uni-simple-router' import { RouterMount, createRouter } from "uni-simple-router";
const router = createRouter({ const router = createRouter({
platform: process.env.VUE_APP_PLATFORM, platform: process.env.VUE_APP_PLATFORM,
routes: [ routes: [
{ {
"path": "/pages/index/index", path: "/pages/index/index",
"name": 'index', name: "index",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/workSpace/workSpace", path: "/pages/workSpace/workSpace",
"name": 'workSpace', name: "workSpace",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/user/user", path: "/pages/user/user",
"name": 'user', name: "user",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
// 重庆登录页 // 重庆登录页
{ // {
"path": "/pages/login/login", // "path": "/pages/login/login",
"name": 'login' // "name": 'login'
}, // },
// // 南网登陆页 // 南网登陆页
// { {
// "path": "/pages/nwLogin/index", path: "/pages/nwLogin/index",
// "name": 'login' name: "login",
// }, },
{ {
"path": "/pages/fetchMaterial/fetchMaterial", path: "/pages/fetchMaterial/fetchMaterial",
"name": 'fetchMaterial', name: "fetchMaterial",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/exitMaterial/exitMaterial", path: "/pages/exitMaterial/exitMaterial",
"name": 'exitMaterial', name: "exitMaterial",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/workFetchMaterial/workFetchMaterial", path: "/pages/workFetchMaterial/workFetchMaterial",
"name": 'workFetchMaterial', name: "workFetchMaterial",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/workExitMaterial/workExitMaterial", path: "/pages/workExitMaterial/workExitMaterial",
"name": 'workExitMaterial', name: "workExitMaterial",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/deviceDetail/deviceDetail", path: "/pages/deviceDetail/deviceDetail",
"name": 'deviceDetail', name: "deviceDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/orderCart/orderCart", path: "/pages/orderCart/orderCart",
"name": 'orderCart', name: "orderCart",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/fetchExam/fetchExam", path: "/pages/fetchExam/fetchExam",
"name": 'fetchExam', name: "fetchExam",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/exitMaterialDetail/exitMaterialDetail", path: "/pages/exitMaterialDetail/exitMaterialDetail",
"name": 'exitMaterialDetail', name: "exitMaterialDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/fetchMaterialDetail/fetchMaterialDetail", path: "/pages/fetchMaterialDetail/fetchMaterialDetail",
"name": 'fetchMaterialDetail', name: "fetchMaterialDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/exitExam/exitExam", path: "/pages/exitExam/exitExam",
"name": 'exitExam', name: "exitExam",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/newInStore/newInStore", path: "/pages/newInStore/newInStore",
"name": 'newInStore', name: "newInStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/newBuyDetail/newBuyDetail", path: "/pages/newBuyDetail/newBuyDetail",
"name": 'newBuyDetail', name: "newBuyDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/newInAfterScan/newInAfterScan", path: "/pages/newInAfterScan/newInAfterScan",
"name": 'newInAfterScan', name: "newInAfterScan",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/fix/fix", path: "/pages/fix/fix",
"name": 'fix', name: "fix",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/fixDetail/fixDetail", path: "/pages/fixDetail/fixDetail",
"name": 'fixDetail', name: "fixDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/innerFix/innerFix", path: "/pages/innerFix/innerFix",
"name": 'innerFix', name: "innerFix",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/returnFix/returnFix", path: "/pages/returnFix/returnFix",
"name": 'returnFix', name: "returnFix",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/waitCrash/waitCrash", path: "/pages/waitCrash/waitCrash",
"name": 'waitCrash', name: "waitCrash",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/backMaterialInStore/backMaterialInStore", path: "/pages/backMaterialInStore/backMaterialInStore",
"name": 'backMaterialInStore', name: "backMaterialInStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/backMaterialInStoreDetail/backMaterialInStoreDetail", path: "/pages/backMaterialInStoreDetail/backMaterialInStoreDetail",
"name": 'backMaterialInStoreDetail', name: "backMaterialInStoreDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/repairTestInStore/repairTestInStore", path: "/pages/repairTestInStore/repairTestInStore",
"name": 'repairTestInStore', name: "repairTestInStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/fetchMaterialOutStore/fetchMaterialOutStore", path: "/pages/fetchMaterialOutStore/fetchMaterialOutStore",
"name": 'fetchMaterialOutStore', name: "fetchMaterialOutStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/backMaterialReceive/backMaterialReceive", path: "/pages/backMaterialReceive/backMaterialReceive",
"name": 'backMaterialReceive', name: "backMaterialReceive",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/repairTestInStoreDetail/repairTestInStoreDetail", path: "/pages/repairTestInStoreDetail/repairTestInStoreDetail",
"name": 'repairTestInStoreDetail', name: "repairTestInStoreDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/exitMaterialSelect/exitMaterialSelect", path: "/pages/exitMaterialSelect/exitMaterialSelect",
"name": 'exitMaterialSelect', name: "exitMaterialSelect",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/exitExamDetail/exitExamDetail", path: "/pages/exitExamDetail/exitExamDetail",
"name": 'exitExamDetail', name: "exitExamDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/crashExam/crashExam", path: "/pages/crashExam/crashExam",
"name": 'crashExam', name: "crashExam",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/crashExam/crashExamDetails", path: "/pages/crashExam/crashExamDetails",
"name": 'crashExamDetails', name: "crashExamDetails",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/crashExam/crashExamList", path: "/pages/crashExam/crashExamList",
"name": 'crashExamList', name: "crashExamList",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/testExam/testExam", path: "/pages/testExam/testExam",
"name": 'testExam', name: "testExam",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/testExam/testExamDetails", path: "/pages/testExam/testExamDetails",
"name": 'testExamDetails', name: "testExamDetails",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/testExam/testExamList", path: "/pages/testExam/testExamList",
"name": 'testExamList', name: "testExamList",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail", path: "/pages/fetchMaterialOutStoreDetail/fetchMaterialOutStoreDetail",
"name": 'fetchMaterialOutStoreDetail', name: "fetchMaterialOutStoreDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/codeOutStore/codeOutStore", path: "/pages/codeOutStore/codeOutStore",
"name": 'codeOutStore', name: "codeOutStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/scanOutStore/scanOutStore", path: "/pages/scanOutStore/scanOutStore",
"name": 'scanOutStore', name: "scanOutStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/backMaterialReceiveDetail/backMaterialReceiveDetail", path: "/pages/backMaterialReceiveDetail/backMaterialReceiveDetail",
"name": 'backMaterialReceiveDetail', name: "backMaterialReceiveDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/scanReceive/scanReceive", path: "/pages/scanReceive/scanReceive",
"name": 'scanReceive', name: "scanReceive",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/codeReceive/codeReceive", path: "/pages/codeReceive/codeReceive",
"name": 'codeReceive', name: "codeReceive",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/numReceive/numReceive", path: "/pages/numReceive/numReceive",
"name": 'numReceive', name: "numReceive",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/seeBackMaterialDetail/seeBackMaterialDetail", path: "/pages/seeBackMaterialDetail/seeBackMaterialDetail",
"name": 'seeBackMaterialDetail', name: "seeBackMaterialDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/authManage/authManage", path: "/pages/authManage/authManage",
"name": 'authManage', name: "authManage",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/moreNotice/moreNotice", path: "/pages/moreNotice/moreNotice",
"name": 'moreNotice', name: "moreNotice",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/rfidOutStore/rfidOutStore", path: "/pages/rfidOutStore/rfidOutStore",
"name": 'rfidOutStore', name: "rfidOutStore",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/rfidReceive/rfidReceive", path: "/pages/rfidReceive/rfidReceive",
"name": 'rfidReceive', name: "rfidReceive",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/noticeDetail/noticeDetail", path: "/pages/noticeDetail/noticeDetail",
"name": 'noticeDetail', name: "noticeDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/QROut/QROut", path: "/pages/QROut/QROut",
"name": 'QROut', name: "QROut",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/searchProjUsing/searchProjUsing", path: "/pages/searchProjUsing/searchProjUsing",
"name": 'searchProjUsing', name: "searchProjUsing",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/searchFetchRecord/searchFetchRecord", path: "/pages/searchFetchRecord/searchFetchRecord",
"name": 'searchFetchRecord', name: "searchFetchRecord",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/QRIn/QRIn", path: "/pages/QRIn/QRIn",
"name": 'QRIn', name: "QRIn",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/newCheck/newCheck", path: "/pages/newCheck/newCheck",
"name": 'newCheck', name: "newCheck",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/newCheck/newCheckDetail", path: "/pages/newCheck/newCheckDetail",
"name": 'newCheckDetail', name: "newCheckDetail",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/rfidBinding/rfidBinding", path: "/pages/rfidBinding/rfidBinding",
"name": 'rfidBinding', name: "rfidBinding",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/qrcodeBinding/qrcodeBinding", path: "/pages/qrcodeBinding/qrcodeBinding",
"name": 'qrcodeBinding', name: "qrcodeBinding",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/qrcodeBindPage/qrcodeBindPage", path: "/pages/qrcodeBindPage/qrcodeBindPage",
"name": 'qrcodeBindPage', name: "qrcodeBindPage",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/indexScan/indexScan", path: "/pages/indexScan/indexScan",
"name": 'indexScan', name: "indexScan",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
}, },
{ {
"path": "/pages/numLoanReceive/numLoanReceive", path: "/pages/numLoanReceive/numLoanReceive",
"name": 'numLoanReceive', name: "numLoanReceive",
"meta": { meta: {
"needAuth": "true" needAuth: "true",
} },
} },
] ],
}) });
//全局路由前置守卫 //全局路由前置守卫
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
let token = uni.getStorageSync('token') let token = uni.getStorageSync("token");
if (to.meta.needAuth) { if (to.meta.needAuth) {
if (token) { if (token) {
// console.log(1) // console.log(1)
next() next();
} else { } else {
uni.hideTabBar() uni.hideTabBar();
// console.log(2) // console.log(2)
uni.showToast({ uni.showToast({
icon: 'none', icon: "none",
title: '登录状态已过期,请重新登录!', title: "登录状态已过期,请重新登录!",
duration: 2000, duration: 2000,
success: () => { success: () => {
uni.hideTabBar() uni.hideTabBar();
next({ next({
name: 'login', name: "login",
NAVTYPE: 'replace' NAVTYPE: "replace",
}) });
} },
}) });
} }
} else { } else {
// console.log(3) // console.log(3)
next() next();
} }
}); });
// 全局路由后置守卫 // 全局路由后置守卫
router.afterEach((to, from) => { router.afterEach((to, from) => {});
}) export { router, RouterMount };
export {
router,
RouterMount
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -11344,7 +11344,7 @@ if(false) {}
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../HBuilderX.3.98.2023112510/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 16); var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../HBuilderX.3.98.2023112510/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/runtime/api.js */ 16);
exports = ___CSS_LOADER_API_IMPORT___(false); exports = ___CSS_LOADER_API_IMPORT___(false);
// Module // Module
exports.push([module.i, "\n.search-bar{\n\twidth: 95%;\n\tmargin: 20rpx auto;\n}\n uni-checkbox .uni-checkbox-input {\n\tborder-radius: 50%;\n}\n uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {\n\tborder-color: #ddd;\n\tcolor: #fff !important;\n\tbackground-color: #2DCF8C !important;\n}\n uni-checkbox .uni-checkbox-input {\n\tborder-color: #ddd;\n}\n uni-checkbox .uni-checkbox-input:hover {\n\tborder-color: #ddd;\n}\n.search {\n\tpadding-top: 20rpx;\n}\n.search .searchIput {\n\tbackground-color: #e6e6e6;\n\twidth: 95%;\n\tmargin: 0 auto;\n\theight: 72rpx;\n\tline-height: 72rpx;\n\tborder-radius: 50rpx;\n\tpadding: 0 32rpx;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n}\n.search .searchIput uni-input {\n\tfont-size: 26rpx;\n\twidth: 100%;\n\tcolor: grey;\n}\n.search .searchIput uni-image {\n\twidth: 34rpx;\n\theight: 34rpx;\n}\n.dataInfo {\n\twidth: 95%;\n\tmargin: 0 auto;\n}\n.dataInfo .dataList {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tborder-bottom: 2px solid #F1F1F1;\n\tpadding: 25rpx 0;\n}\n.dataInfo .dataList .details {\n\tdisplay: flex;\n\talign-items: center;\n\tflex: 1;\n\tfont-size: 0;\n}\n.dataInfo .dataList .details .img uni-image {\n\twidth: 200rpx;\n\theight: 140rpx;\n\tpadding: 0 20rpx;\n}\n.dataInfo .dataList .details .text uni-text {\n\tcolor: #000;\n\tfont-size: 23rpx;\n\tdisplay: block;\n\tpadding: 10rpx 0;\n}\n.dataInfo .dataList .details .text {\n\tcolor: red;\n\tfont-size: 25rpx;\n}\n.dataInfo .dataList .action uni-text {\n\tfont-size: 25rpx;\n\tcolor: #000;\n\tborder: 1px solid #C8C7CC;\n\tdisplay: inline-block;\n\tline-height: 50rpx;\n\twidth: 60rpx;\n\ttext-align: center;\n\tbox-sizing: border-box;\n}\n.dataInfo .dataList .action uni-text:nth-child(2) {\n\tborder-left: none;\n\tborder-right: none;\n}\n.buy {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tposition: fixed;\n\tleft: 50%;\n\tbottom: 0;\n\twidth: 95%;\n\t-webkit-transform: translate(-50%, 0);\n\t transform: translate(-50%, 0);\n}\n.buy .checked {\n\tdisplay: flex;\n\talign-items: center;\n}\n.buy .checked uni-text {\n\tfont-size: 25rpx;\n\tcolor: #000;\n\tpadding: 0 12rpx;\n}\n.buy .total {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n}\n.buy .total .price {\n\tpadding-right: 20rpx;\n}\n.buy .total .price uni-text {\n\tfont-size: 27rpx;\n\tcolor: #C8C7CC;\n\tdisplay: inline-block;\n}\n.buy .total .price uni-text:last-child {\n\tcolor: red;\n\tfont-weight: bold;\n}\n.buy .total .bill uni-text {\n\tfont-size: 25rpx;\n\tcolor: #fff;\n\tdisplay: inline-block;\n\tbackground-color: red;\n\tline-height: 70rpx;\n\twidth: 150rpx;\n\ttext-align: center;\n}\n", ""]); exports.push([module.i, "\n.search-bar {\n width: 95%;\n margin: 20rpx auto;\n}\n uni-checkbox .uni-checkbox-input {\n border-radius: 50%;\n}\n uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {\n border-color: #ddd;\n color: #fff !important;\n background-color: #2dcf8c !important;\n}\n uni-checkbox .uni-checkbox-input {\n border-color: #ddd;\n}\n uni-checkbox .uni-checkbox-input:hover {\n border-color: #ddd;\n}\n.search {\n padding-top: 20rpx;\n}\n.search .searchIput {\n background-color: #e6e6e6;\n width: 95%;\n margin: 0 auto;\n height: 72rpx;\n line-height: 72rpx;\n border-radius: 50rpx;\n padding: 0 32rpx;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n}\n.search .searchIput uni-input {\n font-size: 26rpx;\n width: 100%;\n color: grey;\n}\n.search .searchIput uni-image {\n width: 34rpx;\n height: 34rpx;\n}\n.dataInfo {\n width: 95%;\n margin: 0 auto;\n}\n.dataInfo .dataList {\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-bottom: 2px solid #f1f1f1;\n padding: 25rpx 0;\n}\n.dataInfo .dataList .details {\n display: flex;\n align-items: center;\n flex: 1;\n font-size: 0;\n}\n.dataInfo .dataList .details .img uni-image {\n width: 200rpx;\n height: 140rpx;\n padding: 0 20rpx;\n}\n.dataInfo .dataList .details .text uni-text {\n color: #000;\n font-size: 23rpx;\n display: block;\n padding: 10rpx 0;\n}\n.dataInfo .dataList .details .text {\n color: red;\n font-size: 25rpx;\n}\n.dataInfo .dataList .action uni-text {\n font-size: 25rpx;\n color: #000;\n border: 1px solid #c8c7cc;\n display: inline-block;\n line-height: 50rpx;\n width: 60rpx;\n text-align: center;\n box-sizing: border-box;\n}\n.dataInfo .dataList .action uni-text:nth-child(2) {\n border-left: none;\n border-right: none;\n}\n.buy {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: fixed;\n left: 50%;\n bottom: 0;\n width: 95%;\n -webkit-transform: translate(-50%, 0);\n transform: translate(-50%, 0);\n}\n.buy .checked {\n display: flex;\n align-items: center;\n}\n.buy .checked uni-text {\n font-size: 25rpx;\n color: #000;\n padding: 0 12rpx;\n}\n.buy .total {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.buy .total .price {\n padding-right: 20rpx;\n}\n.buy .total .price uni-text {\n font-size: 27rpx;\n color: #c8c7cc;\n display: inline-block;\n}\n.buy .total .price uni-text:last-child {\n color: red;\n font-weight: bold;\n}\n.buy .total .bill uni-text {\n font-size: 25rpx;\n color: #fff;\n display: inline-block;\n background-color: red;\n line-height: 70rpx;\n width: 150rpx;\n text-align: center;\n}\n", ""]);
// Exports // Exports
module.exports = exports; module.exports = exports;