zk пре 2 година
родитељ
комит
76ca467aee
5 измењених фајлова са 19 додато и 12 уклоњено
  1. 5 4
      server/api/v1/system/wechat.go
  2. 3 3
      web/.env.production
  3. 8 3
      web/README.md
  4. 2 1
      web/package.json
  5. 1 1
      web/vite.config.js

+ 5 - 4
server/api/v1/system/wechat.go

@@ -71,13 +71,14 @@ func (b *WechatApi) Req(c *gin.Context) {
 			} else {
 				global.GVA_LOG.Info("用户已存在", zap.Any("err", err), zap.Any("sysUser", sysUser))
 			}
-			text := message.NewText("【经开创城进行时】感谢您的关注!授权请点击此链接:https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=" + url.QueryEscape(
-				global.GVA_CONFIG.Wxxcx.AuthUrl+"/wechat/auth") + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect")
+
+			text := message.NewText("【经开创城进行时】感谢您的关注! \r\n <a href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=" + url.QueryEscape(
+				global.GVA_CONFIG.Wxxcx.AuthUrl) + "/wechat/auth&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'>点我授权</a>")
 			return &message.Reply{MsgType: message.MsgTypeText, MsgData: text}
 		}
 		if msg.Content == "授权" {
-			text := message.NewText("授权请点击此链接:https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=" + url.QueryEscape(
-				global.GVA_CONFIG.Wxxcx.AuthUrl+"/wechat/auth") + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect")
+			text := message.NewText("<a href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=" + url.QueryEscape(
+				global.GVA_CONFIG.Wxxcx.AuthUrl) + "/wechat/auth&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'>点我授权</a>")
 			return &message.Reply{MsgType: message.MsgTypeText, MsgData: text}
 		}
 		global.GVA_LOG.Info("用户消息", zap.Any("openId", msg.FromUserName), zap.Any("msg", msg))

+ 3 - 3
web/.env.production

@@ -1,7 +1,7 @@
 ENV = 'production'
 
-VITE_CLI_PORT = 8080
-VITE_SERVER_PORT = 8888
+VITE_CLI_PORT = 8081
+VITE_SERVER_PORT = 443
 VITE_BASE_API = /api
 #下方修改为你的线上ip
-VITE_BASE_PATH = https://text.zk1006.com
+VITE_BASE_PATH = https://cc.zjkduoduo.com

+ 8 - 3
web/README.md

@@ -5,12 +5,17 @@
 npm install
 ```
 
-### Compiles and hot-reloads for development
+### 启动开发环境
 ```
-npm run serve
+npm run dev
+
+```
+### 联调生产环境
+```
+npm run pro
 ```
 
-### Compiles and minifies for production
+### 打包编译,dist放入服务器目录
 ```
 npm run build
 ```

+ 2 - 1
web/package.json

@@ -3,7 +3,8 @@
 	"version": "2.3.5",
 	"private": true,
 	"scripts": {
-		"serve": "vite --host --mode development",
+		"dev": "vite --host --mode development",
+		"pro": "vite --host --mode production",
 		"build": "vite build --mode production",
 		"preview": "vite preview"
 	},

+ 1 - 1
web/vite.config.js

@@ -50,7 +50,7 @@ export default ({
        // 把key的路径代理到target位置
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VITE_BASE_API]: { // 需要代理的路径   例如 '/api'
-        target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`, // 代理到 目标路径
+        target: `${process.env.VITE_BASE_PATH}:${process.env.VITE_SERVER_PORT}/`+(process.env.NODE_ENV=='production'?'api':''), // 代理到 目标路径
         changeOrigin: true,
         rewrite: path => path.replace(new RegExp('^' + process.env.VITE_BASE_API), ''),
       }