api_func_auth.go 502 B

1234567891011121314151617181920212223
  1. package route
  2. import (
  3. "opennamu/route/tool"
  4. jsoniter "github.com/json-iterator/go"
  5. )
  6. func Api_func_auth(call_arg []string) string {
  7. var json = jsoniter.ConfigCompatibleWithStandardLibrary
  8. other_set := map[string]string{}
  9. json.Unmarshal([]byte(call_arg[0]), &other_set)
  10. db := tool.DB_connect()
  11. defer db.Close()
  12. auth_name := tool.Get_user_auth(db, other_set["ip"])
  13. auth_info := tool.Get_auth_group_info(db, auth_name)
  14. json_data, _ := json.Marshal(auth_info)
  15. return string(json_data)
  16. }