1
0

2 コミット 327defe024 ... 76ca467aee

作者 SHA1 メッセージ 日付
  zk 76ca467aee 联调生产ui 2 年 前
  zk 4c681a2411 11111 2 年 前

+ 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))

+ 29 - 23
server/main_test.go

@@ -1,14 +1,11 @@
 package main
 
 import (
-	"fmt"
 	"github.com/flipped-aurora/gin-vue-admin/server/core"
 	"github.com/flipped-aurora/gin-vue-admin/server/global"
 	"github.com/flipped-aurora/gin-vue-admin/server/initialize"
-	"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
-	"github.com/flipped-aurora/gin-vue-admin/server/service"
-	"github.com/xuri/excelize/v2"
-	"strings"
+	"github.com/silenceper/wechat/v2/officialaccount/menu"
+	"go.uber.org/zap"
 	"testing"
 )
 
@@ -18,9 +15,18 @@ func TestName(t *testing.T) {
 	//vi:="gIEEvlb9cEjErJxZ5sflrw=="
 	//phone , _ := weapp.DecryptMobile(ssk, r, vi)
 	//fmt.Print(phone)
-	global.GVA_VP = core.Viper()      // 初始化Viper
-	global.GVA_LOG = core.Zap()       // 初始化zap日志库
-	global.GVA_DB = initialize.Gorm() // gorm连接数据库
+	global.GVA_VP = core.Viper() // 初始化Viper
+	global.GVA_LOG = core.Zap()  // 初始化zap日志库
+	//global.GVA_DB = initialize.Gorm() // gorm连接数据库
+	//initialize.Redis()  //连接redis
+	initialize.Wechat() //初始化微信公众服务
+	//_, resysDictionaryDetail := dictionaryDetailService.GetSysDictionaryDetail(8)
+	//fmt.Printf("\t%v", resysDictionaryDetail)
+	var menuAA []*menu.Button
+	menuAA = append(menuAA, &menu.Button{Type: "miniprogram", Name: "小程序", URL: "http://zk1006.cn", AppID: "wx0dc3e4978f919285", PagePath: "/pages/checking"})
+	menuAA = append(menuAA, &menu.Button{Type: "view", Name: "一键授权", URL: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=https://cc.zjkduoduo.com/api/wechat/auth&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"})
+	err := global.GVA_WECHAT.GetMenu().SetMenu(menuAA)
+	global.GVA_LOG.Info("错误", zap.Any("err", err))
 	//var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
 	//f,_:=excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\21类.xlsx")
 	//files := f.GetSheetList()
@@ -52,19 +58,19 @@ func TestName(t *testing.T) {
 	//	j++
 	//	fmt.Println()
 	//}
-	var places = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
-	f, _ := excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\点位信息(经开区).xlsx")
-	files := f.GetSheetList()
-	for _, sheet := range files {
-		rows, _ := f.GetRows(sheet)
-		for _, row := range rows {
-			if len(row) > 1 && row[1] != "" {
-				fmt.Printf("\t%v", row[0])
-				places.CreatePlace(autocode.Place{Name: strings.Replace(row[0], "\n", "", -1),Position:strings.Replace(row[1], "\n", "", -1) ,
-					Type:strings.Replace(row[2], "\n", "", -1),Region:strings.Replace(row[3], "\n", "", -1) })
-				fmt.Println()
-			}
-		}
-		fmt.Println()
-	}
+	//var places = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
+	//f, _ := excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\点位信息(经开区).xlsx")
+	//files := f.GetSheetList()
+	//for _, sheet := range files {
+	//	rows, _ := f.GetRows(sheet)
+	//	for _, row := range rows {
+	//		if len(row) > 1 && row[1] != "" {
+	//			fmt.Printf("\t%v", row[0])
+	//			places.CreatePlace(autocode.Place{Name: strings.Replace(row[0], "\n", "", -1), Position: strings.Replace(row[1], "\n", "", -1),
+	//				Type: strings.Replace(row[2], "\n", "", -1), Region: strings.Replace(row[3], "\n", "", -1)})
+	//			fmt.Println()
+	//		}
+	//	}
+	//	fmt.Println()
+	//}
 }

+ 1 - 1
server/service/autocode/unit.go

@@ -82,7 +82,7 @@ func (unitService *UnitService) GetUnitInfoList(info autoCodeReq.UnitSearch) (er
 	// 创建db
 	db := global.GVA_DB.Model(&autocode.Unit{})
 	if info.UnitName != "" {
-		db.Where("unit_name = ?", info.UnitName)
+		db.Where("unit_name like ?", "%"+info.UnitName+"%")
 	}
 	var units []autocode.Unit
 	// 如果有条件搜索 下方会自动创建搜索语句

+ 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"
 	},

+ 4 - 4
web/src/view/unitHistory/unitHistory.vue

@@ -16,9 +16,9 @@
               <el-button size="mini" type="text" @click="deleteVisible = false">取消</el-button>
               <el-button size="mini" type="primary" @click="onDelete">确定</el-button>
             </div>
-            <!--            <template #reference>-->
-            <!--              <el-button icon="el-icon-delete" size="mini" type="danger" style="margin-left: 10px;">批量删除</el-button>-->
-            <!--            </template>-->
+            <template #reference>
+              <el-button icon="el-icon-delete" size="mini" type="danger" style="margin-left: 10px;">批量删除</el-button>
+            </template>
           </el-popover>
         </el-form-item>
       </el-form>
@@ -52,7 +52,7 @@
       <el-table-column label="按钮组">
         <template #default="scope">
           <el-button size="small" type="primary" icon="el-icon-edit" class="table-button" @click="openProDialog(scope.row)">扣分详情</el-button>
-          <!--          <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>-->
+          <el-button type="danger" icon="el-icon-delete" size="mini" @click="deleteRow(scope.row)">删除</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 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), ''),
       }