28 lines
726 B
Go
28 lines
726 B
Go
package main
|
|
|
|
import "net/http"
|
|
|
|
func handleWxWorkNewInstance(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodPost {
|
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
|
return
|
|
}
|
|
bundle := resolveDLLBundle()
|
|
if bundle.HelperPath == "" {
|
|
sendJSONResponse(w, http.StatusInternalServerError, map[string]interface{}{
|
|
"success": false,
|
|
"message": "helper DLL is unavailable: " + bundle.Message,
|
|
})
|
|
return
|
|
}
|
|
result, err := startAdditionalWxWorkInstance(bundle.HelperPath)
|
|
if err != nil {
|
|
sendJSONResponse(w, http.StatusInternalServerError, map[string]interface{}{
|
|
"success": false,
|
|
"message": err.Error(),
|
|
})
|
|
return
|
|
}
|
|
sendJSONResponse(w, http.StatusOK, result)
|
|
}
|