From 5fc18c49a46b41ebf45a2c8a18fd039fc8d46103 Mon Sep 17 00:00:00 2001 From: zmt Date: Tue, 29 Mar 2022 11:41:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nxTemp/config/index.config.js | 27 +++++++++++++-------------- nxTemp/config/requestConfig.js | 2 +- package.json | 30 ++++++++++++++++++++++++------ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/nxTemp/config/index.config.js b/nxTemp/config/index.config.js index a1ef494..3bf42e0 100644 --- a/nxTemp/config/index.config.js +++ b/nxTemp/config/index.config.js @@ -1,35 +1,34 @@ const CONFIG = { //开发环境配置 - development: { + development: { + baseUrl: "http://testmanager.ouxuanzhineng.cn", //测试环境 + // baseUrl: "https://testmatch.ouxuanzhineng.cn", + testOpenId: "wxacdbba29503f6351", // 小程序测试openId loginTitleTxt: "development_wx", // 登录页标题 copyrightTxt: "XXXv1.0", // 版本信息 assetsPath: "http://cdn.com/img", // 静态资源路径 - // baseUrl: "http://testmanager.ouxuanzhineng.cn", //测试环境 - // baseUrl: "https://testmatch.ouxuanzhineng.cn", - baseUrl: "https://match.ouxuanzhineng.cn", - // tokenKey: "wxacdbba29503f6351", // 登录标识 测试环境 - tokenKey: "wxf368fa7316d6952f", // 登录标识 - testOpenId: "", // 小程序测试openId + tokenKey: "WECHAT_TRADE", // 登录标识 forcedLogin: false, // touristMode游客模式下APP是否强制用户登录 场景:当用户进入登录页面后无法后退。 touristMode: true, // APP是否开启游客模式, 游客模式true开启:APP打开后可以进入首页和无权限的页面,游客模式false关闭:APP打开后首先需要登录才能进入, 此时forcedLogin配置项失效。 showLog:true, //是否开启log }, //生产环境配置 - production: { + production: { + baseUrl: "https://match.ouxuanzhineng.cn", + testOpenId: "wxf368fa7316d6952f", // 小程序openId loginTitleTxt: "production_wx", // 登录页标题 copyrightTxt: "XXXv1.0", // 版本信息 assetsPath: "/static/img", // 静态资源路径 - // baseUrl: "https://testmatch.ouxuanzhineng.cn", // 测试环境 - baseUrl: "https://match.ouxuanzhineng.cn", tokenKey: "WECHAT_TRADE", // 登录标识 - // testOpenId: "wxacdbba29503f6351", // 小程序测试openId - testOpenId: "wxf368fa7316d6952f", // 小程序测试openId forcedLogin: false, // touristMode游客模式下APP是否强制用户登录 场景:当用户进入登录页面后无法后退。 touristMode: true, // APP是否开启游客模式, 游客模式true开启:APP打开后可以进入首页和无权限的页面,游客模式false关闭:APP打开后首先需要登录才能进入, 此时forcedLogin配置项失效。 showLog:true, //是否开启log } } -console.log(123,process.env.NODE_ENV); -export default CONFIG[process.env.NODE_ENV]; +console.log("NODE_ENV:",process.env.NODE_ENV); +// export default CONFIG[process.env.NODE_ENV]; +export default CONFIG['development'] +// export default CONFIG['production'] + diff --git a/nxTemp/config/requestConfig.js b/nxTemp/config/requestConfig.js index 9083f90..90bec50 100644 --- a/nxTemp/config/requestConfig.js +++ b/nxTemp/config/requestConfig.js @@ -100,7 +100,7 @@ $http.dataFactory = async function(res) { if(res.needLogin&&!res.data.token){ return Promise.reject({ statusCode: 0, - errMsg: "requestConfig.js:该接口需登录后调用,请检查userAPI配置及逻辑", + errMsg: "请先登录后尝试", data: res.url }); } diff --git a/package.json b/package.json index 39d5749..8a9b1e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,24 @@ -{ - "dependencies": { - "uni-read-pages": "^1.0.5", - "uni-simple-router": "^2.0.1" - } -} +{ + "dependencies": { + "uni-read-pages": "^1.0.5", + "uni-simple-router": "^2.0.1" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "dev": "NODE_ENV=development webpack --watch ", + "build": "NODE_ENV=development webpack --mode=production", + "dev:mp-weixin": "cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch --minimize" + }, + "name": "uni-events-helper-wx", + "description": "##### (1) 路由拦截 [uni-simple-router](https://hhyang.cn/) 路由、拦截、最优雅的解决方案", + "version": "1.0.0", + "main": "main.js", + "devDependencies": {}, + "repository": { + "type": "git", + "url": "https://git.ouxuan.net/APP/uni-events-helper-wx.git" + }, + "keywords": [], + "author": "", + "license": "ISC" +}